* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #0b1220;
    color: #f8fafc;
}

a {
    text-decoration: none;
    color: inherit;
}

.topbar {
    height: 82px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111c30;
    border-bottom: 1px solid #26344a;
}

.brand-link {
    display: block;
}

.brand {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #94a3b8;
    letter-spacing: 2px;
}

.container {
    width: min(1400px, calc(100% - 50px));
    margin: 32px auto 70px auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-heading h1,
.detail-header h1 {
    margin: 0;
    font-size: 30px;
}

.page-description,
.section-header p,
.section-note {
    color: #94a3b8;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 19px;
    border-radius: 9px;
    border: 0;
    font-weight: 700;
    cursor: pointer;
}

.button-primary {
    background: #2563eb;
    color: white;
}

.button-primary:hover {
    background: #1d4ed8;
}

.button-secondary {
    background: #26344a;
    color: #e2e8f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 34px;
}

.stat-card {
    background: #152238;
    border: 1px solid #26344a;
    border-radius: 13px;
    padding: 20px;
}

.stat-label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.stat-value {
    margin-top: 8px;
    font-size: 31px;
    font-weight: 800;
}

.section-header {
    margin: 30px 0 18px;
}

.section-header h2 {
    margin-bottom: 5px;
}

.agency-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.agency-card {
    display: block;
    background: #152238;
    border: 1px solid #26344a;
    border-radius: 14px;
    padding: 22px;
    transition: 0.15s;
}

.agency-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
}

.agency-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.agency-name {
    font-size: 21px;
    font-weight: 800;
}

.agency-code,
.detail-code {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.status-badge {
    border-radius: 30px;
    padding: 8px 11px;
    font-size: 11px;
    font-weight: 800;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.status-badge.neutral {
    background: #26344a;
    color: #94a3b8;
}

.agency-info {
    margin-top: 20px;
}

.info-row {
    padding: 9px 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #26344a;
    color: #94a3b8;
}

.info-row strong {
    color: #f8fafc;
}

.sport-tags {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sport-tag {
    padding: 7px 11px;
    background: #253653;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    padding: 70px 20px;
    text-align: center;
    background: #152238;
    border: 1px dashed #334155;
    border-radius: 14px;
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #253653;
    font-size: 32px;
}

.form-card {
    background: #152238;
    border: 1px solid #26344a;
    border-radius: 14px;
    overflow: hidden;
}

.form-section {
    padding: 25px;
    border-bottom: 1px solid #26344a;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-small {
    max-width: 260px;
}

.form-group label {
    font-weight: 700;
}

.form-group small {
    color: #64748b;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    height: 45px;
    padding: 0 13px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f1a2c;
    color: white;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #3b82f6;
}

.input-prefix {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.option-card {
    min-height: 70px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    background: #0f1a2c;
    border: 1px solid #334155;
    border-radius: 10px;
    cursor: pointer;
}

.option-card input {
    width: 19px;
    height: 19px;
}

.option-card div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-card span {
    font-size: 11px;
    color: #4ade80;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 13px;
    cursor: pointer;
}

.switch-row input {
    width: 20px;
    height: 20px;
}

.switch-row div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.switch-row span {
    color: #94a3b8;
    font-size: 13px;
}

.form-actions {
    padding: 20px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.flash {
    margin-bottom: 20px;
    padding: 14px 17px;
    border-radius: 9px;
    font-weight: 700;
}

.flash-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.detail-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.detail-card {
    padding: 21px;
    background: #152238;
    border: 1px solid #26344a;
    border-radius: 13px;
}

.detail-card h2 {
    margin-top: 0;
    font-size: 16px;
}

.detail-full {
    margin-top: 16px;
}

.big-status {
    font-size: 16px;
    font-weight: 800;
}

.detail-number {
    font-size: 30px;
    font-weight: 800;
}

.detail-small {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.token-box {
    margin-top: 15px;
    padding: 15px;
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 8px;
    font-family: monospace;
    word-break: break-all;
}

.status-green {
    color: #4ade80 !important;
}

.status-red {
    color: #f87171 !important;
}

.status-yellow {
    color: #facc15 !important;
}

.status-neutral {
    color: #94a3b8 !important;
}

@media (max-width: 950px) {

    .stats-grid,
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .agency-grid {
        grid-template-columns: 1fr;
    }

    .option-grid {
        grid-template-columns: 1fr 1fr;
    }

}

@media (max-width: 600px) {

    .topbar {
        padding: 0 16px;
    }

    .container {
        width: calc(100% - 24px);
    }

    .stats-grid,
    .detail-grid,
    .form-grid,
    .option-grid {
        grid-template-columns: 1fr;
    }

}
.detail-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.management-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.management-actions form {
    margin: 0;
}

.button-warning {
    background: #d97706;
    color: white;
}

.button-warning:hover {
    background: #b45309;
}

.button-success {
    background: #16a34a;
    color: white;
}

.button-success:hover {
    background: #15803d;
}

.button-danger {
    background: #dc2626;
    color: white;
}

.button-danger:hover {
    background: #b91c1c;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.35);
}

.danger-note {
    margin-top: 15px;
    color: #94a3b8;
    font-size: 13px;
}

@media (max-width: 700px) {

    .detail-header {
        align-items: flex-start;
        gap: 18px;
        flex-direction: column;
    }

    .detail-actions {
        width: 100%;
        flex-wrap: wrap;
    }

}