/* =============================================
   SENZA CRM - Wholesale Jewelry CRM
   Stylesheet
   ============================================= */

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #1f2233;
    --bg-sidebar: #141620;
    --bg-input: #1e2130;
    --border: #2a2d3a;
    --border-focus: #8b5cf6;
    --text: #e4e5eb;
    --text-muted: #8b8d9a;
    --text-heading: #f0f1f5;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-bg: rgba(139, 92, 246, 0.12);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 12px rgba(0,0,0,0.25);
    --transition: 0.2s ease;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --sidebar-w: 260px;
}

/* ============ LIGHT THEME ============ */
html.light-theme body,
body.light-theme {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-sidebar: #ffffff;
    --bg-input: #f8f9fa;
    --border: #e0e0e0;
    --border-focus: #7c3aed;
    --text: #1a1a2e;
    --text-muted: #666666;
    --text-heading: #1a1a2e;
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-bg: rgba(124, 58, 237, 0.08);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body.light-theme .login-body {
    background: linear-gradient(135deg, #e8e0f0 0%, #f0e6ff 50%, #e8e0f0 100%);
}
body.light-theme .login-card {
    box-shadow: var(--shadow), 0 0 80px rgba(124, 58, 237, 0.06);
}
body.light-theme .nav-item { color: #555555; }
body.light-theme .nav-item:hover,
body.light-theme .nav-item.active { background: #f0e6ff; color: #7c3aed; }
body.light-theme .table thead th { background: #f8f9fa; }
body.light-theme .form-section { background: #f8f5ff; }
body.light-theme .section-title { border-color: #e0d4f5; }
body.light-theme .detail-header { background: #f8f5ff; }
body.light-theme .detail-avatar { background: #7c3aed; color: #fff; }
body.light-theme .timeline-icon { background: #ffffff; }
body.light-theme .filter-btn.active { background: #f0e6ff; }
body.light-theme a { color: #7c3aed; }
body.light-theme a:hover { color: #6d28d9; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============ LOGIN ============ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1117 0%, #1a1030 50%, #0f1117 100%);
}

.login-container { width: 100%; max-width: 420px; padding: 1rem; }

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow), 0 0 80px rgba(139, 92, 246, 0.08);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.login-header h1 { font-size: 1.6rem; color: var(--text-heading); font-weight: 700; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }
.login-form .form-group { margin-bottom: 1.2rem; }

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============ THEME TOGGLE ============ */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.theme-toggle:hover {
    background: var(--primary);
    color: #fff;
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease, background 0.3s ease;
}

.sidebar-header {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }

.logo { display: flex; align-items: center; gap: 0.7rem; }
.logo-icon { font-size: 1.8rem; }
.logo-text { font-weight: 700; font-size: 1.1rem; color: var(--text-heading); }
.logo-sub { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--primary-bg); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); }
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.nav-divider { height: 1px; background: var(--border); margin: 0.5rem 0.9rem; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info { display: flex; align-items: center; gap: 0.6rem; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

.logout-btn { font-size: 1.2rem; opacity: 0.5; transition: opacity var(--transition); }
.logout-btn:hover { opacity: 1; }

/* ============ MAIN CONTENT ============ */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; }

.top-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background 0.3s ease;
}

.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--text-heading); }
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 0.8rem; }
.today-date { font-size: 0.85rem; color: var(--text-muted); }
.content-area { padding: 1.5rem; max-width: 1400px; }

/* ============ ALERTS ============ */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; opacity: 0.7; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

textarea { resize: vertical; min-height: 60px; }

input[type="color"] {
    width: 60px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem 1rem; }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.form-actions { display: flex; justify-content: flex-end; gap: 0.8rem; margin-top: 1rem; padding-top: 1rem; }
.form-page { max-width: 900px; }
.inline-form .form-group { margin-bottom: 0; }

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: background 0.3s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-heading); }
.card-body { padding: 1rem 1.2rem; }

/* ============ STATS GRID ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition), background 0.3s ease;
}

.stat-card:hover { border-color: var(--primary); }
.stat-card.accent { border-color: var(--danger); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-heading); line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ============ DASHBOARD GRID ============ */
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.dashboard-grid .span-2 { grid-column: span 2; }
.reports-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.reports-grid .span-2 { grid-column: span 2; }

/* ============ TABLES ============ */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.table-hover tbody tr { transition: background var(--transition); }
.table-hover tbody tr:hover { background: var(--bg-card-hover); }

.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.sort-link { color: var(--text-muted); }
.sort-link:hover { color: var(--primary); }
.customer-link { color: var(--text-heading); }
.customer-link:hover { color: var(--primary); }
.actions-cell { white-space: nowrap; }

/* ============ BADGES ============ */
.badge, .status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending { background: #f59e0b20; color: #f59e0b; }
.badge-partial { background: #06b6d420; color: #06b6d4; }
.badge-paid { background: #10b98120; color: #10b981; }
.badge-overdue { background: #ef444420; color: #ef4444; }
.badge-shipped { background: #06b6d420; color: #06b6d4; }
.badge-delivered { background: #10b98120; color: #10b981; }
.badge-returned { background: #ef444420; color: #ef4444; }
.stars { font-size: 0.7rem; margin-left: 4px; }

/* ============ LIST ITEMS ============ */
.list-items { display: flex; flex-direction: column; }

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--border);
    gap: 0.8rem;
}

.list-item:last-child { border-bottom: none; }
.list-item.overdue { background: rgba(239, 68, 68, 0.05); }
.list-item.completed { opacity: 0.5; }
.list-item-left { display: flex; align-items: center; gap: 0.7rem; flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; color: var(--text-heading); font-size: 0.9rem; }
.list-item-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.comm-type-icon { font-size: 1.3rem; flex-shrink: 0; }

.priority-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.priority-low { background: #6b7280; }
.priority-medium { background: #f59e0b; }
.priority-high { background: #f97316; }
.priority-urgent { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }

/* ============ TOOLBAR ============ */
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-form { flex: 1; }
.search-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.search-input { min-width: 200px; max-width: 300px; }
.filter-select { min-width: 140px; max-width: 200px; }
.toolbar-actions { display: flex; gap: 0.5rem; align-items: center; }
.results-info { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ============ FILTER BAR ============ */
.filter-bar { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-btn:hover { border-color: var(--primary); color: var(--text); }
.filter-btn.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
.filter-btn.danger.active { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.filter-btn .count { display: inline-block; background: var(--bg-input); padding: 1px 6px; border-radius: 8px; font-size: 0.75rem; margin-left: 4px; }

/* ============ PAGINATION ============ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.page-info { font-size: 0.85rem; color: var(--text-muted); }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state.small { padding: 1.5rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }

/* ============ CUSTOMER DETAIL ============ */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    transition: background 0.3s ease;
}

.detail-header-left { display: flex; align-items: center; gap: 1rem; }

.detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.detail-header h2 { font-size: 1.3rem; color: var(--text-heading); }
.detail-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 0.5rem; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    transition: background 0.3s ease;
}

.info-card.full-width { grid-column: 1 / -1; }
.info-card h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.info-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.info-row { font-size: 0.88rem; color: var(--text); }
.info-label { color: var(--text-muted); font-size: 0.8rem; margin-right: 0.3rem; }
.note-text { font-size: 0.9rem; color: var(--text); line-height: 1.7; }

/* ============ TABS ============ */
.tabs { display: flex; gap: 0.3rem; margin-bottom: 1rem; border-bottom: 2px solid var(--border); padding-bottom: 0; }

.tab-btn {
    padding: 0.7rem 1.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 2.5rem; }

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 1rem; }

.timeline-icon {
    position: absolute;
    left: -2.5rem;
    top: 0.2rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 1;
    transition: background 0.3s ease;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    transition: background 0.3s ease;
}

.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; flex-wrap: wrap; gap: 0.5rem; }
.timeline-date { font-size: 0.78rem; color: var(--text-muted); }
.timeline-body { font-size: 0.88rem; color: var(--text); margin: 0.5rem 0; }
.timeline-outcome { font-size: 0.85rem; color: var(--success); font-style: italic; }
.timeline-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }

/* ============ STAT LIST ============ */
.stat-list { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 0.3rem 0; }

/* ============ BAR ============ */
.bar { transition: width 0.5s ease; }

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-content h3 { margin-bottom: 1.5rem; color: var(--text-heading); }

/* ============ FU CARD ============ */
.fu-card { border-radius: var(--radius-sm); padding: 0.8rem !important; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .form-grid .span-3 { grid-column: span 2; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .span-2 { grid-column: span 1; }
    .reports-grid { grid-template-columns: 1fr; }
    .reports-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .hamburger { display: block; }
    .main-content { margin-left: 0; }
    .form-grid, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
    .toolbar { flex-direction: column; }
    .search-group { flex-direction: column; }
    .search-input { max-width: 100%; }
    .filter-select { max-width: 100%; }
    .detail-header { flex-direction: column; align-items: flex-start; }
    .detail-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 1rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .tabs { overflow-x: auto; }
    .tab-btn { white-space: nowrap; font-size: 0.8rem; padding: 0.5rem 0.8rem; }
}

/* ============ PRINT ============ */
@media print {
    .sidebar, .top-bar, .toolbar, .form-actions, .actions-cell { display: none !important; }
    .main-content { margin-left: 0; }
    body { background: #fff; color: #000; }
    .card, .stat-card, .info-card { border-color: #ddd; background: #fff; }
}

body.light-theme .btn-primary {
    background: #7c3aed;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}
body.light-theme .btn-primary:hover {
    background: #6d28d9;
    color: #ffffff;
}
body.light-theme .btn-success {
    background: #059669;
    color: #ffffff;
}
body.light-theme .btn-danger {
    background: #dc2626;
    color: #ffffff;
}