:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Auth Pages */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.app-subtitle {
    color: var(--gray);
    font-size: 14px;
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 25px;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px 45px;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-logout {
    background: none;
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

.switch-text {
    text-align: center;
    margin-top: 25px;
    color: var(--gray);
    font-size: 14px;
}

/* Navbar */
.navbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}


.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--light);
    border-radius: 30px;
    font-weight: 500;
}

.user-badge {
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-left: 10px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Location Section */
.location-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.location-section h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.location-btn {
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.location-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.location-btn i {
    font-size: 32px;
    color: var(--primary);
}

.location-btn.active {
    border-color: var(--primary);
    background: rgba(79,70,229,0.05);
}

.location-btn.active .toggle-switch {
    background: var(--primary);
}

.location-btn.active .toggle-slider {
    left: 28px;
}

.toggle-switch {
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 30px;
    position: relative;
    transition: all 0.3s;
}

.toggle-slider {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.location-info {
    padding: 15px;
    background: var(--light);
    border-radius: 10px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(79,70,229,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--secondary); }
.stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

/* Card */
.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-badge {
    background: var(--light);
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Scanner */
.scanner-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.scanner-preview {
    background: var(--dark);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.manual-input {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.manual-input input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-size: 16px;
}

/* Camera Button */
.btn-camera {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-camera:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(16, 185, 129, 0.3);
}

.btn-camera.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-camera.active:hover {
    box-shadow: 0 6px 8px rgba(239, 68, 68, 0.3);
}

/* Tabs */
.tabs-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light);
    padding-bottom: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 30px;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab:hover {
    background: var(--light);
    color: var(--dark);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.modern-table th {
    background: var(--light);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.modern-table td {
    padding: 15px;
    border-bottom: 1px solid var(--light);
    color: var(--gray);
    white-space: nowrap;
}

.modern-table tbody tr:hover {
    background: var(--light);
}

.loading-row {
    text-align: center;
    padding: 40px !important;
    color: var(--gray);
}

.loading-row i {
    margin-right: 10px;
    color: var(--primary);
}

.stok-cell {
    font-weight: 600;
    color: var(--secondary);
    text-align: center;
}

.clickable-row {
    cursor: pointer;
    transition: 0.2s;
}

.clickable-row:hover {
    background: #f1f5ff !important;
}

/* Search Section */
.search-section {
    margin-bottom: 20px;
}

.search-box {
    background: white;
    border-radius: 30px;
    padding: 5px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    border: 2px solid var(--light);
}

.search-box i {
    color: var(--gray);
}

.search-box input {
    flex: 1;
    padding: 12px 0;
    border: none;
    font-size: 16px;
    background: transparent;
}

.search-box input:focus {
    outline: none;
}

.search-clear {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.search-clear:hover {
    background: var(--light);
    color: var(--danger);
}

/* Table Pagination - VERSI PERBAIKAN */
.table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.table-pagination button {
    min-width: 40px;
    height: 40px;
    border: none;
    background: white;
    color: var(--dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--light);
}

.table-pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79,70,229,0.2);
}

.table-pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 700;
}

.table-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.table-pagination button i {
    font-size: 12px;
}

/* Stok Toggle Section */
.stok-toggle-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.stok-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.stok-toggle-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stok-toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.stok-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stok-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 30px;
}

.stok-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stok-toggle-input:checked + .stok-toggle-slider {
    background-color: var(--primary);
}

.stok-toggle-input:checked + .stok-toggle-slider:before {
    transform: translateX(30px);
}

.stok-toggle-info {
    padding: 10px;
    background: var(--light);
    border-radius: 10px;
    color: var(--gray);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 10;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--light);
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 10px;
    color: var(--dark);
}

.modal-body p strong {
    color: var(--primary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--gray);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-footer button {
    min-width: 120px;
}

/* Preview Card */
.preview-card {
    background: var(--light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.preview-row:last-child {
    border-bottom: none;
}

.preview-label {
    color: var(--gray);
    font-weight: 500;
}

.preview-value {
    font-weight: 600;
    color: var(--primary);
}

.highlight {
    color: var(--primary);
    font-size: 18px;
    background: rgba(79, 70, 229, 0.1);
    padding: 2px 8px;
    border-radius: 5px;
}

/* Button Small */
.btn-small {
    padding: 5px 10px;
    background: var(--light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: var(--dark);
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--primary);
    color: white;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 15px 25px;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s;
    z-index: 1000;
    max-width: 400px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ======================
   RESPONSIVE DESIGN
====================== */

/* Tablet */
@media (max-width: 992px) {
    .container {
        padding: 15px;
    }
    
    .stats-grid {
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .modal-content {
        max-width: 450px;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 20px;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px 10px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .location-buttons {
        grid-template-columns: 1fr;
    }
    
    .scanner-container {
        grid-template-columns: 1fr;
    }
    
    
    
    .tabs {
        padding-bottom: 10px;
    }
    
    .tab {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .table-pagination {
        gap: 5px;
    }
    
    .table-pagination button {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
    }
}

/* Mobile Portrait */
@media (max-width: 576px) {
    .container {
        padding: 10px;
    }
    
    .navbar {
        padding: 10px;
    }
    
    .nav-brand span {
        font-size: 16px;
    }
    
    .user-info {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .btn-logout {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .location-section {
        padding: 15px;
    }
    
    .location-section h3 {
        font-size: 16px;
    }
    
    .location-btn {
        padding: 12px;
        min-height: 60px;
    }
    
    .location-btn i {
        font-size: 20px;
    }
    
    .location-btn span {
        font-size: 13px;
    }
    
    .toggle-switch {
        width: 40px;
        height: 20px;
    }
    
    .toggle-slider {
        width: 16px;
        height: 16px;
    }
    
    .location-btn.active .toggle-slider {
        left: 22px;
    }
    
    .stats-grid {
        gap: 6px;
    }
    
    .stat-card {
        padding: 10px 5px;
    }
    
    .stat-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header h3 {
        font-size: 16px;
    }
    
    .scanner-controls {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-camera {
        width: 100%;
        justify-content: center;
        font-size: 13px;
        padding: 8px;
    }
    
    .location-badge {
        width: 100%;
        justify-content: center;
        font-size: 12px;
    }
    
    .manual-input input {
        padding: 12px;
        font-size: 14px;
    }
    
    .btn-secondary {
        padding: 12px;
        font-size: 14px;
    }
    
    .tabs {
        gap: 5px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tab i {
        font-size: 12px;
    }
    
    .modern-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 10px 8px;
    }
    
    .search-box {
        padding: 3px 15px;
    }
    
    .search-box input {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .search-clear {
        width: 25px;
        height: 25px;
        font-size: 20px;
    }
    
    .table-pagination {
        gap: 4px;
    }
    
    .table-pagination button {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .stok-toggle-section {
        padding: 15px;
    }
    
    .stok-toggle-text {
        font-size: 14px;
    }
    
    .stok-toggle-switch {
        width: 50px;
        height: 24px;
    }
    
    .stok-toggle-slider:before {
        height: 20px;
        width: 20px;
    }
    
    .stok-toggle-input:checked + .stok-toggle-slider:before {
        transform: translateX(26px);
    }
    
    .stok-toggle-info {
        font-size: 12px;
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .preview-card {
        padding: 15px;
    }
    
    .preview-row {
        flex-direction: column;
        gap: 3px;
        padding: 8px 0;
    }
    
    .preview-label {
        font-size: 12px;
    }
    
    .preview-value {
        font-size: 14px;
    }
    
    .highlight {
        font-size: 16px;
    }
    
    .toast {
        padding: 12px 18px;
        font-size: 13px;
        bottom: 15px;
    }
}

/* Very Small Devices */
@media (max-width: 380px) {
    .stats-grid {
        gap: 4px;
    }
    
    .stat-card {
        padding: 8px 3px;
    }
    
    .stat-icon {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .tab {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .table-pagination button {
        min-width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

/* ======================
   LOKASI HORIZONTAL KHUSUS HP
====================== */
@media (max-width: 768px) {
    .location-section {
        padding: 15px 12px;
    }
    
    .location-section h3 {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .location-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 10px;
        justify-content: space-between;
        width: 100%;
        margin: 0 auto;
    }
    
    .location-btn {
        flex: 1 1 0 !important; /* Membagi lebar secara merata */
        min-width: 0 !important; /* Mengabaikan min-width */
        width: auto !important;
        padding: 12px 5px !important;
        margin: 0 !important;
        flex-direction: column;
        gap: 6px;
        border-radius: 10px;
    }
    
    .location-btn i {
        font-size: 20px !important;
        margin: 0 !important;
    }
    
    .location-btn span {
        font-size: 12px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .toggle-switch {
        transform: scale(0.75);
        margin: 2px 0 0 0;
    }
    
    .location-info {
        padding: 12px;
        font-size: 13px;
        margin-top: 10px;
    }
}

/* Untuk HP kecil (320px - 375px) */
@media (max-width: 375px) {
    .location-section {
        padding: 12px 8px;
    }
    
    .location-buttons {
        gap: 5px;
    }
    
    .location-btn {
        padding: 10px 3px !important;
        gap: 4px;
    }
    
    .location-btn i {
        font-size: 18px !important;
    }
    
    .location-btn span {
        font-size: 11px !important;
    }
    
    .toggle-switch {
        transform: scale(0.65);
    }
}

/* Untuk HP sedang (376px - 480px) */
@media (min-width: 376px) and (max-width: 480px) {
    .location-btn {
        padding: 12px 4px !important;
    }
    
    .location-btn i {
        font-size: 19px !important;
    }
    
    .location-btn span {
        font-size: 11.5px !important;
    }
    
    .toggle-switch {
        transform: scale(0.7);
    }
}

/* Untuk HP Plus (481px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .location-btn {
        padding: 12px 6px !important;
    }
    
    .location-btn i {
        font-size: 20px !important;
    }
    
    .location-btn span {
        font-size: 12px !important;
    }
    
    .toggle-switch {
        transform: scale(0.75);
    }
}

/* Untuk tablet (601px - 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .location-btn {
        padding: 15px 8px !important;
    }
    
    .location-btn i {
        font-size: 22px !important;
    }
    
    .location-btn span {
        font-size: 13px !important;
    }
    
    .toggle-switch {
        transform: scale(0.8);
    }
}

/* ============================================
   FITUR RELASI ANTAR LOKASI
   ============================================ */

/* Grid Statistik Lokasi */
.lokasi-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .lokasi-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Card Statistik per Lokasi */
.lokasi-stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid;
    transition: transform 0.2s;
}

.lokasi-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lokasi-stat-card.etalase { border-left-color: #2196f3; }
.lokasi-stat-card.gantungan { border-left-color: #9c27b0; }
.lokasi-stat-card.gudang { border-left-color: #ff9800; }

.lokasi-stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.lokasi-stat-header i {
    font-size: 1.5rem;
}

.lokasi-stat-header.etalase i { color: #2196f3; }
.lokasi-stat-header.gantungan i { color: #9c27b0; }
.lokasi-stat-header.gudang i { color: #ff9800; }

.lokasi-stat-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #666;
}

.lokasi-stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.lokasi-stat-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
}

/* Badge Restok */
.restok-badge {
    background: #f44336;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.restok-warning {
    background: #ff9800;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Status Badges untuk Tabel */
.status-normal {
    background: #4caf50;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

.status-warning {
    background: #ff9800;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-danger {
    background: #f44336;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    animation: blink 1.5s infinite;
}

/* Warna Stok per Lokasi di Tabel */
.stok-cell {
    font-weight: bold;
    text-align: center;
    padding: 8px !important;
}

.stok-cell.etalase { 
    color: #2196f3; 
    background: #e3f2fd;
    border-radius: 4px;
}

.stok-cell.gantungan { 
    color: #9c27b0; 
    background: #f3e5f5;
    border-radius: 4px;
}

.stok-cell.gudang { 
    color: #ff9800; 
    background: #fff3e0;
    border-radius: 4px;
}

/* Baris Rekomendasi */
.rekomendasi-row {
    background: #fff3e0 !important;
    font-weight: 500;
    border-left: 3px solid #f44336;
}

.rekomendasi-row:hover {
    background: #ffe0b2 !important;
}

/* Tombol Aksi Kecil */
.btn-small {
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    margin: 2px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-small i {
    margin-right: 4px;
    font-size: 0.7rem;
}

.btn-small.btn-success {
    background: #4caf50;
    color: white;
}

.btn-small.btn-success:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-small.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-small.btn-warning:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Legend */
.legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.legend .badge {
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    font-size: 0.7rem;
}

/* Animasi Blink */
@keyframes blink {
    0% { opacity: 1; background: #f44336; }
    50% { opacity: 0.8; background: #d32f2f; }
    100% { opacity: 1; background: #f44336; }
}

/* Tooltip */
[title] {
    position: relative;
    cursor: help;
}

/* Loading State */
.loading-row td {
    padding: 40px !important;
    text-align: center;
    color: #666;
}

.loading-row i {
    margin-right: 8px;
    color: #4f46e5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #ddd;
}

/* Badge Counter */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Responsive Table */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }
    
    .modern-table {
        min-width: 900px;
    }
    
    .stok-cell {
        min-width: 80px;
    }
}

/* ============================================
   BUTTON INFO & MODAL POPUP
   ============================================ */

/* Tombol Info */
.btn-info {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-info:hover {
    background: #f0f0f0;
    color: #4f46e5;
    transform: scale(1.1);
}

.btn-info i {
    font-size: 1.2rem;
}

/* Card Header dengan tombol */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
}

/* Modal Info Styling */
#info-relasi-modal .modal-content {
    animation: slideUp 0.3s ease;
}

.info-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-section h4 {
    color: #4f46e5;
    margin-bottom: 12px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section ul {
    margin: 5px 0 0 25px;
    color: #555;
    line-height: 1.8;
}

.info-section li {
    margin-bottom: 8px;
}

.info-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    margin-right: 8px;
    font-weight: 500;
}

/* Animasi Modal */
@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header h3 {
        margin-bottom: 5px;
    }
    
    .btn-info {
        align-self: flex-end;
    }
    
    #info-relasi-modal .modal-content,
    #confirm-mutasi-modal .modal-content,
    #input-jumlah-modal .modal-content {
        width: 90%;
        margin: 20px auto;
    }
}

/* ============================================
   MODAL POPUP - UKURAN FONT LEBIH KECIL
   ============================================ */

/* Modal Info - perkecil semua font */
#info-relasi-modal .modal-body {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
}

#info-relasi-modal .modal-body h4 {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
}

#info-relasi-modal .modal-body ul,
#info-relasi-modal .modal-body ol {
    margin-top: 3px !important;
    margin-bottom: 10px !important;
    padding-left: 20px !important;
}

#info-relasi-modal .modal-body li {
    margin-bottom: 4px !important;
    font-size: 0.8rem !important;
}

#info-relasi-modal .modal-body p {
    font-size: 0.8rem !important;
    margin: 5px 0 !important;
}

#info-relasi-modal .info-badge {
    font-size: 0.7rem !important;
    padding: 2px 8px !important;
}

#info-relasi-modal small {
    font-size: 0.7rem !important;
}

/* Modal Konfirmasi - perkecil font */
#confirm-mutasi-modal .modal-body {
    font-size: 0.85rem !important;
}

#confirm-mutasi-modal #confirm-message {
    font-size: 0.95rem !important;
    margin-bottom: 15px !important;
}

#confirm-mutasi-modal .confirm-detail,
#confirm-mutasi-modal div[style*="background: #f8f9fa"] {
    font-size: 0.8rem !important;
}

#confirm-mutasi-modal strong {
    font-size: 0.85rem !important;
}

#confirm-mutasi-modal span {
    font-size: 0.8rem !important;
}

/* Modal Input Jumlah - perkecil font */
#input-jumlah-modal .modal-body {
    font-size: 0.85rem !important;
}

#input-jumlah-modal #input-message {
    font-size: 0.9rem !important;
}

#input-jumlah-modal #input-hint {
    font-size: 0.7rem !important;
}

#input-jumlah-modal input {
    font-size: 1rem !important;
}

/* Tombol dalam modal */
.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
}

/* Ikon dalam modal */
#info-relasi-modal .modal-body i {
    font-size: 0.9rem !important;
}

/* Responsive untuk HP */
@media (max-width: 768px) {
    #info-relasi-modal .modal-body {
        font-size: 0.8rem !important;
    }
    
    #info-relasi-modal .modal-body h4 {
        font-size: 0.85rem !important;
    }
    
    #info-relasi-modal .modal-body li {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }
    
    #confirm-mutasi-modal .modal-body {
        font-size: 0.8rem !important;
    }
    
    #confirm-mutasi-modal #confirm-message {
        font-size: 0.9rem !important;
    }
    
    #input-jumlah-modal .modal-body {
        font-size: 0.8rem !important;
    }
}

/* Sembunyikan kolom Aksi untuk non-admin */
body:not(.admin-mode) .admin-only {
    display: none;
}

/* Atau alternatif dengan class */
.hide-aksi .admin-only {
    display: none;
}

@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 0.8rem 0.8rem;
    }
    
    .nav-brand {
        width: 100%;
        justify-content: flex-start; /* Logo dan nama di kiri */
        margin-bottom: 5px;
    }
    
    .nav-menu {
        width: 100%;
        flex-direction: row; /* User info dan logout berjejer */
        justify-content: space-between;
        gap: 5px;
    }    
    
    .btn-logout {
        flex: 0.5; /* Logout lebih kecil */
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    
    
    .nav-brand span {
        font-size: 1rem;
    }
    
    .user-info {
        padding: 0.3rem 0.8rem;
    }
    
    
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .user-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    .btn-logout {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}


