/* AlertSys - light professional theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* Reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Inter', sans-serif;
    background: #f4f5f7;
    color: #1a1d23;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
hr { border: none; border-top: 1px solid #e3e6ea; margin: 1.5rem 0; }

/* Layout */
.app-wrap {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e3e6ea;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.main-content {
    margin-left: 230px;
    flex: 1;
    padding: 2.5rem 2.8rem;
    max-width: 1200px;
}

/* Sidebar internals */
.sidebar-logo {
    padding: 1.4rem 1.4rem 1.2rem;
    border-bottom: 1px solid #e3e6ea;
}
.sidebar-logo .wordmark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #1a1d23;
}
.sidebar-logo .wordmark span { color: #2563eb; }
.sidebar-logo .tagline {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-top: 3px;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 0.8rem 0.7rem;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    font-weight: 400;
}
.nav-item:hover { background: #f4f5f7; color: #374151; }
.nav-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}
.nav-badge {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #dc2626;
    background: #fef2f2;
    padding: 1px 6px;
    border-radius: 10px;
}

.sidebar-status {
    padding: 0.75rem 1.2rem;
    border-top: 1px solid #e3e6ea;
    font-size: 0.78rem;
}
.status-ok       { color: #9ca3af; }
.status-warning  { color: #d97706; }
.status-critical { color: #dc2626; }

.sidebar-user {
    padding: 0.8rem 1.2rem 1.2rem;
    border-top: 1px solid #e3e6ea;
    font-size: 0.78rem;
    color: #9ca3af;
}
.sidebar-user a {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    border: 1px solid #e3e6ea;
    border-radius: 4px;
    padding: 3px 10px;
    transition: border-color 0.1s, color 0.1s;
}
.sidebar-user a:hover { color: #374151; border-color: #9ca3af; }

/* Page header */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #111827;
    line-height: 1.2;
}
.page-header .subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 400;
}

/* Section headings */
.section-heading {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
    margin: 2.5rem 0 1rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #e3e6ea;
}

/* Metric strip */
.metric-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 0.5rem;
}
.metric-card {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 16px 18px;
}
.metric-card .metric-label {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-bottom: 6px;
}
.metric-card .metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 500;
    color: #111827;
    line-height: 1;
}
.metric-card .metric-delta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    margin-top: 4px;
}
.metric-card .metric-delta.positive { color: #16a34a; }
.metric-card .metric-delta.negative { color: #dc2626; }

/* Alert cards */
.alert-list { display: flex; flex-direction: column; gap: 8px; }

.alert-card {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-left: 3px solid;
    border-radius: 8px;
    padding: 16px 20px;
    transition: box-shadow 0.15s;
}
.alert-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.alert-card.critical { border-left-color: #dc2626; }
.alert-card.warning  { border-left-color: #d97706; }
.alert-card.win      { border-left-color: #16a34a; }
.alert-card.info     { border-left-color: #2563eb; }

.alert-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}
.badge-critical { background: #fef2f2; color: #dc2626; }
.badge-warning  { background: #fffbeb; color: #d97706; }
.badge-win      { background: #f0fdf4; color: #16a34a; }
.badge-info     { background: #eff6ff; color: #2563eb; }

.unread-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: #2563eb;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}

.alert-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}
.alert-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.1;
    margin: 6px 0 2px;
}
.alert-value.critical { color: #dc2626; }
.alert-value.warning  { color: #d97706; }
.alert-value.win      { color: #16a34a; }
.alert-value.info     { color: #2563eb; }
.alert-value-ctx {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 6px;
}
.alert-body {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}
.alert-action {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e3e6ea;
    border-radius: 4px;
    padding: 4px 12px;
}
.alert-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.btn-sm {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 5px;
    border: 1px solid #e3e6ea;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: border-color 0.1s, color 0.1s, background 0.1s;
    font-family: 'Inter', sans-serif;
}
.btn-sm:hover { border-color: #9ca3af; color: #374151; background: #f9fafb; }

/* Health score */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}
.health-card {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 22px 18px;
    text-align: center;
}
.health-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.6rem;
    font-weight: 500;
    line-height: 1;
}
.health-label {
    font-size: 0.68rem;
    color: #9ca3af;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* Score bars */
.score-breakdown { display: flex; flex-direction: column; gap: 12px; }
.score-row-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    color: #374151;
    margin-bottom: 5px;
}
.score-row-header .pts {
    font-family: 'JetBrains Mono', monospace;
    color: #9ca3af;
    font-size: 0.75rem;
}
.score-bar-track {
    background: #f3f4f6;
    border-radius: 3px;
    height: 5px;
}
.score-bar-fill {
    height: 5px;
    border-radius: 3px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table th {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid #e3e6ea;
    background: #f9fafb;
    white-space: nowrap;
}
.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.data-table .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}
.data-table .overdue { color: #dc2626; font-weight: 500; }
.table-wrap {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    overflow: hidden;
}

/* Forms */
.form-section {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 24px 26px;
    margin-bottom: 1rem;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
    font-size: 0.8rem;
    color: #374151;
    font-weight: 500;
}
.form-input,
.form-select,
.form-textarea {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #111827;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    padding: 9px 12px;
    transition: border-color 0.1s, box-shadow 0.1s;
    width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}
.btn-primary {
    background: #2563eb;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 9px 22px;
    cursor: pointer;
    transition: background 0.1s;
    margin-top: 18px;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 9px 22px;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
    margin-top: 18px;
}
.btn-secondary:hover { border-color: #9ca3af; background: #f9fafb; }

/* Notices */
.notice {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.notice-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.notice.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.notice.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice.error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice.info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f5f7;
}
.login-box { width: 380px; }
.login-logo { margin-bottom: 2rem; text-align: center; }
.login-logo .wordmark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #111827;
}
.login-logo .wordmark span { color: #2563eb; }
.login-logo .tagline {
    font-size: 0.68rem;
    color: #9ca3af;
    letter-spacing: 0.1em;
    margin-top: 4px;
    text-transform: uppercase;
}
.login-card {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.login-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}
.login-error {
    font-size: 0.82rem;
    color: #dc2626;
    margin-top: 10px;
    min-height: 18px;
}

/* Charts */
.chart-wrap {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 1rem;
}
.chart-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 14px;
}

/* Tabs */
.tab-bar {
    display: flex;
    border-bottom: 1px solid #e3e6ea;
    margin-bottom: 1.5rem;
}
.tab-item {
    padding: 10px 18px;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.1s;
    font-weight: 400;
}
.tab-item:hover { color: #374151; }
.tab-item.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 500;
}

/* Empty state */
.empty-state {
    background: #ffffff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 48px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1.5rem; }
}