:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --panel-bg: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 90px;
}

/* Glass Panels Reusable Styles */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
}

.glass-panel-highlight {
    background: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
}

.app-header {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid var(--panel-border);
    position: sticky; top: 0; z-index: 10;
}
.app-header h1 { font-size: 1.2rem; color: #60a5fa; letter-spacing: 0.5px; }

.app-content { padding: 15px; }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* Translucent Glass Plus Button */
.action-area { display: flex; justify-content: center; margin-bottom: 20px; }
.btn-circular-plus {
    width: 65px; height: 65px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #93c5fd;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}
.btn-circular-plus:active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    transform: scale(0.95);
}

/* Stacked Form Input Elements */
.creator-zone { margin-bottom: 15px; }
.mobile-input-stack { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.field-block { display: flex; flex-direction: column; gap: 6px; }
.field-block label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-align: right; }

.mobile-input-stack input {
    width: 100%; padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    font-size: 1rem; color: white; outline: none;
    text-align: right; transition: border-color 0.2s;
}
.mobile-input-stack input:focus { border-color: var(--primary); }
#input-item-price { text-align: center; }

.btn-submit-row-block {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white; border: none; border-radius: 10px;
    font-weight: 700; font-size: 1.05rem;
    box-shadow: 0 4px 15px var(--success-glow);
}

/* Premium Card Layout */
.item-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    padding: 16px; border-radius: 14px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.2s;
}
.item-card:active { background: rgba(255, 255, 255, 0.08); }

.card-details-wrapper { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.card-details { display: flex; flex-direction: column; gap: 3px; }

.card-title { font-size: 1.05rem; font-weight: 500; color: var(--text-main); text-align: left; }
.card-meta { font-size: 0.75rem; color: var(--text-muted); text-align: left; }

.card-price-display {
    font-size: 1.4rem; font-weight: 700; color: #60a5fa;
    margin-right: 15px; white-space: nowrap; text-align: right;
}

/* Right Side Checked Box Button */
.card-action-checkmark {
    margin-left: 15px; padding: 10px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399; font-weight: 700;
    font-size: 1.1rem; border-radius: 10px;
}

/* History States Styling */
.item-card.history-unbought { border-left: 5px solid var(--warning); background: rgba(245, 158, 11, 0.03); }
.item-card.history-bought { border-left: 5px solid var(--success); background: rgba(16, 185, 129, 0.03); }
.item-card.selectable { cursor: pointer; }
.item-card.selected { border: 2px solid var(--primary); background: rgba(59, 130, 246, 0.15); }

.btn-action-history-del {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; margin-left: 10px;
}

/* History Filters and Navigation Header */
.history-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.calc-buttons { display: flex; gap: 8px; }

.glass-button {
    background: var(--panel-bg); color: var(--text-main);
    border: 1px solid var(--panel-border); padding: 8px 14px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 500; backdrop-filter: blur(5px);
}

/* Calculated Results Floating Panel */
.inline-form { padding: 16px; margin-bottom: 20px; }
.btn-done-calc-glass {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white; border: none; border-radius: 10px; font-weight: 700;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.calc-mode .date-group {
    background: rgba(59, 130, 246, 0.03); padding: 16px; border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3); margin-bottom: 15px;
}
.calc-total-box {
    margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--panel-border);
    display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; color: #60a5fa;
}
.date-header { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.btn-del-group { background: transparent; border: none; color: #f87171; font-size: 0.8rem; font-weight: 500; }

/* Custom Overlaid Modals styling */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content { width: 90%; max-width: 380px; padding: 22px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.modal-content h3 { font-size: 1.1rem; margin-bottom: 15px; text-align: center; color: #60a5fa; }

.input-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.input-group input {
    padding: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-border);
    border-radius: 8px; color: white; text-align: right; outline: none;
}
.input-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-align: right; }

.modal-actions-stacked { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.modal-actions-stacked button { width: 100%; padding: 12px; border: none; border-radius: 8px; font-weight: 600; font-size: 0.95rem; }

.btn-primary-glass { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); color: white; box-shadow: 0 4px 12px var(--primary-glow); }
.btn-secondary-glass { background: rgba(255,255,255,0.08); color: var(--text-main); border: 1px solid var(--panel-border)!important; }
.btn-danger-glass { background: rgba(220, 38, 38, 0.2); color: #f87171; border: 1px solid rgba(220, 38, 38, 0.4)!important; }

/* Alert Modals unique layout */
.alert-box { text-align: center; }
.alert-icon { font-size: 2.5rem; margin-bottom: 10px; }
.alert-box p { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; color: var(--text-main); }

/* Translucent Nav Menu bottom placement */
.glass-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); border-top: 1px solid var(--panel-border);
    display: flex; justify-content: space-around; align-items: center; z-index: 100;
}
.nav-item { background: none; border: none; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); width: 50%; height: 100%; }
.nav-item.active { color: #60a5fa; background: rgba(255, 255, 255, 0.02); font-weight: 600; }
.hidden { display: none !important; }