/* ============================================================
   EVERMAN DAIRY — ULTIMATE SaaS
   assets/css/style.css — Green + White Premium Theme
   Mobile-First | PWA Ready | Hindi + English
   ============================================================ */

/* ============================================================
   CSS VARIABLES — Brand Colors
   ============================================================ */
:root {
    --primary:        #1D9E75;
    --primary-dark:   #085041;
    --primary-mid:    #0F6E56;
    --primary-light:  #E1F5EE;
    --primary-pale:   #f0fdf9;
    --primary-mid2:   #9FE1CB;

    --white:          #FFFFFF;
    --gray-50:        #F9FAFB;
    --gray-100:       #F3F4F6;
    --gray-200:       #E5E7EB;
    --gray-300:       #D1D5DB;
    --gray-400:       #9CA3AF;
    --gray-500:       #6B7280;
    --gray-600:       #4B5563;
    --gray-700:       #374151;
    --gray-800:       #1F2937;
    --gray-900:       #111827;

    --success:        #1D9E75;
    --success-light:  #E1F5EE;
    --warning:        #F59E0B;
    --warning-light:  #FFFBEB;
    --danger:         #EF4444;
    --danger-light:   #FEF2F2;
    --info:           #3B82F6;
    --info-light:     #EFF6FF;

    --text-primary:   #111827;
    --text-secondary: #6B7280;
    --text-muted:     #9CA3AF;
    --text-white:     #FFFFFF;

    --border:         #E5E7EB;
    --border-focus:   #1D9E75;

    --shadow-sm:      0 1px 2px rgba(0,0,0,0.05);
    --shadow:         0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:      0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);

    --radius-sm:      6px;
    --radius:         10px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --radius-xl:      20px;
    --radius-full:    9999px;

    --nav-height:     64px;
    --header-height:  56px;
    --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--gray-100);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 16px);
    -webkit-font-smoothing: antialiased;
}

body.no-nav {
    padding-bottom: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

input, textarea, select, button {
    font-family: var(--font);
    font-size: 15px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); }

p  { color: var(--text-secondary); line-height: 1.7; }

.text-primary   { color: var(--primary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-sm        { font-size: 13px !important; }
.text-xs        { font-size: 12px !important; }
.text-lg        { font-size: 17px !important; }
.text-xl        { font-size: 20px !important; }
.font-bold      { font-weight: 700 !important; }
.font-medium    { font-weight: 500 !important; }
.text-center    { text-align: center !important; }
.text-right     { text-align: right !important; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

.page-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 0;
}

.section {
    margin-bottom: 20px;
}

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4        { gap: 4px; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.flex-1       { flex: 1; }
.flex-wrap    { flex-wrap: wrap; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.p-0   { padding: 0 !important; }

.w-full  { width: 100%; }
.hidden  { display: none !important; }
.visible { display: block !important; }

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.top-header .back-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-primary);
    flex-shrink: 0;
    text-decoration: none;
}

.top-header .page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.top-header .header-action {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-primary);
    position: relative;
    text-decoration: none;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   DASHBOARD HEADER (Green)
   ============================================================ */
.dash-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 20px 16px 24px;
    color: white;
}

.dash-header .greeting {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2px;
}

.dash-header .dairy-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.dash-header .date-text {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 16px;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-card .stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-card.green  { border-left: 3px solid var(--primary); }
.stat-card.blue   { border-left: 3px solid var(--info); }
.stat-card.amber  { border-left: 3px solid var(--warning); }
.stat-card.purple { border-left: 3px solid #8B5CF6; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-body {
    padding: 16px;
}

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 2px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

/* ============================================================
   LIST ROWS
   ============================================================ */
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row:active {
    background: var(--gray-50);
}

.list-row:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.list-row .row-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.list-row .row-content {
    flex: 1;
    min-width: 0;
}

.list-row .row-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row .row-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row .row-right {
    text-align: right;
    flex-shrink: 0;
}

.list-row .row-amount {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.chevron-right {
    color: var(--gray-300);
    font-size: 16px;
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-mid);
    text-decoration: none;
    color: white;
}

.btn-dark {
    background: var(--primary-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-gray {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-white {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 15px 24px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.12);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.is-error {
    border-color: var(--danger);
}

.form-control.is-success {
    border-color: var(--success);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.input-group .form-control {
    flex: 1;
}

/* AMOUNT INPUT with ₹ prefix */
.amount-input-wrap {
    position: relative;
}

.amount-input-wrap .currency-symbol {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 16px;
}

.amount-input-wrap .form-control {
    padding-left: 30px;
}

/* Quantity stepper */
.qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.qty-stepper button {
    width: 44px;
    height: 44px;
    background: var(--gray-100);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qty-stepper button:active {
    background: var(--gray-200);
}

.qty-stepper input {
    flex: 1;
    text-align: center;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    padding: 0;
    min-width: 0;
}

/* Toggle Switch */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
}

.toggle-label {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
}

.toggle-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================================
   BADGES + PILLS + TAGS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success  { background: var(--success-light); color: var(--primary-dark); }
.badge-danger   { background: var(--danger-light);  color: #B91C1C; }
.badge-warning  { background: var(--warning-light); color: #92400E; }
.badge-info     { background: var(--info-light);    color: #1E40AF; }
.badge-gray     { background: var(--gray-100);      color: var(--gray-600); }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge-purple   { background: #EDE9FE;              color: #5B21B6; }

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary-dark);
    margin: 2px;
}

/* LOYALTY TIERS */
.tier-new      { background: var(--gray-100);  color: var(--gray-600); }
.tier-silver   { background: #F1F5F9;           color: #475569; }
.tier-gold     { background: #FFFBEB;           color: #92400E; }
.tier-platinum { background: #F3E8FF;           color: #6B21A8; }

/* STATUS BADGES */
.status-active   { background: var(--success-light); color: var(--primary-dark); }
.status-inactive { background: var(--gray-100);      color: var(--gray-500); }
.status-trial    { background: var(--info-light);    color: #1E40AF; }
.status-expired  { background: var(--danger-light);  color: #B91C1C; }
.status-paid     { background: var(--success-light); color: var(--primary-dark); }
.status-pending  { background: var(--warning-light); color: #92400E; }
.status-overdue  { background: var(--danger-light);  color: #B91C1C; }

/* ============================================================
   ALERT BANNERS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content { flex: 1; }
.alert-title   { font-weight: 600; margin-bottom: 2px; }

.alert-success { background: var(--success-light); color: var(--primary-dark); border-left: 3px solid var(--primary); }
.alert-danger  { background: var(--danger-light);  color: #991B1B; border-left: 3px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #78350F; border-left: 3px solid var(--warning); }
.alert-info    { background: var(--info-light);    color: #1E3A8A; border-left: 3px solid var(--info); }

/* Trial banner */
.trial-banner {
    background: linear-gradient(135deg, #1D4ED8, #3B82F6);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    gap: 10px;
}

.trial-banner strong { font-weight: 700; }

.trial-banner .btn-trial {
    background: white;
    color: #1D4ED8;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

/* Impersonation bar */
.impersonation-bar {
    background: #F59E0B;
    color: #78350F;
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ============================================================
   BOTTOM NAVIGATION (Mobile App Style)
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    height: var(--nav-height);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    max-width: 100%;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    padding: 8px 4px;
    transition: color 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    -webkit-user-select: none;
    position: relative;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item .nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-item .nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* CENTER FAB BUTTON */
.nav-fab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.nav-fab .fab-btn {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(29,158,117,0.4);
    text-decoration: none;
    transition: all 0.15s;
    margin-top: -10px;
}

.nav-fab .fab-btn:active {
    transform: scale(0.94);
}

/* ============================================================
   BOTTOM SHEET / MODAL
   ============================================================ */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.sheet-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 501;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 0 0 40px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    margin: 12px auto 0;
}

.sheet-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sheet-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sheet-close {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.sheet-body {
    padding: 16px;
}

/* ============================================================
   LOGIN + AUTH PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh;
    background: var(--primary-pale);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 48px 24px 32px;
    text-align: center;
    color: white;
}

.auth-logo {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 16px;
    backdrop-filter: blur(10px);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 28px 20px 32px;
    flex: 1;
    margin-top: -20px;
}

.lang-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.lang-btn {
    flex: 1;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.lang-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ============================================================
   SUPPLY LIST ITEMS
   ============================================================ */
.supply-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
}

.supply-item.holiday {
    background: #FFFBEB;
}

.supply-item .customer-info {
    flex: 1;
    min-width: 0;
}

.supply-item .customer-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supply-item .milk-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.supply-item .supply-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: right;
    flex-shrink: 0;
}

.supply-item .supply-qty {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.holiday-chip {
    background: #FEF3C7;
    color: #92400E;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

/* ============================================================
   BILL PREVIEW CARD
   ============================================================ */
.bill-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.bill-card-header {
    background: var(--primary);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.bill-card-header .dairy-info .name {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.bill-card-header .dairy-info .address {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

.bill-card-header .bill-info {
    text-align: right;
}

.bill-card-header .bill-month {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

.bill-card-body {
    padding: 16px;
}

.bill-customer-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.bill-row:last-child {
    border-bottom: none;
}

.bill-row .label {
    color: var(--text-secondary);
}

.bill-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

.bill-total-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary-light);
    margin: 12px -16px -16px;
}

.bill-total-row .total-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
}

.bill-total-row .total-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

/* ============================================================
   PAYMENT QUICK BUTTONS
   ============================================================ */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.payment-method-btn .method-icon {
    font-size: 24px;
}

.payment-method-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ============================================================
   QR CODE
   ============================================================ */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-container img {
    width: 180px;
    height: 180px;
    margin: 0 auto 12px;
    border-radius: var(--radius);
    border: 2px solid var(--primary-light);
}

.qr-upi-id {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--gray-100);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    display: inline-block;
}

/* ============================================================
   VOICE ENTRY
   ============================================================ */
.voice-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(29,158,117,0.4);
    transition: all 0.15s;
}

.voice-btn.listening {
    animation: pulse 1.2s ease-in-out infinite;
    background: var(--danger);
}

.voice-btn:active {
    transform: scale(0.94);
}

.voice-status {
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.voice-transcript {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    min-height: 48px;
    margin: 12px 0;
}

/* ============================================================
   CALENDAR GRID
   ============================================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 12px;
}

.cal-day-name {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 0;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.cal-day.empty   { cursor: default; }
.cal-day.today   { background: var(--primary); color: white; font-weight: 700; }
.cal-day.holiday { background: #FEF3C7; color: #92400E; }
.cal-day.supply  { background: var(--primary-light); color: var(--primary-dark); }
.cal-day.extra   { background: #DBEAFE; color: #1E40AF; }

/* ============================================================
   NOTIFICATION ITEMS
   ============================================================ */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item.unread {
    background: var(--primary-pale);
}

.notif-item:active {
    background: var(--gray-50);
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-item.unread .notif-dot {
    background: var(--primary);
}

.notif-item:not(.unread) .notif-dot {
    background: transparent;
}

.notif-content .notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-content .notif-msg {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.notif-content .notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state .empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state .empty-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============================================================
   LOADING + SKELETON
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }

.page-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-msg {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    z-index: 2000;
    background: var(--gray-800);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-width: calc(100vw - 32px);
    text-align: center;
}

.flash-msg.show {
    transform: translateX(-50%) translateY(0);
}

.flash-msg.success { background: var(--primary); }
.flash-msg.error   { background: var(--danger); }
.flash-msg.warning { background: var(--warning); color: #78350F; }

/* ============================================================
   SUBSCRIPTION / PLAN PAGE
   ============================================================ */
.plan-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.15s;
}

.plan-card.popular {
    border-color: var(--primary);
    background: var(--primary-pale);
}

.plan-card .popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: var(--radius-full);
}

.plan-card .plan-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.plan-card .plan-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.plan-card .plan-period {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-card .plan-saving {
    background: var(--success-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: 6px;
}

.plan-features {
    margin-top: 14px;
    list-style: none;
}

.plan-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   CHURN ALERT CARDS
   ============================================================ */
.churn-card {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    border-left: 4px solid;
    background: var(--white);
}

.churn-card.high   { border-color: var(--danger);  background: var(--danger-light); }
.churn-card.medium { border-color: var(--warning);  background: var(--warning-light); }
.churn-card.low    { border-color: var(--info);     background: var(--info-light); }

.churn-card .churn-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.churn-card .churn-reason {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================================
   REFERRAL
   ============================================================ */
.referral-code-box {
    background: var(--primary-light);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.referral-code {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 3px;
    font-family: monospace;
    margin: 8px 0;
}

.referral-code-box .code-label {
    font-size: 12px;
    color: var(--primary-mid);
    font-weight: 500;
}

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.rank-1 { background: #FEF3C7; color: #92400E; font-size: 18px; }
.rank-2 { background: #F1F5F9; color: #475569; }
.rank-3 { background: #FEF3C7; color: #B45309; }
.rank-other { background: var(--gray-100); color: var(--gray-600); font-size: 13px; }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   SETTINGS LIST
   ============================================================ */
.settings-section {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row:active {
    background: var(--gray-50);
}

.settings-row .row-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.settings-row .row-texts {
    flex: 1;
}

.settings-row .row-name {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.settings-row .row-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.settings-row .row-value {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-item {
    flex-shrink: 0;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50%       { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position: 200% 0; }
}

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

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

.fade-in    { animation: fadeIn 0.3s ease forwards; }
.slide-up   { animation: slideUp 0.3s ease forwards; }

/* ============================================================
   SCROLLBAR (WebKit)
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-banner {
    position: fixed;
    bottom: calc(var(--nav-height) + 8px);
    left: 16px;
    right: 16px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 400;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

.pwa-banner .pwa-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.pwa-banner .pwa-text {
    flex: 1;
}

.pwa-banner .pwa-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-banner .pwa-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE (Desktop / Tablet fallback)
   ============================================================ */
@media (min-width: 540px) {
    body {
        background: var(--gray-200);
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        border: 1px solid var(--border);
        border-bottom: none;
    }

    .top-header {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .flash-msg {
        min-width: 280px;
    }

    .page-wrapper {
        padding: 16px 0;
    }
}

/* ============================================================
   PRINT (Bill PDF preview)
   ============================================================ */
@media print {
    body {
        background: white;
        padding: 0;
    }
    .bottom-nav, .top-header, .btn, .no-print {
        display: none !important;
    }
}
