/* ============================================================
   FacturaInCloud Admin · style.css
   ============================================================ */

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

:root {
    --font: 'Inter', sans-serif;
    --primary:    #121E55;
    --accent:     #00A2FF;
    --bg:         #f4f6fb;
    --white:      #ffffff;
    --border:     #e2e8f0;
    --text:       #0f172a;
    --text-2:     #475569;
    --text-3:     #94a3b8;
    --red:        #ef4444;
    --red-bg:     #fef2f2;
    --green:      #16a34a;
    --green-bg:   #f0fdf4;
    --orange:     #d97706;
    --orange-bg:  #fffbeb;
    --radius:     10px;
    --radius-lg:  14px;
    --shadow:     0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
    --sidebar-w:  220px;
    --transition: .15s ease;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* ---- Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-mark {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.logo-title { color: #fff; font-weight: 800; font-size: 14px; }
.logo-sub   { color: rgba(255,255,255,0.45); font-size: 11px; }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}
.nav-item:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item.logout { color: rgba(255,255,255,0.45); }
.nav-item.logout:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ---- Main ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text); }
.topbar-meta  { display: flex; align-items: center; gap: 10px; }
.admin-badge  {
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.page-body { padding: 28px; }

/* ---- Cards ---- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-body { padding: 20px; }

/* ---- Stat cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-icon  { font-size: 28px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.stat-card.accent { border-color: var(--accent); background: #f0f9ff; }
.stat-card.accent .stat-value { color: var(--accent); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f8fafc; }
th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 12px 14px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue   { background: #eff6ff; color: #2563eb; }
.badge-gray   { background: #f1f5f9; color: var(--text-2); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1.5px solid transparent; text-decoration: none;
    font-family: var(--font); transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1a2d7a; }
.btn-accent   { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0090e0; }
.btn-outline  { background: var(--white); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-red      { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.btn-red:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

/* ---- Forms ---- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-input, .form-select {
    padding: 9px 12px; border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 13.5px; font-family: var(--font);
    outline: none; background: var(--white); color: var(--text);
    transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 13.5px; margin-bottom: 20px;
}
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ---- Filters bar ---- */
.filters-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 20px; align-items: center;
}
.filters-bar .form-input,
.filters-bar .form-select {
    padding: 7px 11px; font-size: 13px;
}

/* ---- User detail sections ---- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
    font-size: 13.5px;
}
.detail-row { display: contents; }
.detail-label { color: var(--text-3); padding: 4px 0; }
.detail-value { color: var(--text); font-weight: 500; padding: 4px 0; }

/* ---- Impersonate banner (in app) ---- */
.impersonate-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    background: #7c3aed;
    color: #fff;
    padding: 8px 20px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---- Login page ---- */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary);
}
.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 44px;
    width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .mark { font-size: 40px; }
.login-logo .title { font-size: 20px; font-weight: 800; color: var(--text); margin-top: 8px; }
.login-logo .sub   { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---- Pagination ---- */
.pagination {
    display: flex; gap: 4px; align-items: center;
    justify-content: flex-end; padding-top: 16px;
}
.pagination a, .pagination span {
    padding: 6px 12px; border-radius: 8px; font-size: 13px;
    text-decoration: none;
}
.pagination a { background: var(--white); border: 1px solid var(--border); color: var(--text); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; font-weight: 700; border-radius: 8px; }

/* ---- Misc ---- */
.mono { font-family: 'Courier New', monospace; font-size: 12.5px; }
.text-muted { color: var(--text-3); }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.gap-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title {
    font-size: 13px; font-weight: 700; color: var(--text-2);
    text-transform: uppercase; letter-spacing: 0.6px;
    margin-bottom: 14px; margin-top: 24px;
}

/* Parola temporara box */
.temp-pass-box {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 16px;
}
.temp-pass-box .pass-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.temp-pass-box .pass-value {
    font-family: 'Courier New', monospace;
    font-size: 22px; font-weight: 700;
    color: var(--green); letter-spacing: 2px;
}
