/*
 * DUKAANDAR — Shop Panel Design System
 * Mobile-first, large tap targets, Marathi + English co-equal
 *
 * Extends /css/style.css (the shared design tokens)
 */

/* ═══════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Main
   ═══════════════════════════════════════════════════════════ */

.sh-layout {
    min-height: 100vh;
    display: flex;
    background: var(--n50);
}

/* ───── Sidebar (desktop) ───── */
.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 20;
}

.sb-brand {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--p800) 0%, var(--p900) 100%);
    color: #fff;
    flex-shrink: 0;
}
.sb-brand img { width: 36px; height: 36px; }
.sb-brand-t { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand-en { font-size: 16px; font-weight: 900; letter-spacing: 0.4px; }
.sb-brand-mr { font-size: 12px; color: #fdba74; font-family: var(--font-mr); font-weight: 700; }

.sb-shop {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sb-shop-av {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--a100); color: var(--a700);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px; flex-shrink: 0;
}
.sb-shop-inf { min-width: 0; flex: 1; }
.sb-shop-name {
    font-size: 13px; font-weight: 700; color: var(--n800);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-shop-code {
    font-size: 11px; color: var(--muted);
    font-family: var(--font-mono);
}

.sb-nav { padding: 12px 0; flex: 1; }
.sb-section-label {
    padding: 10px 20px 6px;
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.sb-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--n700);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    position: relative;
}
.sb-link:hover {
    background: var(--p50);
    color: var(--p800);
}
.sb-link.active {
    background: var(--p50);
    color: var(--p800);
    border-left-color: var(--a600);
    font-weight: 700;
}
.sb-link svg {
    width: 18px; height: 18px; flex-shrink: 0;
    color: var(--n500);
}
.sb-link:hover svg, .sb-link.active svg { color: var(--p800); }

.sb-link.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.sb-link .coming {
    margin-left: auto;
    font-size: 9px;
    font-weight: 800;
    color: var(--a700);
    background: var(--a100);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sb-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ───── Mobile header ───── */
.mob-hdr {
    display: none;
    position: sticky;
    top: 0;
    z-index: 30;
    background: linear-gradient(135deg, var(--p800), var(--p900));
    color: #fff;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--sh-md);
}
.mob-hdr-brand { display: flex; align-items: center; gap: 10px; }
.mob-hdr-brand img { width: 32px; height: 32px; }
.mob-hdr-brand h1 { font-size: 15px; font-weight: 900; letter-spacing: 0.3px; }
.mob-hdr-brand small { font-size: 10px; color: #fdba74; font-family: var(--font-mr); font-weight: 700; }
.mob-hdr-burger {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    width: 38px; height: 38px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    cursor: pointer;
}
.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 19;
}

/* ───── Main content ───── */
.main {
    flex: 1;
    min-width: 0;
    padding: 24px 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.pg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pg-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--n900);
    line-height: 1.2;
}
.pg-title small {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin-top: 4px;
    font-family: var(--font-mr);
}
.pg-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   STATS / DASHBOARD
   ═══════════════════════════════════════════════════════════ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    transition: all 0.18s;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
    border-color: var(--p300);
}
.sc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.sc-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.sc-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--p100); color: var(--p800);
}
.stat-card.accent .sc-icon { background: var(--a100); color: var(--a700); }
.stat-card.green  .sc-icon { background: var(--green-bg); color: #166534; }
.stat-card.red    .sc-icon { background: var(--red-bg); color: var(--red); }
.stat-card.amber  .sc-icon { background: var(--amber-bg); color: var(--amber); }
.sc-val {
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    font-family: var(--font-mono);
}
.sc-val.red   { color: var(--red); }
.sc-val.green { color: #166534; }
.sc-val.amber { color: var(--amber); }
.sc-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-grid.form-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.form-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid.form-1 { grid-template-columns: 1fr; }
@media (max-width: 720px) {
    .form-grid, .form-grid.form-3, .form-grid.form-4 { grid-template-columns: 1fr; }
}

.fg { display: flex; flex-direction: column; gap: 6px; }
.fg label { font-size: 12px; font-weight: 700; color: var(--n700); }
.fg .req { color: var(--red); }
.fg input, .fg select, .fg textarea {
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    transition: all 0.15s;
    width: 100%;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
    outline: none;
    border-color: var(--p500);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.12);
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-host {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--n900);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--sh-lg);
    min-width: 240px;
    max-width: 360px;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
}
.toast.ok { background: #166534; }
.toast.err { background: #991b1b; }
.toast.warn { background: #92400e; }
.toast.info { background: var(--p800); }
@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   SUBSCRIPTION BANNERS
   ═══════════════════════════════════════════════════════════ */
.sub-banner {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    margin-bottom: 16px;
}
.sub-banner.trial  { background: var(--amber-bg); color: #92400e; border: 1px solid var(--amber-b); }
.sub-banner.expiring { background: var(--amber-bg); color: #92400e; border: 1px solid var(--amber-b); }
.sub-banner.expired { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-b); }
.sub-banner a {
    margin-left: auto;
    padding: 6px 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 6px;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border: 1.5px dashed var(--border);
    border-radius: 14px;
}
.empty-state .em-ic {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    background: var(--p50);
    color: var(--p700);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { font-size: 17px; color: var(--n800); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--muted); max-width: 380px; margin: 0 auto 16px; }

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .mob-hdr { display: flex; }
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--sh-xl);
    }
    .sidebar.open { transform: translateX(0); }
    .sb-overlay.open { display: block; }
    .main { padding: 16px 18px; max-width: 100%; }
    .pg-title { font-size: 18px; }
    .pg-title small { font-size: 12px; }
    .sc-val { font-size: 22px; }
}
