/* ============================================
   INVOICE CW - Dark Minimal UI
   Accent: #ed7764 (Warm Coral)
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #181818;
    --bg-hover: #222222;
    --bg-card: #141414;

    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #6b6b6b;

    --accent: #ed7764;
    --accent-hover: #f58975;
    --accent-light: rgba(237, 119, 100, 0.15);
    --accent-lighter: rgba(237, 119, 100, 0.08);

    /* Status Colors */
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    --info: #60a5fa;
    --info-light: rgba(96, 165, 250, 0.15);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.15);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ============================================
   Base & Reset
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Subtle grain texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   Typography
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    color: var(--text-secondary);
}

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Monospace for numbers and codes */
.font-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    letter-spacing: 0;
}

/* ============================================
   Links & Buttons
   ============================================ */

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 119, 100, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

input, select, textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

input::placeholder {
    color: var(--text-muted);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: var(--space-2xl);
}

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

/* ============================================
   Layout Components
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }

/* ============================================
   Card
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================
   Stat Card
   ============================================ */

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: var(--space-xs);
}

.stat-value .currency {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-card-link {
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.stat-hint {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

thead th {
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody td {
    padding: var(--space-md) var(--space-lg);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.table-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ============================================
   Status Badge
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-draft {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.badge-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-sent {
    background: var(--info-light);
    color: var(--info);
}

.badge-paid {
    background: var(--success-light);
    color: var(--success);
}

.badge-overdue {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-accepted {
    background: var(--success-light);
    color: var(--success);
}

.badge-rejected {
    background: var(--danger-light);
    color: var(--danger);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand span {
    color: var(--accent);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-md);
    transition: width 0.2s ease;
    overflow: visible;
    z-index: 900;
}

.sidebar-section {
    margin-bottom: var(--space-lg);
}

.sidebar-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    padding-left: var(--space-md);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.sidebar-link.active {
    border-left: 2px solid var(--accent);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.sidebar-link:hover svg, .sidebar-link.active svg {
    color: var(--accent);
}

/* ============================================
   Main Content
   ============================================ */

.main {
    margin-left: 240px;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    padding: var(--space-2xl) var(--space-2xl);
    transition: margin-left 0.2s ease;
}

/* ── Sidebar collapse button ────────────────────────────────── */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 4px 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}

.sidebar-collapse-btn:hover {
    color: var(--accent);
}

/* ── Collapsed sidebar ──────────────────────────────────────── */
body.sidebar-collapsed .sidebar {
    width: 60px;
    padding: var(--space-md) 0;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 4px 0 10px;
}

body.sidebar-collapsed .sidebar-title {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 10px 0;
    position: relative;
}

body.sidebar-collapsed .sidebar-link span {
    display: none;
}

body.sidebar-collapsed .sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Tooltip on hover when collapsed */
body.sidebar-collapsed .sidebar-link::after {
    content: attr(title);
    position: absolute;
    left: 68px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 200;
}

body.sidebar-collapsed .sidebar-link:hover::after {
    opacity: 1;
}

body.sidebar-collapsed .sidebar-link.active {
    border-left: 3px solid var(--accent);
}

body.sidebar-collapsed .main {
    margin-left: 60px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Search Bar
   ============================================ */

.search-bar {
    position: relative;
    width: 320px;
}

.search-bar input {
    padding-left: var(--space-xl);
    background: var(--bg-tertiary);
}

.search-bar svg {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* ============================================
   Dropdown
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    min-width: 180px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.dropdown-item:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-xs) 0;
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================
   Toast
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, rgba(237, 119, 100, 0.08) 0%, transparent 50%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    background: var(--accent-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* ============================================
   Invoice Items Table
   ============================================ */

.items-table {
    width: 100%;
}

.items-table th,
.items-table td {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.items-table input {
    background: var(--bg-primary);
    border-color: transparent;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.875rem;
}

.items-table input:focus {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.items-table .col-item { width: 35%; }
.items-table .col-qty { width: 10%; }
.items-table .col-rate { width: 15%; }
.items-table .col-gst { width: 12%; }
.items-table .col-amount { width: 15%; }
.items-table .col-action { width: 8%; }

.btn-add-item {
    width: 100%;
    margin-top: var(--space-md);
    border-style: dashed;
    justify-content: center;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    max-width: 320px;
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }

    .main {
        padding: var(--space-xl) var(--space-md);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .search-bar {
        width: 100%;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .table-container {
        border: none;
        border-radius: 0;
    }

    thead {
        display: none;
    }

    tbody tr {
        display: block;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-md);
        padding: var(--space-md);
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        padding: var(--space-xs) 0;
        white-space: normal;
    }

    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }

    .login-card {
        padding: var(--space-lg);
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn:not(.btn-block) {
        width: auto;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
