:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(22, 27, 34, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #58a6ff;
    --primary-hover: #3182ce;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-sisas: #ff7b72;
    --accent-lumitek: #7ee787;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Stunning Animated Background */
.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(126, 231, 135, 0.1), transparent 25%);
    filter: blur(60px);
    animation: pulseBg 15s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* Glassmorphism Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Sidebar */
.sidebar {
    width: 260px;
    margin: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px rgba(88,166,255,0.5));
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links li.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px 24px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 30px;
    width: 400px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #8a2be2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

/* Sections */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 0.95rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 166, 255, 0.3);
}

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

.btn-primary:disabled {
    background: #21262d;
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Table */
.table-container {
    padding: 8px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.amount {
    font-weight: 600;
    color: #fff;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-sisas {
    background: rgba(255, 123, 114, 0.15);
    color: var(--accent-sisas);
    border: 1px solid rgba(255, 123, 114, 0.3);
}

.badge-lumitek {
    background: rgba(126, 231, 135, 0.15);
    color: var(--accent-lumitek);
    border: 1px solid rgba(126, 231, 135, 0.3);
}

/* Modal View */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out forwards;
}

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

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
}

.modal-image-preview {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    object-fit: contain;
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-image-preview img:hover {
    transform: scale(1.02);
}

/* Lightbox Wrapper */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease forwards;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 3001;
}

.lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255,255,255,0.1);
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 10px;
}

.scanners-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dropzone-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 480px;
    position: relative;
    overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.dragover {
    background: rgba(88, 166, 255, 0.05);
    border-color: var(--primary-color);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
}

.dropzone-content svg {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.dropzone-content h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

#image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 10;
    border-radius: 14px;
}

.hidden {
    display: none !important;
}

/* Extraction Form */
.extraction-form {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.extraction-form h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input, .form-group textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 12px 14px;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: rgba(255,255,255,0.2);
}

.w-100 {
    width: 100%;
    margin-top: 10px;
}

/* Scanner Animation */
.scanner-icon {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.scanner-line {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color), 0 0 16px var(--primary-color);
    animation: scanLine 2s ease-in-out infinite alternate;
}

@keyframes scanLine {
    0% { top: 10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 90%; opacity: 0; }
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: inline-block !important;
        margin-top: 4px;
    }

    .app-container {
        flex-direction: column;
        padding-bottom: 70px; /* Space for bottom nav */
    }

    .main-content {
        padding: 16px;
    }

    .top-header {
        margin-bottom: 16px;
    }

    .search-bar {
        width: 100%;
    }

    /* Bottom Navigation Bar */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        margin: 0;
        padding: 0;
        flex-direction: row;
        border-radius: 20px 20px 0 0;
        background: rgba(22, 27, 34, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--glass-border);
        border-right: none;
        border-left: none;
        border-bottom: none;
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    .sidebar .logo {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0 10px;
    }

    .nav-links li {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .nav-links li.active {
        background: transparent;
        border-left: none;
        border-top: 3px solid var(--primary-color);
        color: var(--primary-color);
        border-radius: 0;
        padding-top: 5px;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .dropzone-container {
        min-height: 250px;
        padding: 20px;
    }

    .header-titles h1 {
        font-size: 1.5rem;
    }

    .row-group {
        grid-template-columns: 1fr;
    }

    .data-table th, .data-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .client-name {
        font-weight: 500;
    }
}
