:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 4px 24px rgba(15,23,42,0.06);
    --shadow-lg: 0 20px 60px rgba(15,23,42,0.12);
    --radius: 20px;
    --radius-sm: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #1e293b, #334155);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 40px 44px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    text-align: center;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.25);
}

.login-icon svg {
    width: 36px;
    height: 36px;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    color: #0f172a;
    font-weight: 800;
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.login-hint {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 20px;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form .form-group label {
    color: #334155;
    font-weight: 600;
}

.login-form .form-control {
    background: #fff;
    border-color: #e2e8f0;
    color: #0f172a;
    border-radius: 12px;
    padding: 12px 16px;
}

.login-form .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-form .btn-primary {
    background: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    width: 100%;
    margin-top: 6px;
}

.login-form .btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.4);
}

.login-form .alert {
    text-align: center;
    justify-content: center;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 20;
    box-shadow: 4px 0 24px rgba(15,23,42,0.04);
}

.sidebar-brand {
    height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand svg {
    color: var(--primary);
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(99,102,241,0.25));
}

.sidebar-brand span {
    background: linear-gradient(135deg, var(--text), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 26px;
}

.nav-group-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 14px;
    margin-bottom: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 5px;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(99,102,241,0.1);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary), 0 4px 12px rgba(99,102,241,0.08);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    background: rgba(241,245,249,0.5);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99,102,241,0.25);
}

/* Main */
.admin-main {
    flex: 1;
    margin-left: 270px;
    padding: 32px;
    max-width: calc(100% - 270px);
}

.page-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.card-title svg {
    color: var(--primary);
    width: 22px;
    height: 22px;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 6px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card-actions-right {
    justify-content: flex-end;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    width: 200px;
    padding: 10px 14px !important;
    font-size: 0.85rem !important;
}

.search-input-wide {
    width: 240px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

.stat-card.success::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.info::before { background: linear-gradient(90deg, var(--info), #60a5fa); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    color: var(--primary);
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.12);
}

.stat-card.success .stat-icon { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: var(--success); box-shadow: 0 4px 12px rgba(16,185,129,0.12); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: var(--warning); box-shadow: 0 4px 12px rgba(245,158,11,0.12); }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: var(--danger); box-shadow: 0 4px 12px rgba(239,68,68,0.12); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: var(--info); box-shadow: 0 4px 12px rgba(59,130,246,0.12); }

.stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -1px;
    color: var(--text);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-control:hover:not(:focus) {
    border-color: #cbd5e1;
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

textarea.form-control { resize: vertical; }

.form-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.form-row-align {
    align-items: stretch;
}

.form-row .form-group { flex: 1; min-width: 240px; }
.form-row .form-group.form-group-action {
    flex: 0 0 auto;
    min-width: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 0;
}
.form-row .form-group.form-group-action .btn {
    padding: 10px 28px;
    min-height: 46px;
    align-self: flex-end;
    white-space: nowrap;
}
.form-label-placeholder {
    color: transparent;
    user-select: none;
}

.form-hint-below {
    margin-top: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-grid .full-width { grid-column: 1 / -1; }

.form-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,23,42,0.12); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4); }

.btn-block { width: 100%; }

.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 10px; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: 8px; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    box-shadow: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f97316);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-success { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.alert-warning { background: #fffbeb; color: #b45309; border-color: #fef3c7; }

/* Tables */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    background: var(--surface);
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: #f8fafc;
    white-space: nowrap;
}

.data-table th.col-check,
.data-table td:first-child {
    width: 40px;
    text-align: center;
}

.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody tr:hover { background: #f8fafc; }

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--radius-sm); }
.data-table tbody tr:last-child td:last-child { border-radius: 0 0 var(--radius-sm) 0; }

.data-table code {
    background: var(--bg);
    padding: 5px 8px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    color: var(--primary-dark);
    border: 1px solid var(--border-light);
}

.data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.table-actions label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    user-select: none;
}

.result-count {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.result-count-block {
    margin-bottom: 12px;
}

.site-info-line {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.site-info-line strong {
    color: var(--text-main);
    font-weight: 600;
    display: inline-block;
    min-width: 44px;
}

.password-mask {
    font-family: var(--font-mono);
    color: var(--text-main);
}

/* 客户端站点上报 */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.client-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.client-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--border-light);
}

.client-code {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.client-domain {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    word-break: break-all;
}

.client-card-body {
    padding: 14px 18px;
}

.client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    gap: 12px;
}

.client-row:last-child {
    border-bottom: 0;
}

.client-label {
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 78px;
}

.client-url {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}

.client-url:hover {
    text-decoration: underline;
}

.client-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.client-card-footer {
    display: flex;
    gap: 10px;
    padding: 12px 18px 18px;
}

.client-card-updated {
    border-color: #fcd34d;
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.08);
}

.client-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.client-change-box {
    margin-top: 10px;
    padding: 12px 14px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 12px;
}

.client-change-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.client-change-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-change-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.client-change-field {
    color: #92400e;
    font-weight: 600;
    min-width: 78px;
    flex-shrink: 0;
}

.client-change-from {
    color: #94a3b8;
    text-decoration: line-through;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-change-to {
    color: #0f172a;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-change-list svg {
    color: #f59e0b;
    flex-shrink: 0;
}

.batch-form { margin: 0; }

.expire-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.expire-input {
    width: 70px !important;
    min-width: 70px;
    padding: 6px 8px !important;
    text-align: center;
}

.expire-input::placeholder { font-size: 0.75rem; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-success { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.badge-danger { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.badge-warning { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.badge-muted { background: #f1f5f9; color: var(--text-secondary); border-color: var(--border-light); }

/* Actions */
.actions { white-space: nowrap; display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline-block; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

small { color: var(--text-muted); font-size: 0.8rem; }

.flex-grow { flex: 1; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .admin-layout { flex-direction: column; }
    .admin-main { margin-left: 0; max-width: 100%; padding: 20px; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
    .nav-group { margin-bottom: 0; width: 100%; }
    .nav-link { display: inline-flex; margin-bottom: 0; }
    .form-row .form-group { min-width: 100%; }
    .form-row .form-group.form-group-action { flex: 1; min-width: 100%; }
    .form-row .form-group.form-group-action label { display: none; }
}

/* Copy button */
.copy-btn {
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 600;
    margin-left: 6px;
    transition: all 0.15s;
}

.copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* System status grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    box-shadow: var(--shadow-sm);
}

.status-box.status-ok {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--primary);
    flex-shrink: 0;
}

.status-box.status-ok .status-icon {
    background: #22c55e;
    color: #fff;
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.status-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 700;
}

/* License cards */
.license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.license-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.license-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.license-card-disabled {
    opacity: 0.72;
    background: #f8fafc;
}

.license-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border-light);
    background: #f8fafc;
}

.license-check {
    flex-shrink: 0;
    margin: 0;
}

.license-code-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.license-code {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--bg);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    word-break: break-all;
}

.license-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.license-card-body {
    padding: 16px 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
    flex: 1;
}

.license-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.license-field-full {
    grid-column: 1 / -1;
}

.license-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.license-field-value {
    font-size: 0.86rem;
    color: var(--text);
    word-break: break-all;
    line-height: 1.5;
}

.license-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--border-light);
    background: #f8fafc;
}

@media (max-width: 640px) {
    .license-grid {
        grid-template-columns: 1fr;
    }
    .license-card-body {
        grid-template-columns: 1fr;
    }
    .license-card-header {
        flex-wrap: wrap;
    }
    .license-status {
        flex-direction: row;
        align-items: center;
        width: 100%;
        margin-top: 4px;
    }
    .license-card-footer {
        justify-content: flex-start;
    }
}

.system-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.system-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.system-detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.system-detail-value {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    min-width: 0;
}

/* Report list on dashboard */
.report-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.report-main {
    flex: 1;
    min-width: 220px;
}

.report-code {
    font-weight: 700;
    margin-bottom: 6px;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.report-creds {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    align-items: center;
}

.report-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Section anchor target spacing */
section[id] { scroll-margin-top: 24px; }

/* Toast */
.toast-msg {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--text);
    color: #fff;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 100;
}
.toast-msg.show { opacity: 1; transform: translateY(0); }
