/* ============================================================
   assets/style.css — দোকান খাতা | Global Styles
   Kolkata Traditional Theme: Terracotta + Marigold + Off-white
   ============================================================ */

/* --- Google Font + Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;600;700&display=swap');

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

:root {
    --primary:      #B5341B;
    --primary-dark: #8C2614;
    --primary-light:#E2725B;
    --accent:       #FCA311;
    --accent-light: #FFD166;
    --bg:           #FAF6F0;
    --card-bg:      #FFFFFF;
    --text:         #2D2D2D;
    --text-muted:   #6B6B6B;
    --border:       #E8DDD5;
    --success:      #2D9A4E;
    --danger:       #C0392B;
    --info:         #2980B9;
    --warning:      #E67E22;
    --shadow:       0 2px 12px rgba(0,0,0,0.08);
    --radius:       10px;
    --navbar-h:     60px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans Bengali', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}
.nav-brand .swastika { color: var(--accent); font-size: 1.1rem; }
.hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: -280px;
    width: 260px;
    height: 100vh;
    background: var(--card-bg);
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    border-right: 3px solid var(--primary-light);
    overflow-y: auto;
}
.sidebar.open { left: 0; }
.sidebar-header {
    background: var(--primary);
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.sidebar-header button {
    background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s, color 0.2s;
}
.sidebar-link:hover, .sidebar-link.active {
    background: #FFF3E8;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    font-weight: 600;
}
.sidebar-link i { width: 20px; text-align: center; color: var(--primary); }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1999;
}
.sidebar-overlay.open { display: block; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-top: var(--navbar-h);
    padding: 1rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-title i { color: var(--primary); }

/* ===== STAT CARDS (Dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
@media (min-width: 600px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    border-top: 4px solid var(--primary);
    text-align: center;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.green  { border-top-color: var(--success); }
.stat-card.red    { border-top-color: var(--danger); }
.stat-card.orange { border-top-color: var(--warning); }
.stat-card.blue   { border-top-color: var(--info); }
.stat-card .label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-card .value { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.stat-card .value.small { font-size: 1rem; }

/* ===== QUICK ACTION BUTTONS ===== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 500px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }
.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
    background: #FFF8F5;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}
.quick-btn:hover { background: #FEEEE6; border-color: var(--primary-light); color: var(--primary); transform: translateY(-2px); }
.quick-btn i { font-size: 1.6rem; color: var(--primary); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #FFFCF9;
    color: var(--text);
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(226,114,91,0.15);
}
.form-row { display: flex; gap: 0.75rem; }
.form-row .form-group { flex: 1; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success   { background: var(--success);  color: #fff; }
.btn-success:hover { background: #227B3D; }
.btn-danger    { background: var(--danger);   color: #fff; }
.btn-accent    { background: var(--accent);   color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-full      { width: 100%; justify-content: center; padding: 0.85rem; font-size: 1.1rem; }
.btn-sm        { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-whatsapp  { background: #25D366; color: #fff; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
    background: #FFF3E8;
    color: var(--primary-dark);
    padding: 0.7rem 0.75rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-light);
    white-space: nowrap;
}
td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FFF8F5; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #D4EDDA; color: #155724; }
.badge-danger  { background: #F8D7DA; color: #721C24; }
.badge-warning { background: #FFF3CD; color: #856404; }
.badge-info    { background: #D1ECF1; color: #0C5460; }

/* ===== SALE CART ===== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem;
    background: #FFF8F5;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.cart-item .item-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.cart-item .item-price { color: var(--primary); font-weight: 700; min-width: 80px; text-align: right; }
.cart-item .remove-btn {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px; height: 26px;
    cursor: pointer;
    font-size: 0.75rem;
}

/* ===== TOTAL BOX ===== */
.total-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: right;
    margin-bottom: 1rem;
}
.total-box .label { font-size: 0.85rem; opacity: 0.85; }
.total-box .amount { font-size: 2rem; font-weight: 700; }
.total-box .sub-info { font-size: 0.82rem; opacity: 0.75; }

/* ===== SEARCH BOX ===== */
.search-wrap { position: relative; margin-bottom: 0.75rem; }
.search-wrap input { padding-left: 2.5rem; }
.search-wrap i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--card-bg);
    border: 1.5px solid var(--primary-light);
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
    display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #FFF3E8; color: var(--primary); }
.autocomplete-item .item-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ===== ALERTS ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.alert-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.alert-danger  { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }
.alert-warning { background: #FFF3CD; color: #856404; border: 1px solid #FFEEBA; }

/* ===== LOW STOCK HIGHLIGHT ===== */
.low-stock { color: var(--danger); font-weight: 700; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 0.75rem; display: block; }

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 480px) {
    .form-row { flex-direction: column; gap: 0; }
    .stat-card .value { font-size: 1.15rem; }
    table { font-size: 0.82rem; }
    th, td { padding: 0.5rem; }
}

/* ===== PAGE TITLE ===== */
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== SECTION DIVIDER ===== */
.divider {
    border: none;
    border-top: 2px dashed var(--border);
    margin: 1rem 0;
}

/* ===== PROFIT INDICATOR ===== */
.profit-rate {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
}
