:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --border: #e9edf4;
    --text: #0b1b33;
    --muted: #657a93;
    --muted-2: #889bb2;
    --accent: #2a6df4;
    --accent-soft: #f0f4fe;
    --ok: #22b573;
    --ok-soft: #e6f6ef;
    --danger: #e55353;
    --danger-soft: #fdecec;
    --warn: #f5a524;
    --warn-soft: #fef6e6;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(11,27,51,.04);
    --shadow-lg: 0 8px 24px rgba(11,27,51,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif; }

body { background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; font-size: 14px; }

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

/* ---- Header ---- */
.header {
    background: var(--surface); padding: 0 2rem; height: 66px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    flex-shrink: 0; position: sticky; top: 0; z-index: 20;
}
.logo-area { display: flex; align-items: center; gap: .65rem; }
.logo-icon {
    background: var(--accent); width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    font-size: 1.2rem; box-shadow: 0 4px 10px rgba(42,109,244,.25);
}
.logo-text { font-weight: 700; font-size: 1.25rem; letter-spacing: -.3px; }
.logo-text span { color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: 4px; margin-left: 2rem; }
.header-nav a {
    color: var(--muted); font-weight: 600; font-size: .86rem; padding: 8px 14px;
    border-radius: 8px; text-decoration: none;
}
.header-nav a:hover, .header-nav a.active { background: var(--accent-soft); color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.user-badge {
    display: flex; align-items: center; gap: .5rem; background: var(--bg);
    padding: .4rem 1rem .4rem .7rem; border-radius: 40px; font-size: .85rem; font-weight: 600;
}
.btn-logout { color: var(--muted); font-size: .82rem; font-weight: 600; }

/* ---- Layout ---- */
.main-content { flex: 1; padding: 2rem; max-width: 1400px; margin: 0 auto; width: 100%; }

/* ---- Filter bar ---- */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: .82rem; color: var(--muted); font-weight: 600; margin-right: 4px; }
.filter-btn {
    background: var(--surface); border: 1px solid var(--border); color: var(--muted);
    padding: 7px 14px; border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.filter-btn.active, .filter-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-search {
    display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 14px; min-width: 240px;
}
.filter-search input { border: none; outline: none; background: none; font-size: .85rem; flex: 1; color: var(--text); }

/* ---- Section title ---- */
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.section-title h2 { font-size: 1.1rem; font-weight: 700; }
.badge-count { background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

/* ---- Card grid ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.card.urgent { border-color: var(--danger); background: linear-gradient(180deg, var(--danger-soft) 0%, var(--surface) 60px); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.card-url { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.card-expiry-tag { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.card-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.card-info { display: flex; justify-content: space-between; font-size: .82rem; }
.card-info span:first-child { color: var(--muted); }
.card-info span:last-child { font-weight: 600; }
.card-extra { display: flex; gap: 8px; margin-top: 6px; }
.card-extra a, .card-extra button {
    flex: 1; text-align: center; padding: 8px; border-radius: 8px; font-size: .78rem; font-weight: 700;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.card-extra a:hover, .card-extra button:hover { background: var(--bg); text-decoration: none; }

/* ---- Status ---- */
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.danger { background: var(--danger); }
.status-dot.off { background: var(--muted-2); }

.no-results { text-align: center; padding: 60px 20px; color: var(--muted); }
.footer-note { padding: 16px 2rem; text-align: center; font-size: .78rem; color: var(--muted); }

/* ---- Forms / general components ---- */
.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: .88rem; }
.notice-ok { background: var(--ok-soft); border: 1px solid var(--ok); color: #166534; }
.notice-error { background: var(--danger-soft); border: 1px solid var(--danger); color: #991b1b; }
.notice-warn { background: var(--warn-soft); border: 1px solid var(--warn); color: #854d0e; }

.fcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.fcard h3 { font-size: .95rem; margin-bottom: 14px; }

.fr { margin-bottom: 14px; }
.fr label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .02em; }
.fr input[type=text], .fr input[type=password], .fr input[type=number], .fr input[type=date], .fr input[type=url], .fr select, .fr textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; background: var(--surface); color: var(--text);
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: none; font-weight: 700; font-size: .85rem; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d5bd9; text-decoration: none; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-wa { background: #25D366; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.chip-protected { background: var(--accent-soft); color: var(--accent); }

.muted { color: var(--muted); }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: .85em; }

/* ---- Login ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0b1b33 0%, #16233d 100%); }
.login-box { background: var(--surface); border-radius: 16px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box .logo-area { justify-content: center; margin-bottom: 24px; }

/* ---- Grid helpers ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } .header-nav { display: none; } }
