*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    font-size: 14px;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
header {
    background: #12122a;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.header-left h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.last-sync {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#search {
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    width: 230px;
    background: #1e1e3a;
    color: #fff;
    outline: none;
    transition: background .15s;
}
#search::placeholder { color: #555; }
#search:focus { background: #2a2a4a; }

/* ── Toggle ─────────────────────────────────────────────── */
.toggle-group {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
}
.toggle-btn {
    padding: 7px 16px;
    background: transparent;
    color: #888;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}
.toggle-btn.active  { background: #4f46e5; color: #fff; }
.toggle-btn:hover:not(.active) { background: #1e1e3a; color: #ccc; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: opacity .15s;
    white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: .85; }
.btn-sync    { background: #10b981; color: #fff; }
.btn-refresh { background: #3b82f6; color: #fff; }

/* ── Summary badges ─────────────────────────────────────── */
.summary {
    padding: 12px 24px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-expired  { background: #fee2e2; color: #b91c1c; }
.badge-expiring { background: #fef3c7; color: #b45309; }
.badge-total    { background: #e5e7eb; color: #6b7280; }

/* ── Status bar ─────────────────────────────────────────── */
.status-bar {
    margin: 0 24px 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    transition: opacity .3s;
}
.status-bar.hidden     { display: none; }
.status-success { background: #d1fae5; color: #065f46; }
.status-error   { background: #fee2e2; color: #991b1b; }
.status-info    { background: #dbeafe; color: #1e40af; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap {
    margin: 0 24px 32px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

thead th {
    background: #12122a;
    color: #777;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .5px;
    padding: 11px 14px;
    text-align: left;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { filter: brightness(.97); }

td {
    padding: 10px 14px;
    vertical-align: middle;
    white-space: nowrap;
}

.col-id     { color: #888; font-size: 12px; }
.col-domain { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; font-weight: 500; }

/* ── Row tints ──────────────────────────────────────────── */
.row-expired  { background: #fff5f5; }
.row-both     { background: #fffbeb; }
.row-expiring { background: #fefce8; }
.row-ok       { background: #fff; }

/* ── Type badges ────────────────────────────────────────── */
.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.type-standard { background: #dbeafe; color: #1d4ed8; }
.type-wildcard { background: #ede9fe; color: #6d28d9; }

/* ── Status badges ──────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.status-expired  { background: #fee2e2; color: #dc2626; }
.status-both     { background: #fde68a; color: #92400e; }
.status-expiring { background: #fef3c7; color: #b45309; }
.status-ok       { background: #d1fae5; color: #065f46; }

/* ── Days left ──────────────────────────────────────────── */
.days-negative { color: #dc2626; font-weight: 700; }
.days-critical { color: #ea580c; font-weight: 700; }
.days-warning  { color: #d97706; font-weight: 600; }
.days-ok       { color: #16a34a; }
.na            { color: #d1d5db; }

/* ── Recheck button ─────────────────────────────────────── */
.btn-recheck {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 3px 9px;
    cursor: pointer;
    color: #9ca3af;
    font-size: 15px;
    line-height: 1;
    transition: all .1s;
}
.btn-recheck:hover    { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.btn-recheck:disabled { opacity: .4; cursor: not-allowed; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #9ca3af;
    line-height: 1.8;
}
.empty-state code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; color: #374151; font-size: 13px; }
.empty-hint { font-size: 13px; margin-top: 8px; }
.hidden { display: none; }
