/* ═══════════════════════════════════════════════════════════════════════════
   PMS Platform — Application Stylesheet  v0.2.0
   Design: Apple-like, Black / White / Orange — aligned with crm.hezotech.ro
   Fonts: Rajdhani (headings/display) + system-ui (body)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts: Rajdhani ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&display=swap');

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

:root {
    /* ── Accent (orange — aligned with CRM #F5A623) ── */
    --accent:           #F5A623;
    --accent-dark:      #D48A0A;
    --accent-light:     #FFF8ED;
    --accent-muted:     rgba(245,166,35,0.12);

    /* ── Semantic colours ── */
    --color-success:    #34C759;   /* iOS green */
    --color-danger:     #FF3B30;   /* iOS red */
    --color-warning:    #FF9500;   /* iOS amber */
    --color-info:       #007AFF;   /* iOS blue */

    /* ── Neutrals ── */
    --color-bg:         #F2F2F7;   /* iOS system background */
    --color-surface:    #FFFFFF;
    --color-surface-2:  #F8F8FA;   /* Grouped list header */
    --color-border:     #E5E5EA;   /* iOS separator */
    --color-border-strong: #C7C7CC;

    --color-text:       #1C1C1E;   /* iOS label */
    --color-text-2:     #3A3A3C;   /* iOS secondary label */
    --color-text-muted: #636366;   /* iOS tertiary */
    --color-text-light: #AEAEB2;   /* iOS quaternary */

    /* ── Sidebar ── */
    --sidebar-bg:       #111111;   /* Aligned with CRM --sidebar-bg */
    --sidebar-text:     #EBEBF5;
    --sidebar-muted:    #48484A;
    --sidebar-hover:    rgba(255,255,255,0.06);
    --sidebar-active-bg:rgba(245,166,35,0.14);
    --sidebar-active:   #F5A623;
    --sidebar-width:    248px;

    /* ── Layout ── */
    --radius:           10px;
    --radius-sm:        6px;
    --radius-lg:        16px;
    --shadow-xs:        0 1px 2px rgba(0,0,0,0.06);
    --shadow-sm:        0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow:           0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:        0 12px 32px rgba(0,0,0,0.14);
    --transition:       140ms ease;

    /* ── Typography ── */
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Rajdhani', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ── App shell ──────────────────────────────────────────────────────────────── */
body.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.04);
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.brand-icon {
    width: 30px; height: 30px;
    background: var(--accent);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
}

.brand-version {
    font-size: 0.62rem;
    color: var(--sidebar-muted);
    margin-left: auto;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-section {
    padding: 16px 8px 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
    user-select: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.65; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item.disabled { opacity: 0.28; cursor: not-allowed; pointer-events: none; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.user-info { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }

.user-avatar {
    width: 30px; height: 30px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-details { min-width: 0; }
.user-name  { font-size: 0.78rem; font-weight: 600; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 0.67rem; color: var(--sidebar-muted); text-transform: capitalize; }

.logout-form { flex-shrink: 0; }
.btn-logout {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.05);
    border: none; border-radius: var(--radius-sm);
    color: var(--sidebar-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.btn-logout svg { width: 14px; height: 14px; }
.btn-logout:hover { background: rgba(255,59,48,0.15); color: #FF3B30; }

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.main-inner   { padding: 28px 32px; max-width: 1200px; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 16px;
}

.page-header-left { min-width: 0; }

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--color-text);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.page-subtitle {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title { font-size: 0.88rem; font-weight: 600; color: var(--color-text); letter-spacing: -0.01em; }
.card-body  { padding: 18px; }
.card-body.p-0 { padding: 0; }

.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }

/* ═══════════════════════════════════════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-card-muted { opacity: 0.55; }

.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }

.stat-icon-orange { background: var(--accent-muted); color: var(--accent); }
.stat-icon-green  { background: rgba(52,199,89,0.1);  color: var(--color-success); }
.stat-icon-amber  { background: rgba(255,149,0,0.12); color: var(--color-warning); }
.stat-icon-purple { background: rgba(175,82,222,0.1); color: #AF52DE; }
.stat-icon-gray   { background: #F2F2F7; color: var(--color-text-muted); }
.stat-icon-blue   { background: rgba(0,122,255,0.1);  color: var(--color-info); }

.stat-value { font-size: 1.55rem; font-weight: 700; color: var(--color-text); line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background var(--transition), opacity var(--transition), transform 60ms;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-bg); color: var(--color-text); }

.btn-danger    { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #E0332A; color: #fff; }

.btn-warning   { background: var(--color-warning); color: #fff; }
.btn-success   { background: var(--color-success); color: #fff; }

.btn-ghost     { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }

.btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-block { width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES & STATUS
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.badge-active    { background: rgba(52,199,89,0.12);  color: #1B7A2A; }
.badge-trial     { background: rgba(0,122,255,0.10);  color: #0055CC; }
.badge-suspended { background: rgba(255,149,0,0.12);  color: #B45000; }
.badge-archived  { background: #F2F2F7; color: var(--color-text-muted); }
.badge-version   { background: var(--accent-muted); color: var(--accent-dark); }
.badge-muted     { background: #F2F2F7; color: var(--color-text-muted); }
.badge-success   { background: rgba(52,199,89,0.12); color: #1B7A2A; }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.45;
}
.alert svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: rgba(255,59,48,0.07);  color: #C0392B; border-color: rgba(255,59,48,0.2); }
.alert-success { background: rgba(52,199,89,0.08);  color: #1B7A2A; border-color: rgba(52,199,89,0.25); }
.alert-warning { background: rgba(255,149,0,0.08);  color: #8A4800; border-color: rgba(255,149,0,0.25); }
.alert-info    { background: rgba(0,122,255,0.07);  color: #0044AA; border-color: rgba(0,122,255,0.2); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-2);
    margin-bottom: 5px;
    letter-spacing: -0.01em;
}

.form-hint {
    font-size: 0.73rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,0,0.12); }
.form-control::placeholder { color: var(--color-text-light); }
.form-control.is-invalid   { border-color: var(--color-danger); }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-error { font-size: 0.75rem; color: var(--color-danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

.form-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.form-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.table th {
    text-align: left;
    padding: 9px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

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

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--color-bg); }
.table-link td { cursor: pointer; }

.mono     { font-family: var(--font-mono); }
.text-sm  { font-size: 0.78rem; }
.text-muted { color: var(--color-text-muted) !important; }
.text-right { text-align: right; }
.fw-600   { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER BAR (tenant list)
   ═══════════════════════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.filter-tab {
    padding: 6px 13px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border-right: 1px solid var(--color-border);
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}
.filter-tab:last-child { border-right: none; }
.filter-tab:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.filter-tab.active { background: var(--accent-muted); color: var(--accent); font-weight: 600; }

.filter-tab .count {
    font-size: 0.65rem;
    background: var(--color-border);
    border-radius: 9999px;
    padding: 1px 5px;
    margin-left: 4px;
    color: var(--color-text-muted);
}
.filter-tab.active .count { background: var(--accent-muted); color: var(--accent); }

.search-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex: 1;
    max-width: 280px;
}
.search-box svg { width: 14px; height: 14px; color: var(--color-text-muted); margin-left: 10px; flex-shrink: 0; }
.search-box input {
    flex: 1;
    border: none;
    padding: 7px 10px;
    font-size: 0.83rem;
    font-family: var(--font);
    background: transparent;
    outline: none;
    color: var(--color-text);
}
.search-box input::placeholder { color: var(--color-text-light); }
.search-box button {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0 11px;
    height: 100%;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    transition: background var(--transition);
}
.search-box button:hover { background: var(--accent-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE TOGGLES (iOS-style)
   ═══════════════════════════════════════════════════════════════════════════ */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1px;
    background: var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.module-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: var(--color-surface);
    transition: background var(--transition);
}
.module-row:hover { background: var(--color-bg); }

.module-icon-wrap {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--color-border);
}
.module-icon-wrap svg { width: 17px; height: 17px; }
.module-icon-wrap.active { background: var(--accent); }
.module-icon-wrap.active svg { color: #fff; }

.module-info { flex: 1; min-width: 0; }
.module-name { font-size: 0.84rem; font-weight: 600; color: var(--color-text); }
.module-date { font-size: 0.68rem; color: var(--color-text-muted); margin-top: 1px; }

/* iOS Toggle Switch */
.toggle-form { display: flex; align-items: center; }

.toggle-label {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-label input {
    opacity: 0;
    width: 0; height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-border-strong);
    border-radius: 12px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    left: 2px; bottom: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-slider { background: var(--accent); }
.toggle-label input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS ACTIONS (tenant detail)
   ═══════════════════════════════════════════════════════════════════════════ */
.tenant-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.tenant-title-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tenant-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.03em;
}

.action-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   BILLING SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.billing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.billing-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.billing-mode-option {
    position: relative;
}

.billing-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.billing-mode-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-2);
}

.billing-mode-option input:checked + .billing-mode-card {
    border-color: var(--accent);
    background: var(--accent-muted);
    color: var(--accent-dark);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DETAIL ROWS (show page info grid)
   ═══════════════════════════════════════════════════════════════════════════ */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}
.detail-item:nth-last-child(-n+2) { border-bottom: none; }

.detail-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.detail-value { font-size: 0.87rem; color: var(--color-text); font-weight: 500; }
.detail-value.empty { color: var(--color-text-light); font-style: italic; font-weight: 400; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUDIT LOG ACTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.action-pill {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-mono);
    background: var(--color-border);
    color: var(--color-text-muted);
    letter-spacing: 0.01em;
}

.action-pill[data-action*="success"]  { background: rgba(52,199,89,0.1);  color: #1B7A2A; }
.action-pill[data-action*="failed"]   { background: rgba(255,59,48,0.08); color: #C0392B; }
.action-pill[data-action*="logout"]   { background: rgba(0,122,255,0.08); color: #0044AA; }
.action-pill[data-action*="created"]  { background: rgba(52,199,89,0.08); color: #1B7A2A; }
.action-pill[data-action*="updated"]  { background: rgba(255,149,0,0.08); color: #8A4800; }
.action-pill[data-action*="suspended"]{ background: rgba(255,59,48,0.08); color: #C0392B; }
.action-pill[data-action*="enabled"]  { background: rgba(52,199,89,0.1);  color: #1B7A2A; }
.action-pill[data-action*="disabled"] { background: rgba(255,59,48,0.08); color: #C0392B; }

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS SYSTEM (dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 0.81rem;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.ok   { background: var(--color-success); }
.status-dot.warn { background: var(--color-warning); }
.status-dot.err  { background: var(--color-danger); }

.status-value { margin-left: auto; font-weight: 600; font-size: 0.77rem; }
.status-ok-text   { color: var(--color-success); }
.status-warn-text { color: var(--color-warning); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE LIST (dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.module-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
}
.module-list-item:last-child { border-bottom: none; }

.module-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.module-dot.active  { background: var(--color-success); }
.module-dot.pending { background: var(--color-border-strong); }

.module-list-info { flex: 1; }
.module-list-name { font-size: 0.84rem; font-weight: 600; }
.module-list-desc { font-size: 0.76rem; color: var(--color-text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state {
    padding: 48px 32px;
    text-align: center;
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { color: var(--color-text-muted); font-size: 0.87rem; }
.empty-state .btn { margin-top: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
body.login-body {
    background: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
    width: 100%;
}

.login-brand { text-align: center; margin-bottom: 26px; }

.login-logo {
    width: 50px; height: 50px;
    background: var(--accent);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.05em;
}

.login-logo-img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 4px;
    /* logo is dark-background, invert not needed — it already has correct colors */
}

/* Sidebar real image logo */
.brand-logo-img {
    width: 28px; height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
    background: #000;
}

.login-title   { font-size: 1.15rem; font-weight: 700; color: var(--color-text); margin-bottom: 3px; letter-spacing: -0.02em; }
.login-subtitle{ font-size: 0.8rem; color: var(--color-text-muted); }
.login-footer  { font-size: 0.72rem; color: rgba(255,255,255,0.2); text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   ERROR PAGES
   ═══════════════════════════════════════════════════════════════════════════ */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 10px;
}
.error-code    { font-size: 5rem; font-weight: 800; color: var(--color-border-strong); line-height: 1; letter-spacing: -0.06em; }
.error-title   { font-size: 1.3rem; font-weight: 700; color: var(--color-text); }
.error-message { color: var(--color-text-muted); max-width: 380px; margin-bottom: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════════════════ */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }
.flex    { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .main-inner { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row, .form-row-3, .billing-grid, .detail-grid { grid-template-columns: 1fr; }
    .modules-grid { grid-template-columns: 1fr; }
    .billing-mode-selector { grid-template-columns: 1fr; }
}
