:root {
    --primary: #1E3A8A; /* Minimalist Deep Blue */
    --primary-light: #3B82F6;
    --accent: #10B981; /* Success Green */
    --accent-dark: #059669;
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-card: 16px;
    --radius-btn: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* HEADER NAV */
.app-header {
    background: var(--primary);
    color: white;
    padding: 15px 20px;
    padding-bottom: 25px; /* Extra padding for overlap */
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 15px rgba(30,58,138,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent);
}

.logo-area h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tab-controls {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-btn);
    padding: 4px;
    gap: 5px;
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.nav-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* MAIN CONTAINER */
.app-container {
    padding: 15px;
    margin-top: -15px; /* Overlap effect */
    position: relative;
    z-index: 10;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

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

/* LOGIN OVERLAY */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.login-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-card {
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5) !important;
}

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

/* CARDS WITH GLASSMORPHISM FEEL */
.glass-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(10px);
}

.glass-card:hover {
    box-shadow: var(--shadow-hover);
}

.primary-border { border-top: 4px solid var(--primary-light); }
.highlight-card { border: 2px solid var(--accent); background: #F8FAFC; }

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-icon {
    text-align: center;
    margin-bottom: 10px;
}

.shadow-icon {
    font-size: 40px;
    color: var(--primary-light);
    filter: drop-shadow(0px 4px 6px rgba(59,130,246,0.4));
}

.desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* FORMS */
.form-group {
    margin-bottom: 15px;
}

.row-group {
    display: flex;
    gap: 15px;
}

.input-wrap { flex: 1; display: flex; flex-direction: column;}
.input-wrap.half { flex: 0.5; }

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    font-size: 14px;
    color: var(--text-main);
    background: #F9FAFB;
    transition: all 0.3s ease;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: white;
}

.input-group-append {
    display: flex;
    gap: 10px;
}

/* BUTTONS */
.btn {
    border: none;
    border-radius: var(--radius-btn);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { background: #1E3A8A; }

.btn-secondary { background: var(--bg); color: var(--text-main); border: 1px solid var(--border);}
.btn-secondary:hover { background: #E5E7EB; }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dark); box-shadow: 0 4px 10px rgba(16,185,129,0.3);}

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

.btn-large { padding: 15px; font-size: 16px; width: 100%; margin-top: 10px;}
.btn-sm { padding: 8px 12px; font-size: 12px; margin: 10px auto; display: flex; }
.w-100 { width: 100%; }
.mb-10 { margin-bottom: 10px; }
.text-center { text-align: center; }
.text-red { color: var(--danger) !important; }

/* SCANNER DIV */
.scanner-container {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-card);
    background: #000;
    margin-bottom: 15px;
}

#reader {
    width: 100%;
    min-height: 250px;
}

/* ITEM INFO BOX */
.item-info-box {
    background: var(--bg);
    border-radius: var(--radius-btn);
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid var(--primary-light);
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 8px;
}
.info-row:last-child { margin-bottom: 0; border: none; padding-bottom: 0;}

.info-label { font-size: 12px; color: var(--text-muted); }
.info-value { font-size: 14px; font-weight: 600; color: var(--text-main); text-align: right;}
.info-value.highlight { color: var(--primary); }

/* QTY INPUT */
.qty-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 0;
}

.btn-qty {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--primary);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-qty:active { background: #E5E7EB; transform: scale(0.95);}

#input-qty {
    width: 80px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border-color: var(--primary-light);
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.modern-table th {
    text-align: left;
    padding: 10px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.modern-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* MASTER DATA SETTINGS UPLOAD */
.upload-area {
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-card);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(59,130,246,0.05);
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-area:hover {
    background: rgba(59,130,246,0.1);
}

.excel-icon {
    color: #107C41; /* Excel Green */
    margin-bottom: 10px;
}

.upload-area p {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
}

.status-box {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
}
.badge.red { background: var(--danger); }
.badge.green { background: var(--accent); }

/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: opacity 0.3s ease;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { background: var(--accent-dark); }
.toast.error { background: var(--danger); }
