:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --accent: #2f6fed;
    --accent-dark: #214eb6;
    --danger: #d7263d;
    --text: #1d2433;
    --muted: #6b7280;
    --border: #e0e7ff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #0f172a;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar nav a {
    margin-left: 1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}
.topbar nav a.active {
    color: #fff;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.2rem;
}
.topbar nav a.logout { color: #fca5a5; }

.brand { font-size: 1.25rem; font-weight: 600; }

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.container.narrow { max-width: 720px; }

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
}
.card.compact { max-width: 420px; margin: 2rem auto; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.section-side {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
th { font-size: 0.9rem; color: var(--muted); }

td.actions { white-space: nowrap; }
.inline { display: inline; }

.tag {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.tag.domain { background: #c7d2fe; color: #1e1b4b; }
.tag.hosting { background: #bfdbfe; color: #0f172a; }

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    background: #e5e7eb;
    color: #111827;
}
.status-pill.small { font-size: 0.72rem; margin-top: 0.2rem; }
.status-pill.status-active { background: #dcfce7; color: #166534; }
.status-pill.status-expire-soon { background: #fef3c7; color: #92400e; }
.status-pill.status-do-not-renew { background: #e5e7eb; color: #374151; }
.status-pill.status-expired { background: #fee2e2; color: #7f1d1d; }

.btn {
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #a61b2c; }

.notice {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    transition: opacity 0.5s ease;
}
.notice.success { background: #dcfce7; color: #14532d; }
.notice.error { background: #fee2e2; color: #7f1d1d; }
.notice.fade-out { opacity: 0; }

.muted { color: var(--muted); font-size: 0.9rem; }

.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px dotted var(--border); font-size: 0.9rem; }
.mini-list li:last-child { border-bottom: none; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem 1.5rem;
}
.form-grid label { font-weight: 600; font-size: 0.9rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.35rem; }
input, select, textarea {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    font-family: inherit;
}
textarea { resize: vertical; }

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #dbeafe, #e0e7ff);
}
.auth-card {
    width: min(460px, 92%);
    text-align: center;
}
.auth-card .card { margin-top: 1rem; }

.subtitle { color: var(--muted); }

.layout-simple { background: var(--bg); }
.warning { color: var(--danger); font-weight: 600; }

.notice + form .warning { margin-bottom: 1rem; }

@media (max-width: 640px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .topbar nav { margin-top: 0.75rem; }
}
