/* ============================================================
   VELOCE DEALER PORTAL
   ============================================================ */
:root {
    --primary: #1a8fc4;
    --primary-dark: #14729e;
    --primary-light: #e8f4fa;
    --accent: #f9445a;
    --accent-hover: #e03248;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.10);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --speed: 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* NAV */
.main-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.nav-inner { max-width: 1800px; margin: 0 auto; padding: 0 2rem; height: 60px; display: flex; align-items: center; gap: 2rem; }
.nav-brand { display: flex; align-items: center; gap: .5rem; color: var(--primary); font-weight: 800; font-size: 1.1rem; letter-spacing: 3px; }
.nav-links { display: flex; gap: .25rem; flex: 1; }
.nav-link { padding: .45rem 1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; color: var(--muted); transition: all var(--speed); }
.nav-link:hover { color: var(--text); background: var(--bg); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-user { display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.nav-user-name { font-weight: 600; font-size: .85rem; }
.nav-badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }
.badge-admin { background: var(--primary-light); color: var(--primary); }
.badge-dealer { background: #fef3c7; color: #92400e; }

/* LAYOUT */
.container { max-width: 1800px; margin: 0 auto; padding: 2rem 2rem; flex: 1; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; }

/* CARD */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-size: 1.1rem; font-weight: 700; }
.card-body { padding: 1.5rem; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.25rem; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-weight: 600; font-size: .85rem; cursor: pointer; transition: all var(--speed); text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--muted); }
.btn-outline:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }

/* FORMS */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .4rem; }
.form-control { width: 100%; padding: .65rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font); font-size: .9rem; transition: border-color var(--speed); background: var(--surface); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,143,196,.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* FILE LIST */
.file-list { list-style: none; }
.file-item { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); transition: background var(--speed); }
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg); }
.file-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 800; font-size: .65rem; letter-spacing: .5px; text-transform: uppercase; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 700; font-size: 1rem; color: var(--primary); margin-bottom: .15rem; }
.file-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.file-desc { margin-top: .4rem; font-size: .85rem; color: var(--muted); }
.file-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: .35rem; align-items: flex-end; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
th { font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--bg); }
tr:hover td { background: rgba(26,143,196,.03); }

/* ALERTS */
.alert { padding: .9rem 1.25rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500; margin-bottom: 1.25rem; border: 1px solid transparent; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border-color: #bae6fd; }

/* LOGIN */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1a8fc4 100%); padding: 1rem; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 2.5rem; }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand h1 { font-size: 1rem; letter-spacing: 5px; color: var(--primary); font-weight: 800; }
.login-brand p { color: var(--muted); font-size: .85rem; margin-top: .25rem; }

/* LICENSE DETAIL */
.license-grid { display: grid; grid-template-columns: repeat(2, 200px 1fr); }
.license-grid dt { padding: .6rem 1rem; font-weight: 600; font-size: .82rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.license-grid dd { padding: .6rem 1rem; font-size: .85rem; border-bottom: 1px solid var(--border); }
.license-flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.license-flag-item { display: flex; justify-content: space-between; align-items: center; padding: .4rem 1rem; border-bottom: 1px solid var(--border); gap: .5rem; }
.license-flag-item span:first-child { font-size: .82rem; font-weight: 600; }
.feature-on  { color: var(--success); font-weight: 700; }
.feature-off { color: var(--danger);  font-weight: 700; }

/* UPLOAD ZONE */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 3rem 2rem; text-align: center; cursor: pointer; transition: all var(--speed); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone p { color: var(--muted); font-size: .9rem; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* EMPTY / MISC */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.site-footer { text-align: center; padding: 1.5rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); margin-top: auto; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* RESPONSIVE */
@media (max-width: 992px) {
    .col-hide-md { display: none; }
}
@media (max-width: 768px) {
    .col-hide-sm { display: none; }
    .nav-inner { gap: .5rem; }
    .nav-links { display: none; }
    .nav-user-name { display: none; }
    .file-item { flex-wrap: wrap; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .license-grid { grid-template-columns: 140px 1fr; }
    .license-flag-grid { grid-template-columns: 1fr; }
    .license-detail-layout { grid-template-columns: 1fr !important; }
    .form-row { grid-template-columns: 1fr; }
}
