/* ============================================================
   Concessionnaire GTA RP — Main Stylesheet
   Design: Elegant dark theme, blue/white/red tricolor accent
   ============================================================ */

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

:root {
    --bg-primary:       #0a0a0a;
    --bg-secondary:     #141414;
    --bg-card:          #1e1e1e;
    --color-blue:       #0055A4;
    --color-white:      #F0F0F0;
    --color-red:        #EF4135;
    --color-text:       #e8e8e8;
    --color-text-muted: #888888;
    --color-border:     #2a2a2a;
    --sidebar-bg:       #0d0d0d;
    --sidebar-width:    260px;
    --topbar-height:    64px;
    --color-success:    #28a745;
    --color-warning:    #ffa500;
    --color-danger:     #EF4135;
    --color-info:       #17a2b8;
    --radius:           10px;
    --shadow:           0 4px 24px rgba(0,0,0,.4);
    --transition:       0.2s ease;
}

html[data-theme="light"] {
    --bg-primary:       #f0f2f5;
    --bg-secondary:     #e4e7ec;
    --bg-card:          #ffffff;
    --color-text:       #1a1a2e;
    --color-text-muted: #666666;
    --color-border:     #d0d5dd;
    --sidebar-bg:       #1a1a2e;
    --shadow:           0 4px 24px rgba(0,0,0,.1);
}

html { font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }
code { font-family: 'Consolas', 'Monaco', monospace; background: rgba(255,255,255,.08); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.875em; }
a { color: var(--color-blue); text-decoration: none; }
a:hover { opacity: 0.8; }

/* ── Layout ──────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition);
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0.75rem;
}

.brand-logo { height: 40px; width: auto; object-fit: contain; border-radius: 6px; }
.brand-icon { font-size: 1.8rem; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 0.95rem; font-weight: 700; color: var(--color-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.brand-sub  { font-size: 0.7rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-tricolor {
    height: 3px;
    background: linear-gradient(to right, var(--color-blue) 33.33%, var(--color-white) 33.33% 66.66%, var(--color-red) 66.66%);
    margin: 0.75rem 0;
}

.nav-menu { list-style: none; padding: 0.5rem 0; flex: 1; }
.nav-item { padding: 0 0.75rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover { background: rgba(255,255,255,.06); color: var(--color-text); opacity: 1; }
.nav-link.active { background: rgba(0,85,164,.2); color: var(--color-blue); }
.nav-link.active .nav-icon { color: var(--color-blue); }
.nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--color-border); margin-top: auto; }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar  {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--color-blue);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem; color: #fff; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pos  { font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 999;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
    z-index: 100;
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--color-blue) 33.33%, var(--color-white) 33.33% 66.66%, var(--color-red) 66.66%);
}

.topbar-title { font-size: 1.05rem; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.btn-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.btn-menu span { display: block; width: 22px; height: 2px; background: var(--color-text); border-radius: 1px; transition: var(--transition); }

.btn-icon {
    width: 36px; height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--color-blue); border-color: var(--color-blue); color: #fff; }
.icon-sun, .icon-moon { line-height: 1; }
html[data-theme="dark"]  .icon-sun  { display: none; }
html[data-theme="light"] .icon-moon { display: none; }

/* User menu */
.user-menu-wrapper { position: relative; }
.btn-user-menu {
    display: flex; align-items: center; gap: 0.5rem;
    background: none; border: 1px solid var(--color-border);
    border-radius: 8px; color: var(--color-text); cursor: pointer;
    padding: 0.35rem 0.75rem; font-size: 0.875rem;
    transition: all var(--transition);
}
.btn-user-menu:hover { border-color: var(--color-blue); }
.user-avatar-sm { width: 26px; height: 26px; border-radius: 50%; background: var(--color-blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; color: #fff; }
.chevron { font-size: 0.7rem; }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 0.4rem;
    display: none;
    z-index: 200;
}
.user-dropdown.open { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.75rem; border-radius: 6px;
    font-size: 0.875rem; color: var(--color-text);
    transition: background var(--transition);
}
.dropdown-item:hover { background: rgba(255,255,255,.06); opacity: 1; }
.dropdown-item-danger { color: var(--color-danger); }
.dropdown-item-danger:hover { background: rgba(239,65,53,.1); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: 0.3rem 0; }

/* ── Tricolor stripes ─────────────────────────────────────── */
.login-tricolor, .tricolor {
    height: 4px;
    background: linear-gradient(to right, var(--color-blue) 33.33%, var(--color-white) 33.33% 66.66%, var(--color-red) 66.66%);
}

/* ── Login page ──────────────────────────────────────────── */
.login-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-wrapper { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.login-card {
    width: 100%; background: var(--bg-card);
    border: 1px solid var(--color-border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
.login-tricolor { height: 4px; background: linear-gradient(to right, var(--color-blue) 33.33%, var(--color-white) 33.33% 66.66%, var(--color-red) 66.66%); }
.login-header { text-align: center; padding: 2rem 2rem 1rem; }
.login-logo { height: 60px; width: auto; margin-bottom: 1rem; object-fit: contain; }
.login-company { font-size: 1.5rem; font-weight: 700; }
.login-subtitle { color: var(--color-text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.login-form { padding: 0 2rem 2rem; }
.theme-toggle-login { background: none; border: 1px solid var(--color-border); border-radius: 8px; padding: 0.5rem 1rem; color: var(--color-text); cursor: pointer; font-size: 0.875rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--color-border);
    gap: 0.75rem;
}
.card-header h3 { font-size: 0.95rem; font-weight: 600; }
.card-actions { display: flex; gap: 0.5rem; align-items: center; }
.card-body { padding: 1.5rem; }
.card-body.p-0 { padding: 0; }

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-blue::before   { background: var(--color-blue); }
.stat-green::before  { background: var(--color-success); }
.stat-red::before    { background: var(--color-red); }
.stat-orange::before { background: var(--color-warning); }
.stat-purple::before { background: #7c3aed; }
.stat-teal::before   { background: #0d9488; }

.stat-icon { font-size: 2rem; opacity: 0.8; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.2rem; line-height: 1.4; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: all var(--transition);
    white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-primary { background: var(--color-blue); color: #fff; border-color: var(--color-blue); }
.btn-primary:hover { background: #0066cc; opacity: 1; }
.btn-secondary { background: #444; color: #fff; border-color: #444; }
.btn-secondary:hover { background: #555; opacity: 1; }
.btn-outline { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-blue); color: var(--color-blue); opacity: 1; }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #c82333; opacity: 1; }
.btn-warning { background: var(--color-warning); color: #000; border-color: var(--color-warning); }
.btn-warning:hover { opacity: 0.9; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-copy { position: absolute; top: 0.5rem; right: 0.5rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.4rem; font-weight: 500; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], select, textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--color-blue); }
input.input-readonly { opacity: 0.6; cursor: default; }
textarea { resize: vertical; min-height: 100px; }
select { background-image: url("data:image/svg+xml;utf8,<svg fill='%23888' viewBox='0 0 4 5' xmlns='http://www.w3.org/2000/svg'><path d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 0.7rem; padding-right: 2rem; }

.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }
.form-divider { border-top: 1px solid var(--color-border); margin: 1.2rem 0 1rem; font-size: 0.8rem; color: var(--color-text-muted); padding-top: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* File input */
input[type=file] { padding: 0.5rem; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table thead tr { border-bottom: 2px solid var(--color-border); }
.data-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.03); }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.2em 0.6em; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-blue   { background: rgba(0,85,164,.2); color: #4da6ff; }
.badge-green  { background: rgba(40,167,69,.2); color: #5cb85c; }
.badge-orange { background: rgba(255,165,0,.15); color: #ffa500; }
.badge-gold   { background: rgba(255,193,7,.15); color: #ffc107; }
.badge-red    { background: rgba(239,65,53,.2); color: #ef4135; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 0.85rem 1rem; border-radius: 8px; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-success { background: rgba(40,167,69,.15); border: 1px solid rgba(40,167,69,.3); color: #5cb85c; }
.alert-danger  { background: rgba(239,65,53,.15); border: 1px solid rgba(239,65,53,.3); color: #ff7b74; }
.alert-info    { background: rgba(23,162,184,.15); border: 1px solid rgba(23,162,184,.3); color: #4fc3f7; }
.alert-warning { background: rgba(255,165,0,.15); border: 1px solid rgba(255,165,0,.3); color: #ffa500; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; padding: 1rem;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 100%; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow);
    transform: translateY(-20px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-sm  { max-width: 400px; }
.modal-md  { max-width: 560px; }
.modal-lg  { max-width: 800px; }
.modal-xl  { max-width: 1100px; }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
    background: none; border: none; color: var(--color-text-muted);
    cursor: pointer; font-size: 1.1rem; line-height: 1;
    padding: 0.25rem; border-radius: 4px;
    transition: color var(--transition);
}
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--color-border);
    display: flex; gap: 0.75rem; justify-content: flex-end; flex-shrink: 0;
}

/* Modal tabs */
.modal-tabs { display: flex; gap: 0.25rem; }
.modal-tab { background: none; border: none; padding: 0.4rem 0.9rem; border-radius: 6px; color: var(--color-text-muted); cursor: pointer; font-size: 0.875rem; transition: all var(--transition); }
.modal-tab.active { background: rgba(0,85,164,.2); color: var(--color-blue); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-wrapper { position: relative; }
.autocomplete-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 500;
    background: var(--bg-card); border: 1px solid var(--color-border);
    border-radius: 8px; box-shadow: var(--shadow);
    max-height: 300px; overflow-y: auto; display: none;
}
.autocomplete-results.open { display: block; }
.autocomplete-item {
    padding: 0.65rem 1rem; cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; gap: 0.75rem;
    transition: background var(--transition);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.selected { background: rgba(0,85,164,.15); }
.ac-ref  { font-size: 0.75rem; color: var(--color-blue); font-family: monospace; background: rgba(0,85,164,.1); padding: 0.1em 0.5em; border-radius: 4px; }
.ac-name { flex: 1; font-size: 0.9rem; }
.ac-price{ font-size: 0.85rem; color: var(--color-success); font-weight: 600; }

/* ── Sale preview ────────────────────────────────────────── */
.sale-preview {
    background: var(--bg-secondary); border: 1px solid var(--color-border);
    border-radius: 8px; padding: 1rem; margin: 1rem 0;
}
.preview-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.35rem 0; border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}
.preview-row:last-child { border-bottom: none; }
.selected-vehicle {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem; background: rgba(0,85,164,.1); border-radius: 6px; margin-top: 0.5rem;
    font-size: 0.875rem;
}
.btn-clear { background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 0; margin-left: auto; }
.btn-clear:hover { color: var(--color-danger); }

/* ── Action bar ──────────────────────────────────────────── */
.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.action-bar-left, .action-bar-right { display: flex; align-items: center; gap: 0.5rem; }

/* ── Period selector ─────────────────────────────────────── */
.period-selector { display: flex; gap: 0.35rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.period-btn { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); }
.period-btn.active { background: var(--color-blue); color: #fff; border-color: var(--color-blue); }

/* ── Page tabs ───────────────────────────────────────────── */
.page-tabs { display: flex; gap: 0.35rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0; flex-wrap: wrap; }
.page-tab { padding: 0.55rem 1rem; border-radius: 8px 8px 0 0; font-size: 0.875rem; font-weight: 500; color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition); }
.page-tab:hover { color: var(--color-text); opacity: 1; }
.page-tab.active { color: var(--color-blue); border-bottom-color: var(--color-blue); background: rgba(0,85,164,.08); }

/* ── Tab switcher ────────────────────────────────────────── */
.tab-switcher { display: flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.tab-btn { padding: 0.45rem 1rem; font-size: 0.875rem; color: var(--color-text-muted); border: none; background: none; cursor: pointer; transition: all var(--transition); }
.tab-btn:hover { background: rgba(255,255,255,.05); color: var(--color-text); }
.tab-btn.active { background: var(--color-blue); color: #fff; }
.tab-btn + .tab-btn { border-left: 1px solid var(--color-border); }

/* ── Catalog layout ──────────────────────────────────────── */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.catalog-sidebar .card { position: sticky; top: calc(var(--topbar-height) + 1rem); }
.category-list { list-style: none; }
.cat-row { position: relative; display: flex; align-items: center; }
.cat-item { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 1rem; color: var(--color-text-muted); font-size: 0.875rem; transition: all var(--transition); }
.cat-item:hover { background: rgba(255,255,255,.04); color: var(--color-text); opacity: 1; }
.cat-item.active { background: rgba(0,85,164,.15); color: var(--color-blue); }
.cat-count { background: var(--color-border); color: var(--color-text-muted); padding: 0.1em 0.5em; border-radius: 10px; font-size: 0.75rem; }
.cat-actions { display: none; gap: 0.25rem; padding-right: 0.5rem; }
.cat-row:hover .cat-actions { display: flex; }
.btn-icon-sm { background: none; border: none; cursor: pointer; color: var(--color-text-muted); padding: 0.25rem; border-radius: 4px; font-size: 0.85rem; transition: color var(--transition); }
.btn-icon-sm:hover { color: var(--color-text); }
.btn-danger-sm:hover { color: var(--color-danger); }
.catalog-main .search-form { display: flex; gap: 0.5rem; }
.catalog-main .search-form input { min-width: 240px; }

/* ── Info box ────────────────────────────────────────────── */
.info-box { background: rgba(0,85,164,.08); border: 1px solid rgba(0,85,164,.2); border-radius: 8px; padding: 0.85rem 1rem; margin: 0.75rem 0; font-size: 0.875rem; color: var(--color-text-muted); }
.info-radio { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; padding: 0.65rem 0.9rem; background: rgba(0,85,164,.1); border-radius: 8px; }
.info-label { font-size: 0.875rem; color: var(--color-text-muted); }

/* ── Rich content (WYSIWYG output) ───────────────────────── */
.rich-content { font-size: 0.9rem; line-height: 1.7; }
.rich-content p { margin-bottom: 0.75rem; }
.rich-content h2, .rich-content h3 { margin: 1rem 0 0.5rem; }
.rich-content ul, .rich-content ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.rich-content img { max-width: 100%; border-radius: 8px; }
.rich-content a { color: var(--color-blue); }
.rich-editor { border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.ql-toolbar { background: var(--bg-secondary); border: none !important; border-bottom: 1px solid var(--color-border) !important; }
.ql-container { background: var(--bg-secondary); border: none !important; min-height: 150px; }
.ql-editor { color: var(--color-text); min-height: 150px; }
.ql-stroke { stroke: var(--color-text-muted) !important; }
.ql-fill { fill: var(--color-text-muted) !important; }
.ql-picker-label { color: var(--color-text-muted) !important; }
.ql-picker-options { background: var(--bg-card) !important; border-color: var(--color-border) !important; }
.ql-picker-item { color: var(--color-text) !important; }

/* ── Permissions grid ────────────────────────────────────── */
.permissions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.perm-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.perm-check input { width: auto; margin: 0; accent-color: var(--color-blue); }

/* ── Theme color picker ──────────────────────────────────── */
.theme-colors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.color-picker-group { display: flex; align-items: center; gap: 0.75rem; background: var(--bg-secondary); padding: 0.75rem; border-radius: 8px; border: 1px solid var(--color-border); }
.color-picker-group label { flex: 1; font-size: 0.8rem; color: var(--color-text-muted); margin: 0; }
.color-picker-group input[type=color] { width: 36px; height: 36px; border: none; border-radius: 6px; cursor: pointer; padding: 2px; background: none; }
.color-picker-group span { font-size: 0.75rem; font-family: monospace; color: var(--color-text-muted); min-width: 60px; }

/* ── Salary summary ──────────────────────────────────────── */
.salary-summary { display: flex; flex-wrap: wrap; gap: 1rem; background: var(--bg-secondary); border: 1px solid var(--color-border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; font-size: 0.875rem; }
.salary-summary > div { flex: 1; min-width: 150px; }

/* ── Credentials box ─────────────────────────────────────── */
.credentials-box { position: relative; }
.credentials-box textarea { font-family: monospace; font-size: 0.85rem; min-height: 220px; background: #0a0a0a; padding: 1rem; }

/* ── Logo upload ─────────────────────────────────────────── */
.logo-upload-area { display: flex; flex-direction: column; gap: 0.5rem; }
.logo-preview { max-height: 80px; max-width: 200px; object-fit: contain; border-radius: 6px; border: 1px solid var(--color-border); }
.logo-placeholder { padding: 1rem; background: var(--bg-secondary); border: 1px dashed var(--color-border); border-radius: 8px; color: var(--color-text-muted); text-align: center; font-size: 0.875rem; }

/* ── Utility classes ─────────────────────────────────────── */
.text-muted    { color: var(--color-text-muted); }
.text-center   { text-align: center; }
.text-blue     { color: var(--color-blue); }
.text-green    { color: var(--color-success); }
.text-danger   { color: var(--color-danger); }
.text-warning  { color: var(--color-warning); }
.text-sm       { font-size: 0.8rem; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.loading { text-align: center; color: var(--color-text-muted); padding: 2rem; font-size: 0.875rem; }
.emp-name { font-weight: 500; }
.pagination { display: flex; align-items: center; gap: 0.35rem; margin-top: 1rem; justify-content: center; flex-wrap: wrap; }
.page-btn { padding: 0.35rem 0.7rem; border-radius: 6px; border: 1px solid var(--color-border); background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 0.8rem; transition: all var(--transition); }
.page-btn:hover { border-color: var(--color-blue); color: var(--color-blue); }
.page-btn.active { background: var(--color-blue); color: #fff; border-color: var(--color-blue); }
.page-btn:disabled { opacity: 0.3; cursor: default; }
.toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    background: var(--bg-card); border: 1px solid var(--color-border);
    border-radius: 10px; padding: 0.85rem 1.25rem;
    box-shadow: var(--shadow); z-index: 9999;
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.875rem; min-width: 280px;
    animation: slideIn 0.3s ease;
}
.toast-success { border-left: 4px solid var(--color-success); }
.toast-error   { border-left: 4px solid var(--color-danger); }
.toast-info    { border-left: 4px solid var(--color-info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .catalog-sidebar .card { position: static; }
    .catalog-main .search-form input { min-width: 180px; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    .main-wrapper { margin-left: 0; }
    .sidebar { transform: translateX(-100%); width: 260px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .btn-menu { display: flex; }
    .topbar { padding: 0 1rem; }
    .page-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { flex-direction: column; }
    .action-bar { flex-direction: column; align-items: stretch; }
    .action-bar-right { justify-content: flex-end; }
    .modal-overlay { padding: 0.5rem; align-items: flex-end; }
    .modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; }
    .permissions-grid { grid-template-columns: 1fr; }
    .theme-colors-grid { grid-template-columns: 1fr 1fr; }
    .catalog-layout { grid-template-columns: 1fr; }
    .topbar-title { display: none; }
    .btn-user-menu span:not(.user-avatar-sm):not(.chevron) { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-tabs { gap: 0.2rem; }
    .page-tab { padding: 0.45rem 0.65rem; font-size: 0.8rem; }
    .theme-colors-grid { grid-template-columns: 1fr; }
}
