/* SNMP OLT ZTE Monitor - Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg:         #0f1117;
    --bg2:        #161923;
    --bg3:        #1e2333;
    --border:     #2a3048;
    --text:       #e2e8f0;
    --text-muted: #718096;
    --primary:    #3b82f6;
    --primary-dk: #2563eb;
    --success:    #10b981;
    --danger:     #ef4444;
    --warning:    #f59e0b;
    --info:       #06b6d4;
    --code-bg:    #1a1f2e;
    --radius:     8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ======= NAVBAR ======= */
.navbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.navbar-brand i { font-size: 22px; }

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 4px;
}

.navbar-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.navbar-menu a:hover { background: var(--bg3); color: var(--text); }
.nav-logout { color: var(--danger) !important; }
.nav-logout:hover { background: rgba(239,68,68,0.1) !important; }

/* ======= CONTAINER ======= */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* ======= PAGE HEADER ======= */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.page-header p { color: var(--text-muted); font-size: 14px; }

/* ======= STATS GRID ======= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--primary); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card.online .stat-icon  { background: rgba(59,130,246,0.15); color: var(--primary); }
.stat-card.success .stat-icon { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-card.danger .stat-icon  { background: rgba(239,68,68,0.15);  color: var(--danger); }
.stat-card.info .stat-icon    { background: rgba(6,182,212,0.15);   color: var(--info); }

.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ======= CARDS ======= */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2, .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px; }

/* ======= TABLE ======= */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    padding: 10px 12px;
    text-align: left;
    background: var(--bg3);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ======= BADGES ======= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success  { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-danger   { background: rgba(239,68,68,0.15);  color: var(--danger); }
.badge-warning  { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-info     { background: rgba(6,182,212,0.15);  color: var(--info); }
.badge-secondary{ background: rgba(113,128,150,0.15);color: var(--text-muted); }

/* ======= BUTTONS ======= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-warning   { background: var(--warning); color: #000; }
.btn-info      { background: var(--info);    color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ======= FORMS ======= */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control::placeholder { color: var(--text-muted); }

.form-row { display: flex; gap: 16px; }
.form-group.half { flex: 1; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; }

/* ======= ALERTS ======= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: rgba(16,185,129,0.1);  border: 1px solid rgba(16,185,129,0.3);  color: var(--success); }
.alert-danger  { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.3);   color: var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.3);  color: var(--warning); }

/* ======= CODE ======= */
code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--info);
}

/* ======= LOGIN ======= */
.login-body {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-wrapper { width: 100%; max-width: 380px; padding: 20px; }

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo i {
    font-size: 48px;
    color: var(--primary);
    display: block;
    margin-bottom: 12px;
}
.login-logo h1 { font-size: 22px; font-weight: 700; }
.login-logo p  { color: var(--text-muted); font-size: 14px; }
.login-footer  { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 16px; }

/* ======= DETAIL PAGE ======= */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px;
    margin-bottom: 20px;
}

.info-table { width: 100%; font-size: 14px; }
.info-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-table td:first-child { color: var(--text-muted); width: 40%; }
.info-table tr:last-child td { border-bottom: none; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.metric-box {
    background: var(--bg3);
    border-radius: var(--radius);
    padding: 14px;
}
.metric-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.metric-value { font-size: 14px; font-weight: 600; }
.metric-value.big { font-size: 24px; font-weight: 700; }
.metric-value.green { color: var(--success); }
.metric-value.red   { color: var(--danger); }

.progress-bar-wrap {
    background: var(--bg);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}
.progress-bar {
    height: 100%;
    border-radius: 20px;
    background: var(--primary);
    transition: width 0.5s ease;
}

/* ======= FILTER BAR ======= */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* ======= MISC ======= */
.text-center { text-align: center; }
.text-danger { color: var(--danger); }

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .metrics-grid { grid-template-columns: 1fr; }
    .navbar-menu { gap: 0; }
    .navbar-menu a span { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
