/* ========================================================
   Poojan Receipt - Modern SaaS Design System (Mobile-First)
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: "Trebuchet MS";
    src: url("../fonts/Trebuchet%20MS.ttf") format("truetype"),
         url("../fonts/Trebuchet MS.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --primary-dark: #1E40AF;

    --success: #059669;
    --success-light: #ECFDF5;
    --success-border: #A7F3D0;

    --warning: #D97706;
    --warning-light: #FFFBEB;
    --warning-border: #FDE68A;

    --danger: #DC2626;
    --danger-light: #FEF2F2;

    --bg-page: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-muted: #F1F5F9;
    --bg-input: #F8FAFC;

    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    --border: #E2E8F0;
    --border-hover: #CBD5E1;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08);

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

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Centered Shell for Mobile Web */
.app-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 14px 100px;
    position: relative;
}

@media (min-width: 480px) {
    .app-container {
        padding: 16px 20px 100px;
    }
}

/* Header & Brand Bar */
.app-header {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Top Segmented Tabs */
.tab-switcher {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.tab-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.tab-btn.active .tab-badge {
    background: var(--primary-light);
    color: var(--primary);
}

/* Year & Quarter Selector Banner */
.quarter-selector-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

.year-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.year-nav h2 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.year-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.year-arrow {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.year-arrow:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.year-val {
    font-weight: 700;
    font-size: 14px;
    min-width: 44px;
    text-align: center;
    color: var(--primary-dark);
}

.quarter-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.quarter-pill {
    padding: 8px 4px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.quarter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.quarter-pill .pill-sub {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.85;
}

/* KPI Summary Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}

.kpi-title {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-value.green {
    color: var(--success);
}

.kpi-value.amber {
    color: var(--warning);
}

.kpi-value.blue {
    color: var(--primary);
}

/* Progress Bar */
.progress-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-track {
    width: 100%;
    height: 7px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #059669);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* Filter Chips Row */
.filter-chips-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-chip.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* Member & Receipt Cards */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 13px 15px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.item-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.item-card.paid {
    border-left: 4px solid var(--success);
}

.item-card.remain {
    border-left: 4px solid var(--warning);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.badge.receipt-no {
    background: #EFF6FF;
    color: #1D4ED8;
}

.badge.flat-pill {
    background: #F3E8FF;
    color: #7E22CE;
}

.badge.status-paid {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge.status-remain {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.card-middle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.member-details {
    flex: 1;
    min-width: 0;
}

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

.member-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--bg-muted);
}

.price-tag {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--success);
}

.action-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-muted);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.action-btn-sm:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

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

.action-btn-sm.primary:hover {
    background: var(--primary-hover);
}

/* Live Search Bar */
.search-bar-wrap {
    margin-bottom: 12px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 38px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

/* Floating Action Button */
.fab-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    z-index: 99;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fab-btn:hover {
    background: var(--primary-hover);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45);
}

/* Modal Windows */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 480px) {
    .modal-overlay {
        padding: 20px;
    }
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

.modal-box form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

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

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: var(--bg-surface);
    flex-shrink: 0;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 14px;
}

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

.form-label .required {
    color: var(--danger);
    font-weight: 700;
}

.form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.receipt-no-row {
    display: flex;
    gap: 8px;
}

.stepper-btn {
    width: 44px;
    height: 46px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.auto-badge-strip {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
}

.auto-badge-strip.custom {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #B45309;
}

.btn-reset-auto {
    background: white;
    border: 1px solid #FCD34D;
    color: #B45309;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
}

.quick-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.amount-chip {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-chip:hover, .amount-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-submit {
    width: 100%;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

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

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

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

.empty-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Exact Flutter Old PDF Format Receipt */
.receipt-old-format {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    font-family: "Trebuchet MS", sans-serif;
    color: #111;
    box-sizing: border-box;
}

.receipt-old-format * {
    font-family: "Trebuchet MS", sans-serif;
    box-sizing: border-box;
}

.receipt-s1 {
    width: 100%;
    border-collapse: collapse;
}

.receipt-title-cell {
    font-size: 18pt;
    font-weight: bold;
    color: #111;
    vertical-align: middle;
}

.receipt-logo-cell {
    text-align: right;
    padding: 4px 0;
}

.receipt-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: inline-block;
}

.receipt-divider-tr {
    border-top: 2.5px solid #222;
}

.receipt-divider-tr td {
    padding-bottom: 8px;
}

.receipt-s2 {
    font-size: 11pt;
    line-height: 1.6;
    color: #222;
}

.receipt-s3 {
    font-size: 8pt;
    color: #555;
    line-height: 1.4;
    padding-top: 6px;
}

.receipt-s4 {
    font-size: 9.5pt;
    line-height: 1.5;
    color: #222;
}

#modal-view-receipt .modal-body {
    padding: 12px 6px;
}

.receipt-print-wrapper {
    background: #ffffff;
    box-sizing: border-box;
    padding: 10px 10px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.receipt-print-wrapper * {
    font-family: "Trebuchet MS", sans-serif;
    box-sizing: border-box;
}

.s1 {
    font-size: 19pt;
    font-weight: normal;
}

.s2 {
    font-size: 11pt;
}

.s3 {
    font-size: 7pt;
}

.s4 {
    font-size: 8pt;
}

.s5 {
    font-size: 9pt;
    font-weight: bolder;
}

.receipt-print-wrapper table {
    border-collapse: collapse;
    width: 100%;
    table-layout: auto;
    box-sizing: border-box;
    page-break-inside: avoid !important;
}

.receipt-print-wrapper th,
.receipt-print-wrapper td {
    padding: 2px 4px;
    box-sizing: border-box;
}

#t2, #t2 td, #t2 th {
    border: 1px solid #000;
    padding: 5px;
    box-sizing: border-box;
}

#t2 th {
    text-align: center;
    font-weight: bold;
}

#t2 tbody {
    vertical-align: top;
}

#t2 tbody tr.desc-row,
#t2 tbody tr:first-child {
    height: 12em;
    vertical-align: top;
}

#t3 {
    text-align: center;
    width: 100%;
    margin-top: 4px;
}

#t3 pre {
    margin: 2px 0 0 0;
    font-family: "Trebuchet MS", sans-serif;
    font-size: 8pt;
    white-space: normal;
}

/* ========================================================
   Header User Pill & Logout Button
   ======================================================== */
.user-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.15);
    white-space: nowrap;
}

.user-avatar-icon {
    font-size: 13px;
    line-height: 1;
}

.user-display-name {
    letter-spacing: 0.2px;
}

.btn-logout {
    background: #FEE2E2 !important;
    border-color: #FECACA !important;
    color: #DC2626 !important;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: #FCA5A5 !important;
    color: #991B1B !important;
    transform: translateY(-1px);
}

/* ========================================================
   Login Page Styling (Mobile-First & Ultra-Modern)
   ======================================================== */
.login-body {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    margin: auto;
}

.ambient-glow {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
}

.glow-top {
    top: -80px;
    right: -80px;
    background: radial-gradient(circle, #2563EB 0%, rgba(37, 99, 235, 0) 70%);
}

.glow-bottom {
    bottom: -80px;
    left: -80px;
    background: radial-gradient(circle, #059669 0%, rgba(5, 150, 105, 0) 70%);
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 28px 24px;
    animation: loginFadeIn 0.4s ease-out;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.login-logo-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--border);
    padding: 6px;
}

.login-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 3px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.login-badge {
    display: inline-block;
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.login-alert {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.login-alert.show {
    display: flex;
}

.login-alert.error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.login-alert.success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.login-alert.shake {
    animation: shakeAlert 0.4s ease-in-out;
}

@keyframes shakeAlert {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}

.login-input {
    padding-left: 40px !important;
    height: 46px;
    font-size: 14.5px;
    background: #F8FAFC;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.login-input:focus {
    background: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.password-input-wrap .login-input {
    padding-right: 44px !important;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 18px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.btn-toggle-password:hover {
    opacity: 0.8;
}

.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 12.5px;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn-login-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.btn-login-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.btn-login-submit:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-login-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FFFFFF;
    animation: spin 0.7s linear infinite;
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.login-copyright {
    margin-top: 3px;
    font-size: 10.5px;
    color: #94A3B8;
}

/* Print Mode Only Styles: Guaranteed Strictly 1 Single Page Receipt */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 4mm;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Strictly hide all other page elements and modals */
    .app-container,
    .login-wrapper,
    .ambient-glow,
    #modal-create-receipt,
    #modal-member-manage,
    .modal-overlay:not(#modal-view-receipt),
    .modal-header,
    .modal-footer,
    .modal-close,
    .fab-btn,
    .tab-switcher,
    .search-bar-wrap,
    iframe {
        display: none !important;
    }

    /* Modal view receipt wrapper - Only container visible */
    #modal-view-receipt {
        display: block !important;
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
    }

    #modal-view-receipt .modal-box {
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        background: transparent !important;
        overflow: visible !important;
        border-radius: 0 !important;
        animation: none !important;
    }

    #modal-view-receipt .modal-body {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    /* Receipt card styling - strictly 1 page with low horizontal margins for maximum width */
    .receipt-print-wrapper,
    #printable-receipt-card {
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
        border: none !important;
        padding: 4px 6px !important;
        margin: 0 auto !important;
        background: #ffffff !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        break-inside: avoid !important;
        break-after: avoid !important;
        break-before: avoid !important;
    }

    table, tr, td, th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    #t2 tbody tr.desc-row,
    #t2 tbody tr:first-child {
        height: 12em !important;
        vertical-align: top !important;
    }
}

