/* SuperAdmin Panel Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* Nav */
.sa-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #1B2E4B;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.sa-nav-brand { display: flex; align-items: baseline; gap: 8px; margin-right: 16px; }
.sa-nav-logo { color: #F59E0B; font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.sa-nav-label { color: rgba(255,255,255,.45); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.sa-nav-links { display: flex; gap: 4px; flex: 1; }
.sa-nav-link {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.sa-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sa-nav-link.active { background: rgba(245,158,11,.15); color: #F59E0B; }
.sa-nav-user { display: flex; align-items: center; gap: 16px; }
.sa-nav-user span { color: rgba(255,255,255,.7); font-size: 13px; }

/* Content */
.sa-content { margin-top: 56px; padding: 32px; max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Page header */
.sa-page-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; }
.sa-page-title { font-size: 24px; font-weight: 700; color: #1B2E4B; }
.sa-page-subtitle { font-size: 14px; color: #6b7280; margin-top: 2px; }

/* Stats grid */
.sa-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.sa-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sa-stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #9ca3af; margin-bottom: 6px; }
.sa-stat-value { font-size: 32px; font-weight: 800; color: #1B2E4B; }
.sa-stat-sub { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* Card */
.sa-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    margin-bottom: 24px;
}
.sa-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sa-card-title { font-size: 15px; font-weight: 600; color: #1B2E4B; }

/* Table */
.sa-table { width: 100%; border-collapse: collapse; }
.sa-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #9ca3af;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.sa-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f8f8f8;
    vertical-align: middle;
}
.sa-table tr:last-child td { border-bottom: none; }
.sa-table tr:hover td { background: #fafcff; }

/* Badges */
.sa-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.sa-badge-green { background: #d1fae5; color: #065f46; }
.sa-badge-red   { background: #fee2e2; color: #991b1b; }
.sa-badge-blue  { background: #dbeafe; color: #1e40af; }
.sa-badge-gray  { background: #f3f4f6; color: #374151; }

/* Forms */
.sa-form { padding: 24px; }
.sa-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sa-form-group { margin-bottom: 18px; }
.sa-form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.sa-form-group input,
.sa-form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #111;
    transition: border-color .15s;
}
.sa-form-group input:focus,
.sa-form-group select:focus {
    outline: none;
    border-color: #1B2E4B;
    box-shadow: 0 0 0 3px rgba(27,46,75,.08);
}
.sa-checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.sa-checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sa-checkbox-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1B2E4B; }
.sa-form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid #f0f0f0; margin-top: 8px; }

/* Buttons */
.sa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
}
.sa-btn:active { transform: scale(.98); }
.sa-btn-primary { background: #1B2E4B; color: #fff; }
.sa-btn-primary:hover { opacity: .85; }
.sa-btn-amber { background: #F59E0B; color: #fff; }
.sa-btn-amber:hover { opacity: .85; }
.sa-btn-outline { background: transparent; color: #1B2E4B; border: 1.5px solid #1B2E4B; }
.sa-btn-outline:hover { background: #1B2E4B; color: #fff; }
.sa-btn-danger { background: #ef4444; color: #fff; }
.sa-btn-danger:hover { opacity: .85; }
.sa-btn-sm { padding: 5px 12px; font-size: 12px; }

/* Alert */
.sa-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}
.sa-alert-error { background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }
.sa-alert-success { background: #d1fae5; color: #065f46; border-left: 3px solid #10b981; }

/* Auth page */
.sa-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1B2E4B;
}
.sa-auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.sa-auth-logo { text-align: center; margin-bottom: 24px; }
.sa-auth-logo-text { font-size: 28px; font-weight: 800; color: #1B2E4B; }
.sa-auth-logo-sub { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: #9ca3af; margin-top: 2px; }
.sa-auth-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: #1B2E4B; }
.sa-auth-error { display: none; }

/* Toggle */
.sa-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
.sa-toggle input { width: 36px; height: 20px; accent-color: #1B2E4B; cursor: pointer; }

/* Subsystem tags */
.sa-subsystem {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 4px;
    background: #e0e7ff;
    color: #3730a3;
}

/* Company detail sections */
.sa-section { margin-bottom: 32px; }
.sa-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #9ca3af; margin-bottom: 12px; }

/* Empty state */
.sa-empty { text-align: center; padding: 48px 24px; color: #9ca3af; font-size: 14px; }

/* Toast */
.sa-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: #1B2E4B;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
}
.sa-toast.show { opacity: 1; transform: translateY(0); }
.sa-toast.sa-toast-error { background: #ef4444; }
