/* 
   TaskBot V2 - Premium UI System
   Theme: Acid Neon / Dark Bento & Light Mode
   Aesthetics First: Modern, Tactile, Glassmorphic
*/

:root {
    /* Color Palette - Default Light */
    color-scheme: light;
    --primary: #8bc34a;      /* Leaf Green */
    --primary-dark: #689f38; /* Darker Green */
    --accent: #f59e0b;       /* Amber 500 */
    --accent-hover: #d97706; /* Amber 600 */
    
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-sub: #e2e8f0;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-neon: 0 0 10px rgba(139, 195, 74, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    color-scheme: dark;
    --primary: #D4FF3F;      /* Acid Neon */
    --primary-dark: #b2d815; /* Darker Neon */
    --accent: #f59e0b;       
    --accent-hover: #d97706; 
    
    --bg-main: #050A0B;
    --bg-card: #121A1C;
    --bg-input: #172224;
    --bg-sub: #0B1012;
    
    --text-main: #E0E7E9;
    --text-muted: #8b9a9d;
    --text-inverse: #050A0B;
    
    --border: rgba(212, 255, 63, 0.1);
    --border-light: rgba(212, 255, 63, 0.06);
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.6);
    --shadow-neon: 0 0 10px rgba(212, 255, 63, 0.2);
}

/* --- Base & Typography --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.4s ease;
}

/* --- Layout --- */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.header {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    background: var(--primary);
    color: var(--text-inverse);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-subtitle {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

.header-badge {
    border: 1px solid var(--border);
    background: rgba(212, 255, 63, 0.05);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.content {
    flex: 1;
    padding: 16px;
    padding-bottom: 90px;
}

/* --- Tabs & Navigation --- */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(18, 26, 28, 0.8);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 10px 4px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn i { font-size: 14px; }

.tab-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.tab-btn.active i {
    color: var(--primary);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(18, 26, 28, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 12px 8px 24px 8px; /* Extra padding for iOS home indicator */
    z-index: 1001;
}

.nav-item {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item span:first-child { font-size: 22px; transition: transform 0.2s; }

.nav-item.active { color: var(--primary); }
.nav-item.active span:first-child { transform: translateY(-4px); }

/* --- Search & Filters --- */
.categories-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.cat-chip.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    box-shadow: var(--shadow-neon);
}

/* --- Cards & Components --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.card h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-sub);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    transition: transform 0.2s;
}
.inventory-item:active { transform: scale(0.98); }

.item-info { display: flex; align-items: center; gap: 12px; }
.item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.item-info h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; color: var(--text-main); }
.item-cat {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

.item-qty {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    text-align: right;
    font-family: 'Outfit', sans-serif;
}

/* --- Buttons --- */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

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

.btn-primary { background: var(--primary); color: var(--text-inverse); box-shadow: var(--shadow-neon); }
.btn-primary:hover { background: var(--primary-dark); }

.btn-arrival { background: rgba(212, 255, 63, 0.1); color: var(--primary); border: 1px solid var(--border); }
.btn-issuance { background: rgba(245, 158, 11, 0.1); color: var(--accent); border: 1px solid rgba(245, 158, 11, 0.2); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--primary); }
.btn-secondary { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border); }

/* --- Secondary Action Buttons --- */
.action-buttons-wrap {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn-action:active { transform: scale(0.95); }

.btn-danger-soft {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-excel {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.icon-btn:active { transform: scale(0.9); }

/* --- Forms & Inputs --- */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input[type="text"], 
input[type="number"], 
input[type="date"], 
select, 
textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1.5px rgba(212, 255, 63, 0.3);
}

/* --- Task Grid --- */
.task-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.tg-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
}

.tg-btn:active { transform: scale(0.95); }

.tg-icon {
    font-size: 24px;
    background: var(--bg-input);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.tg-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

/* Task Button Variants */
.tg-attendance { background: var(--primary); color: var(--text-inverse); border: none; box-shadow: var(--shadow-neon); }
.tg-attendance .tg-icon { background: rgba(5, 10, 11, 0.15); border: none; color: var(--text-inverse); }

.tg-manual .tg-icon { color: var(--primary); }
.tg-mech .tg-icon { color: var(--primary); }
.tg-mech-op .tg-icon { color: var(--primary); }
.tg-mech-pest { }
.tg-mech-pest .tg-icon { color: var(--accent); border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }
.tg-mech-pest .tg-label { color: var(--accent); }

/* --- Wizard --- */
.steps-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.step-dot {
    height: 4px;
    flex: 1;
    background: var(--border);
    border-radius: 10px;
    transition: var(--transition);
}
.step-dot.active { background: var(--primary); box-shadow: var(--shadow-neon); }

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 11, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
}
.modal.show { display: flex; }

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    border-top: 1px solid var(--border);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 20px;
    color: var(--text-muted);
}

/* --- Access & Pin --- */
#access-denied, #pin-modal {
    background: var(--bg-main);
    z-index: 5000;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.pin-display {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 12px;
    color: var(--primary);
    margin: 30px 0;
    font-family: monospace;
}

.pin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 280px;
}
.pin-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}
.pin-btn:active { background: var(--bg-input); }

/* --- Animations --- */
.view { display: none; animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.view.active { display: block; }

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

/* --- Date Helpers & Chips --- */
.date-helpers {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.date-chip, .w-chip {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.date-chip:active, .w-chip:active {
    transform: scale(0.95);
}

.date-chip:hover, .w-chip:hover {
    border-color: var(--primary);
}

.date-chip.active, .w-chip.selected {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.btn-report {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    color: var(--primary);
    height: 56px;
    font-size: 14px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    width: 100%;
}
.btn-report:active {
    background: rgba(212, 255, 63, 0.1);
}

.summary-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.summary-card {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
}

.summary-val {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}
