/* ============================================================
   SwiftPOS — Superadmin Portal
   SaaS Modern Design Language
   ============================================================ */

:root {
    --sa-primary:     var(--sp-color-primary, #6d28d9);
    --sa-accent:      var(--sp-color-accent, #10b981);
    --sa-danger:      var(--sp-color-danger, #ef4444);
    --sa-warning:     var(--sp-color-warning, #f59e0b);
    --sa-info:        var(--sp-color-info, #3b82f6);
    --sa-text-main:   var(--sp-color-text-main, #111827);
    --sa-text-muted:  var(--sp-color-text-muted, #9ca3af);
    --sa-border:      var(--sp-color-border, #e5e7eb);
    --sa-bg:          var(--sp-color-bg-grey, #f9fafb);
    --sa-surface:     var(--sp-color-bg-white, #ffffff);
    --sa-radius:      var(--sp-radius, 16px);
    --sa-radius-sm:   var(--sp-radius-sm, 8px);
}

/* ── Base body ────────────────────────────────────────────── */
.sa-body {
    background-color: var(--sa-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--sa-text-main);
    min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar-superadmin {
    background: linear-gradient(135deg, #0f172a 0%, #1a1a2e 100%);
    padding: 0.9rem 1.5rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 200;
}

.navbar-superadmin .navbar-brand {
    color: #fff;
    font-weight: 800;
    font-size: 1.3rem;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-superadmin .nav-link {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.18s;
    padding: 0.5rem 0.9rem;
    border-radius: var(--sa-radius-sm);
}

.navbar-superadmin .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.navbar-superadmin .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-superadmin .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
}

/* ── Content area ─────────────────────────────────────────── */
.sa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1,
.content-header h2 {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--sa-text-main);
}

/* ── Cards ────────────────────────────────────────────────── */
.sa-card {
    background: var(--sa-surface);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Bootstrap card override for superadmin */
.navbar-superadmin ~ * .card,
.sa-body .card {
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ── Stat / metric cards ──────────────────────────────────── */
.sa-stat-card {
    background: var(--sa-surface);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sa-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.sa-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--sa-text-main);
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    line-height: 1.1;
}

.sa-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sa-text-muted);
    margin-top: 0.3rem;
}

/* ── Status badges ────────────────────────────────────────── */
.sa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.22em 0.65em;
    border-radius: var(--sp-radius-pill, 500px);
}

.sa-badge-active   { background: #d1fae5; color: #065f46; }
.sa-badge-inactive { background: #fee2e2; color: #991b1b; }
.sa-badge-trial    { background: #fef3c7; color: #92400e; }
.sa-badge-expired  { background: #f1f5f9; color: #475569; }
.sa-badge-premium  { background: var(--sp-color-bg-tint, #f5f3ff); color: var(--sa-primary); }

/* ── Tables ───────────────────────────────────────────────── */
.sa-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--sa-radius);
    background: var(--sa-surface);
    border: 1px solid var(--sa-border);
}

.sa-table {
    width: 100%;
    border-collapse: collapse;
}

.sa-table thead th {
    padding: 0.75rem 1.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sa-text-muted);
    background: var(--sp-color-bg-grey, #f9fafb);
    border-bottom: 1px solid var(--sa-border);
    white-space: nowrap;
}

.sa-table tbody tr {
    border-bottom: 1px solid var(--sa-border);
    transition: background 0.12s ease;
}

.sa-table tbody tr:last-child {
    border-bottom: none;
}

.sa-table tbody tr:hover {
    background: var(--sp-color-bg-tint, #f5f3ff);
}

.sa-table td {
    padding: 0.85rem 1.1rem;
    font-size: 0.83rem;
    color: var(--sa-text-main);
    vertical-align: middle;
}

/* ── Search / filter bar ──────────────────────────────────── */
.sa-filter-bar {
    background: var(--sa-surface);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius-sm);
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-sa-primary {
    background: linear-gradient(135deg,
        var(--sa-primary) 0%,
        var(--sp-color-secondary, #8b5cf6) 100%);
    color: #fff;
    border: none;
    border-radius: var(--sa-radius-sm);
    padding: 0.52rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.22s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-sa-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.4);
    color: #fff;
}

/* ── Server setup form ────────────────────────────────────── */
.sa-section-card {
    background: var(--sa-surface);
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.sa-section-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--sa-border);
    background: var(--sp-color-bg-grey, #f9fafb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sa-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sa-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.sa-section-title i {
    color: var(--sa-primary);
    font-size: 0.82rem;
}

.sa-section-body {
    padding: 1.25rem;
}

/* ── Page header ──────────────────────────────────────────── */
.sa-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sa-page-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--sa-text-main);
    letter-spacing: -0.02em;
    margin: 0;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .sa-container {
        padding: 1.25rem 1rem;
    }
    .navbar-superadmin {
        padding: 0.75rem 1rem;
    }
}
