/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.menu-open {
    overflow: hidden;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

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

.logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    color: white;
}

.logo-text p {
    font-size: 0.85rem;
    margin: 0;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
    white-space: nowrap;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
    border: 2px solid transparent;
    -webkit-filter: none;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: white;
    border-radius: 3px 3px 0 0;
}

.nav-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.nav-text {
    font-weight: 500;
}

.nav-link-special {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
}

.nav-link-special:hover {
    background: rgba(255,255,255,0.3);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-link-dropdown {
    position: relative;
}

.nav-link-dropdown .dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.open .nav-link-dropdown .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown.open .nav-link-dropdown {
    background: rgba(255,255,255,0.25);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
    padding: 0.5rem 0;
}

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

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-dropdown-item:hover {
    background: #f5f5f5;
    border-left-color: #667eea;
    padding-left: 1.25rem;
}

.nav-dropdown-item.active {
    background: #f0f4ff;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.nav-dropdown-item .nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.nav-dropdown-item.nav-link-special {
    background: rgba(37, 211, 102, 0.1);
    color: #1da851;
}

.nav-dropdown-item.nav-link-special:hover {
    background: rgba(37, 211, 102, 0.2);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    position: relative;
}

.user-menu-dropdown {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.user-menu-toggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.3);
}

.user-menu-toggle.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.4);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.user-menu-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1002;
    overflow: hidden;
}

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

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-role {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: capitalize;
}

.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.user-dropdown-item:hover {
    background: #f3f4f6;
    color: #dc2626;
}

.dropdown-item-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    color: #333;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.card h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
}

/* ============================================
   STATS & STATISTICS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    cursor: default;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.stat-card:hover {
    transform: translateY(-5px);
    z-index: 2;
}

.stat-card.success {
    border-left: 4px solid #10b981;
}

.stat-card.warning {
    border-left: 4px solid #f59e0b;
}

.stat-card.danger {
    border-left: 4px solid #ef4444;
}

.stat-card.info {
    border-left: 4px solid #3b82f6;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Stats Browser Style - Horizontal Layout */
.stats-browser {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.stats-browser::-webkit-scrollbar {
    height: 8px;
}

.stats-browser::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.stats-browser::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.stats-browser::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.stat-card-horizontal {
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    min-width: 220px;
    flex: 1 1 auto;
    border-top: 3px solid transparent;
    cursor: pointer;
    will-change: transform;
}

.stat-card-horizontal:hover {
    transform: translateY(-3px);
    box-shadow: 0 -4px 15px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
    z-index: 2;
}

.stat-card-horizontal.success {
    border-top-color: #10b981;
    background: linear-gradient(to bottom, #ecfdf5 0%, white 100%);
}

.stat-card-horizontal.warning {
    border-top-color: #f59e0b;
    background: linear-gradient(to bottom, #fffbeb 0%, white 100%);
}

.stat-card-horizontal.danger {
    border-top-color: #ef4444;
    background: linear-gradient(to bottom, #fef2f2 0%, white 100%);
}

.stat-card-horizontal.info {
    border-top-color: #3b82f6;
    background: linear-gradient(to bottom, #eff6ff 0%, white 100%);
}

.stat-icon-horizontal {
    font-size: 2.75rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.stat-content-horizontal {
    flex: 1;
    min-width: 0;
}

.stat-content-horizontal h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    line-height: 1.2;
}

.stat-content-horizontal p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: text;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-filter: none;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #1da851;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

a.btn,
button.btn,
input[type="submit"],
input[type="button"] {
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

input[type="submit"],
input[type="button"],
button {
    cursor: pointer;
    pointer-events: auto;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.table thead {
    background: #f9fafb;
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e5e7eb;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody tr {
    position: relative;
    z-index: 1;
}

.table tbody tr:hover {
    background: #f9fafb;
    z-index: 2;
}

.table tbody tr td {
    position: relative;
    z-index: 1;
}

.table tbody tr td a,
.table tbody tr td button {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.table tbody tr.row-warning {
    background: #fef3c7;
}

.table a,
.table button {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

/* ============================================
   PRODUCT IMAGES
   ============================================ */
.produk-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.produk-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 10;
    position: relative;
}

.produk-thumbnail-placeholder {
    width: 60px;
    height: 60px;
    background: #f3f4f6;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #9ca3af;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.login-box form {
    position: relative;
    z-index: 1;
}

.login-box input,
.login-box button {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.login-box h2 {
    text-align: center;
    color: #666;
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 2rem;
}

.login-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 5px;
    font-size: 0.875rem;
}

.login-info code {
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: monospace;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* ============================================
   MODAL (BARCODE SCANNER)
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #667eea;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

#barcode-scanner-video {
    background: #000;
    width: 100%;
    border: 2px solid #667eea;
    border-radius: 5px;
}

/* ============================================
   FIXES FOR INTERACTIVE ELEMENTS
   ============================================ */
a, button, input[type="button"], input[type="submit"], select, textarea {
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

a, button, input, select, textarea, .btn, .nav-link {
    -webkit-filter: none;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html, body {
    -webkit-filter: none;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .logo-img {
        height: 35px;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-text p {
        font-size: 0.7rem;
    }
    
    .user-menu-toggle {
        padding: 0.4rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Mobile & Tablet Portrait (max-width: 768px) */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-wrap: nowrap;
    }
    
    .header-left {
        flex: 1;
    }
    
    .logo {
        gap: 0.75rem;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Nav Mobile */
    .nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.5rem;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 999;
    }
    
    .nav.active {
        transform: translateX(0);
    }
    
    .nav-link {
        padding: 1rem;
        border-radius: 8px;
        justify-content: flex-start;
        width: 100%;
        border: none;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .nav-link.active {
        background: rgba(255,255,255,0.25);
        border: 2px solid rgba(255,255,255,0.3);
    }
    
    /* Nav Dropdown Mobile */
    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        border-radius: 0;
        margin-top: 0.5rem;
        padding: 0.5rem 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    
    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 500px;
        padding: 0.5rem 0;
    }
    
    .nav-dropdown-item {
        padding: 0.75rem 1.5rem;
        color: rgba(255,255,255,0.9);
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-dropdown-item:hover {
        background: rgba(255,255,255,0.15);
        padding-left: 1.5rem;
        border-left: none;
    }
    
    .nav-dropdown-item.active {
        background: rgba(255,255,255,0.2);
        border-left: none;
        color: white;
    }
    
    .nav-dropdown-item.nav-link-special {
        background: rgba(37, 211, 102, 0.2);
        color: white;
    }
    
    .nav-dropdown-item.nav-link-special:hover {
        background: rgba(37, 211, 102, 0.3);
    }
    
    .user-menu {
        flex: 0 0 auto;
    }
    
    .user-name {
        display: none;
    }
    
    .user-menu-toggle {
        padding: 0.5rem;
        gap: 0;
    }
    
    .user-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    /* Produk Thumbnail - Mobile */
    .produk-thumbnail,
    .produk-thumbnail-placeholder {
        width: 50px;
        height: 50px;
    }
    
    /* Stats Browser - Mobile */
    .stats-browser {
        gap: 0.625rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .stat-card-horizontal {
        padding: 1rem 1.25rem;
        min-width: 160px;
        gap: 0.75rem;
        border-radius: 10px 10px 0 0;
    }
    
    .stat-icon-horizontal {
        font-size: 2rem;
    }
    
    .stat-content-horizontal h3 {
        font-size: 1.35rem;
        margin-bottom: 0.375rem;
    }
    
    .stat-content-horizontal p {
        font-size: 0.7rem;
    }
    
    /* Button Mobile */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* Tablet Portrait / Mobile Landscape (600px - 768px) */
@media (min-width: 600px) and (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo-img {
        height: 42px;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    .container {
        padding: 0 1.25rem;
        margin: 1.25rem auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.625rem;
    }
    
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-inline .form-group {
        margin-bottom: 1rem;
    }
    
    .form-inline .btn {
        width: 100%;
    }
}

/* Tablet / Chromebook (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .header-content {
        padding: 0 1.25rem;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
    
    .nav {
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }
    
    .nav-icon {
        font-size: 1rem;
    }
    
    .nav-text {
        font-size: 0.9rem;
    }
    
    .user-menu-toggle {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }
    
    .user-name {
        font-size: 0.9rem;
    }
    
    .container {
        max-width: 100%;
        padding: 0 1.5rem;
        margin: 1.5rem auto;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .card h2 {
        font-size: 1.4rem;
        margin-bottom: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    /* Stats Browser - Tablet */
    .stats-browser {
        gap: 0.875rem;
        padding-bottom: 0.5rem;
    }
    
    .stat-card-horizontal {
        padding: 1.25rem 1.75rem;
        min-width: 200px;
        gap: 1rem;
    }
    
    .stat-icon-horizontal {
        font-size: 2.5rem;
    }
    
    .stat-content-horizontal h3 {
        font-size: 1.6rem;
    }
    
    .stat-content-horizontal p {
        font-size: 0.8rem;
    }
    
    .stat-icon {
        font-size: 2.25rem;
    }
    
    .stat-info h3 {
        font-size: 1.35rem;
    }
    
    .stat-info p {
        font-size: 0.85rem;
    }
    
    .grid-2 {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.65rem;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
        min-height: 42px;
    }
    
    .btn-sm {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
    }
    
    .nav-dropdown-menu {
        min-width: 200px;
    }
    
    .user-dropdown-menu {
        min-width: 220px;
    }
    
    .table tbody tr {
        cursor: pointer;
    }
}

/* Desktop kecil / Tablet besar (1024px - 1200px) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .header-content {
        padding: 0 1.25rem;
    }
    
    .container {
        max-width: 1100px;
        padding: 0 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .grid-2 {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}
