/* ═══════════════════════════════════════════════
   CIFRATURN ADMIN — Design System v2
   Paleta: #13353d · #ff6b35 · #f8f9fa
═══════════════════════════════════════════════ */
:root {
    --ct-900: #0d2b32;
    --ct-800: #13353d;
    --ct-700: #1a4550;
    --ct-600: #235666;
    --orange:  #ff6b35;
    --orange-h:#ff8e53;
    --orange-g: rgba(255,107,53,0.15);

    --bg:      #f0f4f6;
    --surface: #ffffff;
    --text:    #1a2332;
    --muted:   #64748b;
    --border:  #e2e8f0;

    --danger:      #f44336;
    --danger-soft: #fee2e2;
    --success:     #10b981;
    --success-soft:#d1fae5;
    --warning:     #f59e0b;
    --warning-soft:#fef3c7;
    --info:        #3b82f6;
    --info-soft:   #dbeafe;

    --r:   10px;
    --r-lg:16px;
    --sh-sm: 0 1px 4px rgba(0,0,0,0.07);
    --sh-md: 0 4px 16px rgba(0,0,0,0.10);
    --sh-lg: 0 8px 32px rgba(0,0,0,0.13);
}

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

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

/* ══════════════════════════════════════════════
   AUTH
══════════════════════════════════════════════ */
.admin-auth{
    min-height:100vh;
    display:flex; align-items:center; justify-content:center;
    background:linear-gradient(145deg, var(--ct-900) 0%, var(--ct-700) 60%, #1e5060 100%);
    position:relative; overflow:hidden;
}
.admin-auth::before{
    content:'';
    position:absolute;
    width:700px; height:700px;
    background:radial-gradient(circle, var(--orange-g) 0%, transparent 65%);
    top:-150px; right:-150px; pointer-events:none;
}
.admin-auth::after{
    content:'';
    position:absolute;
    width:400px; height:400px;
    background:radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
    bottom:-100px; left:-80px; pointer-events:none;
}

.auth-card{
    background:rgba(255,255,255,0.98);
    backdrop-filter:blur(20px);
    padding:48px 40px;
    border-radius:20px;
    width:100%; max-width:420px;
    box-shadow:var(--sh-lg), 0 0 0 1px rgba(255,255,255,0.15);
    text-align:center; position:relative; z-index:1;
}
.auth-logo{
    width:68px; height:68px;
    background:linear-gradient(135deg, var(--ct-800), var(--orange));
    border-radius:18px;
    display:flex; align-items:center; justify-content:center;
    margin:0 auto 24px; font-size:30px; color:white;
    box-shadow:0 8px 20px rgba(255,107,53,0.3);
}
.auth-card h2{ font-size:22px; font-weight:800; color:var(--text); margin-bottom:6px; }
.auth-card p{ color:var(--muted); margin-bottom:28px; font-size:14px; }
.auth-divider{
    display:flex; align-items:center; gap:12px;
    color:var(--muted); font-size:13px; margin:16px 0;
}
.auth-divider::before,.auth-divider::after{
    content:''; flex:1; height:1px; background:var(--border);
}

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

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.admin-sidebar{
    width:256px;
    background:linear-gradient(180deg, var(--ct-900) 0%, var(--ct-800) 100%);
    display:flex; flex-direction:column;
    flex-shrink:0;
    position:sticky; top:0; height:100vh;
    overflow-y:auto;
}

.sidebar-header{
    padding:26px 20px 18px;
    border-bottom:1px solid rgba(255,255,255,0.07);
}
.sidebar-header h2{
    margin:0; font-size:17px; font-weight:800;
    color:white;
    display:flex; align-items:center; gap:9px;
}
.sidebar-header h2 i{ color:var(--orange); font-size:18px; }
.sidebar-subtitle{
    font-size:10px; color:rgba(255,255,255,0.35);
    text-transform:uppercase; letter-spacing:1.5px;
    margin-top:5px;
}

.nav-menu{
    display:flex; flex-direction:column; gap:1px;
    padding:14px 10px; flex:1;
}
.nav-section-label{
    font-size:9.5px; text-transform:uppercase;
    letter-spacing:1.5px; color:rgba(255,255,255,0.28);
    padding:14px 8px 5px; font-weight:700;
}
.nav-item{
    display:flex; align-items:center; gap:11px;
    padding:10px 13px;
    border-radius:8px;
    color:rgba(255,255,255,0.55);
    font-weight:500; font-size:13.5px;
    transition:all 0.18s;
    cursor:pointer; border:none; background:transparent;
    text-align:left; width:100%;
}
.nav-item:hover{
    background:rgba(255,255,255,0.08);
    color:rgba(255,255,255,0.88);
}
.nav-item.active{
    background:linear-gradient(135deg, rgba(255,107,53,0.22), rgba(255,107,53,0.08));
    color:var(--orange); font-weight:700;
    border:1px solid rgba(255,107,53,0.22);
}
.nav-item i{ font-size:15px; width:18px; text-align:center; }

.sidebar-footer{
    padding:14px 10px 20px;
    border-top:1px solid rgba(255,255,255,0.07);
}
.sidebar-user{
    display:flex; align-items:center; gap:10px;
    padding:10px 8px; border-radius:8px; margin-bottom:8px;
}
.sidebar-avatar{
    width:36px; height:36px; border-radius:9px;
    background:linear-gradient(135deg, var(--ct-600), var(--orange));
    display:flex; align-items:center; justify-content:center;
    font-size:14px; font-weight:800; color:white;
    flex-shrink:0;
}
.sidebar-user-info{ flex:1; min-width:0; }
.sidebar-user-email{
    font-size:12px; font-weight:600;
    color:rgba(255,255,255,0.75);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sidebar-user-role{
    font-size:10.5px; color:var(--orange); font-weight:600;
    text-transform:uppercase; letter-spacing:0.5px;
}

/* ══════════════════════════════════════════════
   MAIN
══════════════════════════════════════════════ */
.admin-main{
    flex:1; display:flex; flex-direction:column;
    min-width:0; overflow:hidden;
}

.admin-topbar{
    height:62px;
    background:var(--surface);
    border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between;
    padding:0 28px;
    position:sticky; top:0; z-index:10;
    box-shadow:var(--sh-sm);
}
.topbar-title{ font-size:17px; font-weight:800; color:var(--text); }
.topbar-sub{ font-size:12px; color:var(--muted); margin-top:1px; }

.admin-content{ padding:26px 28px; overflow-y:auto; flex:1; }

/* ══════════════════════════════════════════════
   TABS
══════════════════════════════════════════════ */
.tab-pane{ display:none; animation:fadeIn .22s ease; }
.tab-pane.active{ display:block; }
@keyframes fadeIn{
    from{ opacity:0; transform:translateY(7px); }
    to{ opacity:1; transform:translateY(0); }
}

/* ══════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════ */
.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(210px,1fr));
    gap:18px; margin-bottom:26px;
}
.stat-card{
    background:var(--surface);
    border-radius:var(--r-lg); padding:22px;
    display:flex; align-items:center; gap:16px;
    box-shadow:var(--sh-sm); border:1px solid var(--border);
    transition:transform .2s, box-shadow .2s;
    position:relative; overflow:hidden;
}
.stat-card::after{
    content:'';
    position:absolute; top:0; left:0; right:0; height:3px;
    background:var(--card-accent, linear-gradient(90deg, var(--orange), var(--orange-h)));
}
.stat-card:hover{ transform:translateY(-2px); box-shadow:var(--sh-md); }
.stat-icon{
    width:52px; height:52px; border-radius:13px;
    display:flex; align-items:center; justify-content:center;
    font-size:22px; flex-shrink:0;
}
.stat-info h3{
    font-size:11px; color:var(--muted); font-weight:700;
    text-transform:uppercase; letter-spacing:0.6px;
}
.stat-info p{
    font-size:30px; font-weight:900; color:var(--text);
    margin-top:3px; line-height:1;
}

/* ══════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════ */
.table-container{
    background:var(--surface);
    border-radius:var(--r-lg); overflow:hidden;
    box-shadow:var(--sh-sm); border:1px solid var(--border);
}
.table-header{
    padding:16px 22px;
    border-bottom:1px solid var(--border);
    display:flex; justify-content:space-between; align-items:center;
}
.table-header h4{
    font-size:14px; font-weight:700; color:var(--text);
    display:flex; align-items:center; gap:8px;
}
table{ width:100%; border-collapse:collapse; }
th{
    padding:11px 20px; text-align:left;
    background:#f7f9fb; color:var(--muted);
    font-weight:700; font-size:10.5px;
    text-transform:uppercase; letter-spacing:0.7px;
    border-bottom:1px solid var(--border);
}
td{
    padding:14px 20px;
    border-bottom:1px solid var(--border);
    color:var(--text);
    vertical-align:middle;
}
tr:last-child td{ border-bottom:none; }
tr:hover td{ background:#fafbfc; }

.user-cell{ display:flex; align-items:center; gap:12px; }
.user-avatar{
    width:40px; height:40px; border-radius:10px;
    object-fit:cover; border:2px solid var(--border);
    flex-shrink:0;
}
.status-badge{
    padding:3px 10px; border-radius:20px;
    font-size:10.5px; font-weight:700;
    text-transform:uppercase; letter-spacing:0.3px;
    display:inline-block;
}
.status-active{ background:var(--success-soft); color:#065f46; }
.status-banned{ background:var(--danger-soft); color:#991b1b; }
.status-premium{
    background:linear-gradient(135deg, rgba(255,107,53,0.14), rgba(255,142,83,0.08));
    color:var(--orange);
    border:1px solid rgba(255,107,53,0.28);
}
.badge-admin{
    background:linear-gradient(135deg, var(--ct-800), var(--ct-600));
    color:white; padding:3px 10px; border-radius:20px;
    font-size:10.5px; font-weight:700;
    text-transform:uppercase; display:inline-block;
}

/* ══════════════════════════════════════════════
   TOOLBAR
══════════════════════════════════════════════ */
.toolbar{
    display:flex; gap:10px; align-items:center;
    margin-bottom:18px; flex-wrap:wrap;
}
.search-bar{ position:relative; }
.search-bar i{
    position:absolute; left:12px; top:50%;
    transform:translateY(-50%); color:var(--muted); font-size:13px;
}
.search-bar input{ padding-left:36px; }

/* ══════════════════════════════════════════════
   FORMS & BUTTONS
══════════════════════════════════════════════ */
input,select,textarea{
    padding:9px 13px;
    border:1.5px solid var(--border);
    border-radius:8px; font-size:14px; outline:none;
    transition:border-color .2s, box-shadow .2s;
    font-family:'Inter',sans-serif;
    color:var(--text); background:var(--surface);
}
input:focus,select:focus,textarea:focus{
    border-color:var(--orange);
    box-shadow:0 0 0 3px rgba(255,107,53,0.1);
}

.btn{
    padding:9px 17px; border-radius:8px;
    font-size:13.5px; font-weight:600;
    cursor:pointer; border:none;
    display:inline-flex; align-items:center; gap:7px;
    transition:all .18s; font-family:'Inter',sans-serif;
    text-decoration:none;
}
.btn-primary{
    background:linear-gradient(135deg, var(--orange), var(--orange-h));
    color:white;
    box-shadow:0 3px 10px rgba(255,107,53,0.28);
}
.btn-primary:hover{
    box-shadow:0 5px 16px rgba(255,107,53,0.4);
    transform:translateY(-1px);
}
.btn-dark{ background:var(--ct-800); color:white; }
.btn-dark:hover{ background:var(--ct-700); }
.btn-danger{
    background:var(--danger); color:white;
    box-shadow:0 2px 8px rgba(244,67,54,0.22);
}
.btn-danger:hover{ background:#d32f2f; }
.btn-outline{
    background:transparent; border:1.5px solid var(--border);
    color:var(--text);
}
.btn-outline:hover{ background:var(--bg); border-color:#b8c8d8; }
.btn-ghost{ background:transparent; color:var(--muted); }
.btn-ghost:hover{ background:rgba(255,255,255,0.08); color:white; }
.btn-icon{ padding:7px; border-radius:7px; }
.btn-sm{ padding:7px 12px; font-size:12.5px; }

/* ══════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════ */
.modal-overlay{
    position:fixed; inset:0;
    background:rgba(13,43,50,0.55);
    display:none; align-items:center; justify-content:center;
    z-index:1000; backdrop-filter:blur(6px);
    padding:20px;
}
.modal-content{
    background:var(--surface);
    border-radius:var(--r-lg);
    width:100%; max-width:520px; max-height:90vh;
    overflow-y:auto;
    box-shadow:0 24px 60px rgba(0,0,0,0.22);
    animation:modalIn .22s cubic-bezier(.34,1.2,.64,1);
}
@keyframes modalIn{
    from{ opacity:0; transform:scale(.95) translateY(12px); }
    to{ opacity:1; transform:scale(1) translateY(0); }
}
.modal-header{
    padding:18px 22px;
    border-bottom:1px solid var(--border);
    display:flex; justify-content:space-between; align-items:center;
    position:sticky; top:0; background:var(--surface); z-index:1;
}
.modal-header h3{
    margin:0; font-size:16px; font-weight:800; color:var(--text);
    display:flex; align-items:center; gap:9px;
}
.modal-header h3 i{ color:var(--orange); }
.modal-close{
    background:var(--bg); border:none;
    width:32px; height:32px; border-radius:8px;
    cursor:pointer; color:var(--muted); font-size:15px;
    display:flex; align-items:center; justify-content:center;
    transition:all .18s;
}
.modal-close:hover{ background:var(--danger-soft); color:var(--danger); }
.modal-body{ padding:22px; }

/* Modal user banner */
.modal-user-banner{
    display:flex; align-items:center; gap:14px;
    padding-bottom:18px; margin-bottom:18px;
    border-bottom:1px solid var(--border);
}
.modal-user-avatar-big{
    width:52px; height:52px; border-radius:13px;
    background:linear-gradient(135deg, var(--ct-800), var(--orange));
    display:flex; align-items:center; justify-content:center;
    font-size:22px; font-weight:900; color:white;
    flex-shrink:0;
}
.modal-user-name{ font-size:17px; font-weight:800; color:var(--text); }
.modal-user-email{ font-size:12.5px; color:var(--muted); margin-top:2px; }

/* Modal sections */
.modal-section{
    background:var(--bg); border-radius:var(--r);
    padding:16px; margin-bottom:14px;
    border:1px solid var(--border);
}
.modal-section-title{
    font-size:10px; font-weight:700;
    text-transform:uppercase; letter-spacing:1px;
    color:var(--muted); margin-bottom:13px;
    display:flex; align-items:center; gap:6px;
}

/* Toggle items */
.toggle-group{ display:flex; gap:8px; flex-wrap:wrap; }
.toggle-item{
    display:flex; align-items:center; gap:8px;
    padding:9px 14px; border-radius:8px;
    border:1.5px solid var(--border);
    cursor:pointer; transition:all .18s;
    background:var(--surface); font-size:13px; font-weight:600;
}
.toggle-item input{
    accent-color:var(--orange);
    width:15px; height:15px;
    margin:0; padding:0; border:none;
    box-shadow:none;
}
.toggle-item input:focus{ box-shadow:none; }
.toggle-item:has(input:checked){
    border-color:var(--orange);
    background:rgba(255,107,53,0.06);
    color:var(--orange);
}

/* Resources grid */
.resources-grid{
    display:grid; grid-template-columns:1fr 1fr;
    gap:10px; margin-bottom:12px;
}
.resources-grid .field label,
.resources-field label{
    display:block; font-size:11px; font-weight:700;
    text-transform:uppercase; letter-spacing:0.5px;
    color:var(--muted); margin-bottom:5px;
}
.resources-grid .field input,
.resources-field input{ width:100%; }

/* Danger zone */
.danger-zone{
    border:1.5px solid var(--danger-soft);
    border-radius:var(--r); padding:14px;
    background:#fff8f8;
}
.danger-zone-title{
    font-size:10px; font-weight:700;
    text-transform:uppercase; letter-spacing:1px;
    color:var(--danger); margin-bottom:10px;
    display:flex; align-items:center; gap:6px;
}

.form-row{ margin-bottom:14px; }
.form-row label{
    display:block; margin-bottom:5px;
    font-weight:600; font-size:13px;
}
.form-row input,.form-row select,.form-row textarea{
    width:100%; box-sizing:border-box;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.admin-toast{
    position:fixed; bottom:22px; right:22px;
    color:white; padding:13px 18px;
    border-radius:10px;
    display:flex; align-items:center; gap:11px;
    box-shadow:var(--sh-md);
    z-index:2000;
    animation:slideUp .28s cubic-bezier(.34,1.3,.64,1);
    font-size:13.5px; font-weight:600;
    min-width:260px; max-width:380px;
}
@keyframes slideUp{
    from{ transform:translateY(120%); opacity:0; }
    to{ transform:translateY(0); opacity:1; }
}

/* ══════════════════════════════════════════════
   LOADING
══════════════════════════════════════════════ */
.loading-spinner{
    display:inline-block; width:18px; height:18px;
    border:2.5px solid rgba(255,255,255,0.3);
    border-radius:50%; border-top-color:#fff;
    animation:spin .7s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/* ══════════════════════════════════════════════
   MISC
══════════════════════════════════════════════ */
.input-group{ display:flex; gap:10px; }
.page-actions{
    display:flex; gap:10px; align-items:center; flex-wrap:wrap;
    margin-bottom:18px;
}
