/* =========================================
   SISTEM DESAIN: DIGI-TIP Modern Dashboard
   ========================================= */

:root {
    /* Warna yang lebih soft dan profesional */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    --primary-500: #0f172a;
    --primary-600: #1e40af;
    --primary-700: #1e3a8a;
    --accent-500: #3b82f6;
    
    --success-50: #f0fdf4;
    --success-500: #22c55e;
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --error-50: #fef2f2;
    --error-500: #ef4444;
    
    /* Sistem shadow yang lebih halus */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Spacing system (4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 68px;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    font-size: 14px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page - Lebih Clean & Terpusat */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.login-container {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-10);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-normal);
}

.login-container:hover {
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.logo {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: var(--space-8);
    text-align: center;
    color: var(--primary-700);
    letter-spacing: -0.025em;
}

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

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

input[type="text"],
input[type="password"],
input[type="search"] {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: var(--transition-fast);
    outline: none;
}

input:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn-primary,
.logout-btn,
.btn {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--space-3) var(--space-5);
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-500) 100%);
    color: white;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.logout-btn {
    background: var(--error-500);
    color: white;
    width: 100%;
    margin-top: var(--space-4);
}

.logout-btn:hover {
    background: #dc2626;
    box-shadow: var(--shadow-sm);
}

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

.btn:hover {
    background: var(--surface-hover);
    color: var(--primary-600);
    border-color: var(--primary-500);
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Error Message */
.error {
    background: var(--error-50);
    color: #b91c1c;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-6);
    border-left: 4px solid var(--error-500);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sidebar & Header */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    padding: var(--space-6) var(--space-4);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    font-size: 1.5rem;
    margin-bottom: var(--space-8);
    padding: 0 var(--space-2);
}

.nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav a {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    margin-bottom: var(--space-1);
    font-weight: 500;
}

.nav a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-600);
}

.nav a:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    box-shadow: var(--shadow-xs);
    z-index: 90;
}

.main {
    margin-left: var(--sidebar-width);
    padding: calc(var(--header-height) + var(--space-6)) var(--space-6) var(--space-6);
    min-height: 100vh;
}

/* Dashboard Content */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    margin-bottom: var(--space-6);
}

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

h3 {
    margin: 0 0 var(--space-6);
    color: var(--primary-700);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    font-size: 0.875rem;
}

.table thead {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    white-space: nowrap;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.wait {
    background: var(--warning-50);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge.call {
    background: var(--success-50);
    color: var(--success-500);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Actions & Buttons in Table */
.actions {
    display: flex;
    gap: var(--space-2);
}

.struk-form button {
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
}

/* Search Bar */
.search {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

#q {
    min-width: 280px;
}

/* Hamburger Menu (Mobile) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}

.hamburger-btn span {
    width: 100%;
    height: 2px;
    background: var(--primary-600);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 99;
    backdrop-filter: blur(2px);
}

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

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-6);
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: var(--space-8);
}

/* Struk Print Styles */
.struk-body {
    background: white;
    font-family: var(--font-mono);
    margin: 0;
    padding: 0;
}

.struk-container {
    width: 80mm;
    margin: 0 auto;
    padding: var(--space-3);
    font-size: 12px;
    line-height: 1.5;
}

.struk-header {
    text-align: center;
    margin-bottom: var(--space-4);
    border-bottom: 1px dashed #000;
    padding-bottom: var(--space-3);
}

.struk-header h1 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 var(--space-1);
}

.struk-header p {
    margin: 0;
    font-size: 10px;
}

.struk-list ol {
    margin: 0;
    padding-left: var(--space-4);
}

.struk-list li {
    margin-bottom: var(--space-1);
    word-wrap: break-word;
}

@media print {
    body * { visibility: hidden; }
    .struk-container, .struk-container * { visibility: visible; }
    .struk-container { 
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 80mm;
        box-shadow: none;
        border: none;
    }
    @page { 
        size: 80mm auto; 
        margin: 0;
    }
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    html {
        font-size: 16px; /* Better readability on mobile */
    }
    
    /* Hamburger menu visible */
    .hamburger-btn {
        display: flex;
    }
    
    /* Sidebar off-canvas */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        padding: var(--space-6) var(--space-4);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Main content full width */
    .header {
        left: 0;
        padding: 0 var(--space-4);
    }
    
    .main {
        margin-left: 0;
        padding: calc(var(--header-height) + var(--space-4)) var(--space-4) var(--space-4);
    }
    
    /* Cards with less padding */
    .card {
        padding: var(--space-5);
        border-radius: var(--radius-sm);
    }
    
    /* Table improvements */
    .table-wrapper {
        margin: 0 calc(-1 * var(--space-4));
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    
    /* Search bar full width */
    .search {
        width: 100%;
    }
    
    #q {
        min-width: auto;
        flex: 1;
    }
    
    /* Adjust actions column */
    .actions {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .struk-form button {
        width: 100%;
    }
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 240px;
    }
    
    .header {
        left: 240px;
    }
    
    .main {
        margin-left: 240px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        font-weight: 400; /* Slightly thicker for retina */
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Selection Color */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}