/* ============================================
   STOCK TRACKER - Premium Mobile-First CSS
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --bg-input: #16162a;
    --bg-nav: #0e0e1a;

    --accent-primary: #7c5cfc;
    --accent-primary-glow: rgba(124, 92, 252, 0.3);
    --accent-secondary: #00d4aa;
    --accent-warning: #ffb84d;
    --accent-danger: #ff6b6b;
    --accent-info: #4dacff;

    --text-primary: #f0f0f8;
    --text-secondary: #8888a8;
    --text-muted: #5a5a78;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    /* Sizing */
    --header-height: 64px;
    --nav-height: 68px;
    --radius: 14px;
    --radius-sm: 8px;
    --radius-xs: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg-primary);
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--header-height);
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.6rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), #a78bfa);
    border-radius: 10px;
}

.header-left h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s;
}

.btn-icon:active {
    background: var(--bg-card);
}

/* ============================================
   PAGES CONTAINER
   ============================================ */
.pages-container {
    padding-top: calc(var(--header-height) + 8px);
    padding-bottom: calc(var(--nav-height) + 16px);
    padding-left: 14px;
    padding-right: 14px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.stat-primary::before { background: linear-gradient(90deg, var(--accent-primary), transparent); }
.stat-success::before { background: linear-gradient(90deg, var(--accent-secondary), transparent); }
.stat-warning::before { background: linear-gradient(90deg, var(--accent-warning), transparent); }
.stat-info::before { background: linear-gradient(90deg, var(--accent-info), transparent); }

.stat-icon {
    font-size: 1.6rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CATEGORY BREAKDOWN
   ============================================ */
.category-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-bar:last-child {
    border-bottom: none;
}

.category-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-bar-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-bar-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-secondary);
    white-space: nowrap;
    margin-left: 8px;
}

/* ============================================
   TOP SOLD LIST
   ============================================ */
.top-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.top-item:last-child {
    border-bottom: none;
}

.top-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.top-rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.top-rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.top-rank-3 { background: linear-gradient(135deg, #CD7F32, #B87333); color: #fff; }
.top-rank-default { background: var(--bg-input); color: var(--text-secondary); }

.top-item-info {
    flex: 1;
    min-width: 0;
}

.top-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-item-category {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.top-item-sold {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-primary);
}

/* ============================================
   LOW STOCK
   ============================================ */
.low-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.low-stock-item:last-child {
    border-bottom: none;
}

.low-stock-badge {
    background: rgba(255, 107, 107, 0.15);
    color: var(--accent-danger);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* ============================================
   DAILY ENTRY PAGE
   ============================================ */
.entry-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.date-picker-wrapper, .month-picker-wrapper {
    flex: 1;
}

.date-picker-wrapper label, .month-picker-wrapper label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.input-date {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s;
    color-scheme: dark;
}

.input-date:focus {
    border-color: var(--accent-primary);
}

.btn-save-all {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.category-tab.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.category-tab:active {
    transform: scale(0.96);
}

/* Entry Table */
.entry-table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 12px;
}

.entry-table-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.col-name {
    flex: 1;
    min-width: 0;
}

.col-num {
    width: 52px;
    text-align: center;
    flex-shrink: 0;
}

.col-sold {
    color: var(--accent-secondary);
}

.entry-row {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.entry-row:last-child {
    border-bottom: none;
}

.entry-row:active {
    background: rgba(255, 255, 255, 0.02);
}

.entry-row .col-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 4px;
}

.entry-row .col-num {
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry-input {
    width: 44px;
    height: 34px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.entry-input::-webkit-outer-spin-button,
.entry-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.entry-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.entry-input.input-add:focus {
    border-color: var(--accent-info);
    box-shadow: 0 0 0 2px rgba(77, 172, 255, 0.2);
}

.entry-input.input-remaining:focus {
    border-color: var(--accent-warning);
    box-shadow: 0 0 0 2px rgba(255, 184, 77, 0.2);
}

.sold-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-secondary);
    min-width: 28px;
    text-align: center;
}

.sold-value.negative {
    color: var(--accent-danger);
}

.entry-row-category {
    padding: 8px 12px;
    background: rgba(124, 92, 252, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--border-color);
}

/* Entry Summary */
.entry-summary {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    display: flex;
    justify-content: space-around;
}

.summary-item {
    text-align: center;
}

.summary-item span:first-child {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-secondary);
}

/* ============================================
   PRODUCTS PAGE
   ============================================ */
.products-header {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.search-bar {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

.search-bar input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent-primary);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.btn-add {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
}

.product-card:active {
    background: var(--bg-card-hover);
}

.product-card-left {
    flex: 1;
    min-width: 0;
}

.product-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.product-card-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-stock {
    text-align: right;
}

.product-stock-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.product-stock-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-actions {
    display: flex;
    gap: 4px;
}

.btn-tiny {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-tiny:active {
    background: rgba(255, 255, 255, 0.1);
}

.btn-tiny.danger:active {
    background: rgba(255, 107, 107, 0.2);
}

/* ============================================
   REPORTS PAGE
   ============================================ */
.report-period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
}

.period-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

.report-section {
    display: none;
}

.report-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Report Stats */
.report-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.report-stat {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.report-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.report-stat-label {
    font-size: 0.62rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

/* Report Table */
.report-table {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 12px;
}

.report-table-header {
    display: flex;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.report-table-row {
    display: flex;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.report-table-row:last-child {
    border-bottom: none;
}

.report-col-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-col { width: 50px; text-align: center; flex-shrink: 0; }
.report-col-wide { width: 60px; text-align: right; flex-shrink: 0; }

/* Top Period Selector */
.top-period-selector {
    margin-bottom: 14px;
}

/* Chart */
.chart-container {
    padding: 8px 0;
    overflow-x: auto;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding: 0 4px;
    min-width: 100%;
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 14px;
}

.bar {
    width: 100%;
    max-width: 16px;
    background: linear-gradient(to top, var(--accent-primary), #a78bfa);
    border-radius: 3px 3px 0 0;
    transition: height 0.4s ease;
    min-height: 2px;
}

.bar-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 4px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    max-height: 30px;
    overflow: hidden;
}

/* Monthly day grid */
.monthly-day-row {
    display: flex;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    align-items: center;
}

.monthly-day-row:last-child {
    border-bottom: none;
}

.monthly-day-date {
    width: 70px;
    font-weight: 600;
    flex-shrink: 0;
}

.monthly-day-sold {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--accent-secondary);
}

.monthly-day-revenue {
    width: 80px;
    text-align: right;
    font-weight: 700;
    color: var(--accent-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:active {
    background: #6a4ee8;
}

.btn-success {
    background: var(--accent-secondary);
    color: #000;
}

.btn-danger {
    background: var(--accent-danger);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-outline:active {
    background: var(--bg-card);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.74rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--accent-primary);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238888a8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-sm {
    border-radius: var(--radius);
    margin: 16px;
    max-width: 340px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 0;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 18px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 0 18px 18px;
    justify-content: flex-end;
}

.confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background: rgba(14, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 0 0 3px 3px;
}

.nav-icon {
    font-size: 1.35rem;
}

.nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--accent-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(124, 92, 252, 0.4);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--accent-secondary);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
}

.toast.error {
    background: var(--accent-danger);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 32px 16px;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.empty-state-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   TEXT UTILITIES
   ============================================ */
.text-muted {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.text-success { color: var(--accent-secondary); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 360px) {
    html { font-size: 13px; }
    .entry-input { width: 38px; height: 30px; font-size: 0.8rem; }
    .col-num { width: 44px; }
}

@media (min-width: 481px) {
    .app-header,
    .bottom-nav {
        max-width: 480px;
    }
}

/* Prevent overscroll bounce */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        -webkit-overflow-scrolling: touch;
    }
}
