/* ============================================================
   Exclusiv Auto Vest – admin.css
   ============================================================ */
:root {
    --gold: #c9a227; --gold-light: #e8c45a; --black: #0a0a0a;
    --black2: #111; --black3: #1a1a1a; --black4: #222;
    --white: #fff; --cream: #e8e0d0; --grey: #888;
    --sidebar-w: 260px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Montserrat', sans-serif; background: #0f0f0f; color: var(--cream); min-height: 100vh; }
a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%); padding: 1.5rem; }
.login-wrap { width: 100%; max-width: 420px; }
.login-card { background: var(--black3); border: 1px solid rgba(201,162,39,.25); border-radius: 16px; padding: 2.5rem 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.8); }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo img { margin: 0 auto; height: 70px; width: auto; }
.login-title { text-align: center; font-size: 1.6rem; font-weight: 800; color: var(--white); margin-bottom: .4rem; }
.login-title span { color: var(--gold); }
.login-sub { text-align: center; color: var(--grey); font-size: .85rem; margin-bottom: 1.75rem; }

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

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w); min-height: 100vh; position: fixed; top: 0; left: 0; z-index: 100;
    background: var(--black2); border-right: 1px solid rgba(201,162,39,.15);
    display: flex; flex-direction: column;
    transition: transform .3s ease;
}
.sidebar-header { padding: 1.25rem 1rem; border-bottom: 1px solid rgba(201,162,39,.1); }
.sidebar-logo img { height: 48px; width: auto; }
.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.sidebar-nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1.25rem; font-size: .88rem; font-weight: 600;
    color: var(--grey); border-left: 3px solid transparent;
    transition: all .2s; white-space: nowrap;
}
.sidebar-nav a:hover, .sidebar-nav a.active { color: var(--gold); border-left-color: var(--gold); background: rgba(201,162,39,.05); }
.sidebar-nav a i { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: rgba(201,162,39,.1); margin: .5rem 1.25rem; }
.sidebar-footer { padding: 1.25rem; border-top: 1px solid rgba(201,162,39,.1); }
.sidebar-footer a { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--grey); }
.sidebar-footer a:hover { color: var(--gold); }
.sidebar-toggle { display: none; position: fixed; top: 1rem; left: 1rem; z-index: 200; width: 44px; height: 44px; background: var(--black3); border: 1px solid rgba(201,162,39,.3); border-radius: 8px; align-items: center; justify-content: center; color: var(--gold); font-size: 1.1rem; cursor: pointer; }

/* MAIN CONTENT */
.admin-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.admin-topbar { background: var(--black2); border-bottom: 1px solid rgba(201,162,39,.1); padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.admin-topbar h2 { font-size: 1.1rem; color: var(--white); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.admin-content { padding: 1.5rem; }

/* STATS CARDS */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--black3); border: 1px solid rgba(201,162,39,.15); border-radius: 10px; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-card-icon { width: 48px; height: 48px; border-radius: 10px; background: rgba(201,162,39,.1); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.3rem; flex-shrink: 0; }
.stat-card h3 { font-size: 1.6rem; font-weight: 900; color: var(--white); }
.stat-card p { font-size: .75rem; color: var(--grey); }

/* TABLE */
.admin-table-wrap { background: var(--black3); border: 1px solid rgba(201,162,39,.1); border-radius: 12px; overflow: hidden; }
.admin-table-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(201,162,39,.1); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.admin-table-header h3 { font-size: 1rem; color: var(--white); }
table { width: 100%; border-collapse: collapse; }
th { background: rgba(201,162,39,.07); padding: .75rem 1rem; text-align: left; font-size: .75rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid rgba(201,162,39,.1); }
td { padding: .85rem 1rem; font-size: .85rem; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.car-thumb { width: 70px; height: 50px; object-fit: cover; border-radius: 6px; }
.badge-active { display: inline-block; padding: .25rem .65rem; border-radius: 50px; font-size: .72rem; font-weight: 700; background: rgba(37,211,102,.15); color: #25d366; border: 1px solid rgba(37,211,102,.3); }
.badge-inactive { display: inline-block; padding: .25rem .65rem; border-radius: 50px; font-size: .72rem; font-weight: 700; background: rgba(220,53,69,.15); color: #ff6b7a; border: 1px solid rgba(220,53,69,.3); }

/* FORMS */
.admin-form-card { background: var(--black3); border: 1px solid rgba(201,162,39,.15); border-radius: 12px; padding: 1.75rem; margin-bottom: 1.5rem; }
.admin-form-card h3 { font-size: 1rem; color: var(--gold); margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid rgba(201,162,39,.15); text-transform: uppercase; letter-spacing: .5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row { margin-bottom: .9rem; }
.form-row.full { grid-column: span 2; }
.form-row label { display: block; font-size: .75rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .4rem; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: .75rem 1rem;
    background: var(--black4); color: var(--cream);
    border: 1px solid rgba(201,162,39,.25); border-radius: 8px;
    font-family: 'Montserrat', sans-serif; font-size: .88rem;
    transition: border-color .2s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.12); }
.form-row textarea { min-height: 100px; resize: vertical; }

/* Image upload area */
.upload-zone {
    border: 2px dashed rgba(201,162,39,.4); border-radius: 10px;
    padding: 1.5rem; text-align: center; cursor: pointer;
    transition: all .2s; background: rgba(201,162,39,.03);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--gold); background: rgba(201,162,39,.07); }
.upload-zone i { font-size: 2rem; color: var(--gold); margin-bottom: .75rem; }
.upload-zone p { font-size: .85rem; color: var(--grey); }
.upload-zone span { font-size: .75rem; color: rgba(201,162,39,.6); display: block; margin-top: .4rem; }
.img-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); gap: .5rem; margin-top: 1rem; }
.img-preview { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid rgba(201,162,39,.2); aspect-ratio: 4/3; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .remove-img {
    position: absolute; top: .3rem; right: .3rem;
    width: 22px; height: 22px; background: rgba(220,53,69,.9);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: .6rem; cursor: pointer;
}
.img-preview .sort-handle { position: absolute; bottom: .3rem; left: .3rem; color: rgba(255,255,255,.7); font-size: .7rem; cursor: grab; }
.img-preview.first-img { border-color: var(--gold); }
.img-preview.first-img::after { content: 'Cover'; position: absolute; bottom: 0; left: 0; right: 0; background: var(--gold); color: var(--black); font-size: .65rem; font-weight: 800; text-align: center; padding: .15rem; }

/* Buttons */
.btn-admin-primary {
    display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
    padding: .75rem 1.5rem; background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--black); font-weight: 700; font-size: .88rem; border-radius: 8px;
    border: none; font-family: 'Montserrat', sans-serif; transition: all .2s;
}
.btn-admin-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,162,39,.4); }
.btn-admin-secondary {
    display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
    padding: .6rem 1.25rem; background: var(--black4); color: var(--cream);
    font-weight: 600; font-size: .85rem; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1); font-family: 'Montserrat', sans-serif; transition: all .2s;
}
.btn-admin-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; padding: .5rem 1rem; background: rgba(220,53,69,.15); color: #ff6b7a; border: 1px solid rgba(220,53,69,.3); border-radius: 6px; font-size: .8rem; font-weight: 600; font-family: 'Montserrat', sans-serif; transition: all .2s; }
.btn-danger:hover { background: rgba(220,53,69,.3); }
.btn-sm { padding: .4rem .85rem; font-size: .78rem; }
.btn-success { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; padding: .5rem 1rem; background: rgba(37,211,102,.15); color: #25d366; border: 1px solid rgba(37,211,102,.3); border-radius: 6px; font-size: .8rem; font-weight: 600; font-family: 'Montserrat', sans-serif; transition: all .2s; }

/* Alerts */
.alert { padding: .85rem 1.25rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.alert-success { background: rgba(37,211,102,.12); border: 1px solid rgba(37,211,102,.4); color: #25d366; }
.alert-error { background: rgba(220,53,69,.12); border: 1px solid rgba(220,53,69,.4); color: #ff6b7a; }

/* RESPONSIVE ADMIN */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .form-grid { grid-template-columns: 1fr; }
    .form-row.full { grid-column: span 1; }
    .admin-table-wrap { overflow-x: auto; }
    table { min-width: 600px; }
    .stats-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .admin-content { padding: 1rem; }
    .stats-cards { grid-template-columns: 1fr; }
    .admin-table-header { flex-direction: column; align-items: flex-start; }
}
