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

/* Clean Professional Light Mode Theme Variables */
:root {
    --bg-app: #f1f5f9;         /* Slate 100 - Page background on desktop */
    --bg-phone: #f8fafc;       /* Slate 50 - Phone screen background */
    --bg-card: #ffffff;        /* Crisp White cards */
    --bg-input: #f8fafc;       /* Subtle white-blue input fields */
    --border-color: #e2e8f0;   /* Slate 200 borders */
    
    /* Typography & Text */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --text-primary: #0f172a;   /* Slate 900 - Deep navy/black */
    --text-secondary: #475569; /* Slate 600 - Slate body text */
    --text-muted: #94a3b8;     /* Slate 400 - Muted label text */
    
    /* Accent & Status Colors */
    --primary: #1e3a8a;        /* Navy blue primary */
    --primary-light: #2563eb;  /* Strong blue action accent */
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --accent: #4f46e5;         /* Indigo accent */
    --success: #10b981;        /* Emerald Green - Collected */
    --success-light: #ecfdf5;  /* Light green bg */
    --warning: #f59e0b;        /* Amber Yellow - Pending */
    --warning-light: #fffbeb;  /* Light yellow bg */
    --danger: #ef4444;         /* Rose Red - Overdue */
    --danger-light: #fef2f2;   /* Light red bg */
    
    /* Heights & Offsets */
    --header-height: 56px;
    --nav-height: 64px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Desktop Frame Container for Mobile Simulation */
.desktop-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.device-toggle-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, background-color 0.2s;
}

.device-toggle-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.phone-container {
    width: 390px;
    height: 844px; /* iPhone 12/13/14 size */
    background-color: var(--bg-phone);
    border-radius: 40px;
    border: 12px solid #0f172a; /* Bezel */
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 25px 50px -12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease, border-width 0.3s ease;
}

/* Toggle Fullscreen mode on PC */
.phone-container.fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
}

/* Status Bar Mockup */
.status-bar {
    height: 28px;
    background-color: var(--bg-phone);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

.status-bar .icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* App Core Shell Layout */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-phone);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text-primary);
}

.header-btn:active {
    background-color: var(--border-color);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

/* Main View Controller Container */
.views-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Single View Panel styling */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-phone);
    display: none;
    flex-direction: column;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding-bottom: 24px;
}

.view.active {
    display: flex;
}

/* Premium Navigation Slide Animations */
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-right { animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) both; }
.slide-out-left { animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) both; }
.slide-in-left { animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) both; }
.slide-out-right { animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) both; }
.fade-in { animation: fadeIn 0.3s ease both; }

/* Bottom Navigation Bar */
.bottom-nav {
    height: var(--nav-height);
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 4px;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    flex: 1;
    height: 100%;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s;
}

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

.nav-item.active svg {
    transform: translateY(-2px);
    stroke: var(--primary-light);
}

/* ==========================================================================
   VIEW: LOGIN
   ========================================================================== */
#login-view {
    padding: 32px 24px;
    display: none;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 20px;
}

.login-logo {
    width: 68px;
    height: 68px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.login-logo svg {
    width: 36px;
    height: 36px;
    color: white;
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-control {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-family);
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.btn {
    width: 100%;
    padding: 15px;
    border-radius: var(--border-radius);
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.biometric-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 36px;
    cursor: pointer;
}

.biometric-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s;
}

.biometric-icon:active {
    background-color: var(--border-color);
}

.biometric-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==========================================================================
   VIEW: DASHBOARD
   ========================================================================== */
.officer-banner {
    background-color: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.officer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.welcome-msg {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.officer-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.officer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
}

.dashboard-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Dynamic Charts and Target Section */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.target-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.target-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.target-info {
    flex: 1;
}

.target-title {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.target-amount {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 12px;
}

.progress-summary {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

.chart-circle-container {
    width: 80px;
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-circle-svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.chart-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 6;
}

.chart-circle-progress {
    fill: none;
    stroke: #10b981; /* Emerald */
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 220; /* Circumference of r=35 */
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-percentage {
    position: absolute;
    font-size: 15px;
    font-weight: 700;
    color: white;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.stat-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.collected {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-icon.pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Quick Actions Scroll */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-link {
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 600;
    cursor: pointer;
}

.quick-actions-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.quick-actions-row::-webkit-scrollbar {
    display: none;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    min-width: 96px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.action-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-phone);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

.action-btn-icon svg {
    width: 20px;
    height: 20px;
}

.action-btn-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Weekly Progress Bar Chart */
.bar-chart-container {
    height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 10px;
    margin-top: 8px;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.bar-track {
    width: 16px;
    height: 80px;
    background-color: var(--bg-phone);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    background-color: var(--primary-light);
    border-radius: 8px;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: height 0.6s ease-in-out;
}

.bar-fill.highlight {
    background: var(--success);
}

.bar-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Active route card list */
.tasks-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-task-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.2s;
}

.preview-task-card:active {
    border-color: var(--primary-light);
}

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

.task-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: var(--primary-light);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.task-distance {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-distance svg {
    width: 12px;
    height: 12px;
    stroke: var(--text-muted);
}

.task-amount-badge {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-badge-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--danger);
}

.task-badge-label {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   VIEW: TASKS (LIST)
   ========================================================================== */
.search-filter-sticky {
    background-color: var(--bg-card);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-phone);
    outline: none;
    font-size: 14px;
    font-family: var(--font-family);
}

.search-box svg {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.tabs-row {
    display: flex;
    background-color: var(--bg-phone);
    border-radius: 10px;
    padding: 3px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    border: none;
    background: none;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tab-btn.active {
    background-color: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tasks-list-scroll {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-full-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.task-full-card:active {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.customer-card-info {
    display: flex;
    gap: 12px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.card-middle-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    background-color: var(--bg-phone);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.middle-stat-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.middle-stat-col.border-right {
    border-right: 1px solid var(--border-color);
}

.middle-label {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.middle-value {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.task-tag-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   VIEW: CUSTOMER DETAIL
   ========================================================================== */
.detail-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 24px 20px;
    position: relative;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.detail-hero-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    border: 2px solid white;
    color: white;
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-name-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-name {
    font-size: 18px;
    font-weight: 700;
}

.detail-id {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.contact-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.contact-btn {
    flex: 1;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background-color: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.contact-btn:active {
    background-color: rgba(255,255,255,0.3);
}

.contact-btn svg {
    width: 16px;
    height: 16px;
}

.detail-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 12px;
}

.detail-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-value.danger-alert {
    color: var(--danger);
}

.ledger-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
}

.ledger-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.ledger-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ledger-item:first-of-type {
    padding-top: 0;
}

.ledger-date-type {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ledger-date {
    font-weight: 700;
    color: var(--text-primary);
}

.ledger-type {
    color: var(--text-muted);
    font-size: 10px;
}

.ledger-amount {
    font-weight: 700;
    color: var(--success);
}

/* Float Action Button / Bottom Fix Button */
.bottom-cta-container {
    padding: 16px;
    background-color: var(--bg-phone);
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* ==========================================================================
   VIEW: PAYMENT COLLECTION FORM
   ========================================================================== */
.collection-form-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.customer-snippet-card {
    background-color: var(--primary-light);
    color: white;
    padding: 14px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.snippet-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.snippet-name {
    font-size: 14px;
    font-weight: 700;
}

.snippet-loan {
    font-size: 11px;
    opacity: 0.9;
}

.snippet-due {
    text-align: right;
}

.snippet-due-label {
    font-size: 9px;
    opacity: 0.8;
}

.snippet-due-amount {
    font-size: 16px;
    font-weight: 800;
}

/* Signature Pad Area */
.signature-area {
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-card);
    position: relative;
    height: 130px;
    width: 100%;
}

.signature-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    display: block;
}

.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.signature-placeholder svg {
    width: 20px;
    height: 20px;
}

.signature-clear-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.signature-clear-btn:active {
    background: rgba(15, 23, 42, 0.1);
}

/* Picture Upload Mock */
.pic-upload-mock {
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-card);
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.pic-upload-mock svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.pic-upload-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 5;
}

.pic-upload-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(15, 23, 42, 0.6);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: none;
    z-index: 10;
}

/* ==========================================================================
   VIEW: COLLECTION SUCCESS
   ========================================================================== */
#success-view {
    padding: 32px 24px;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-card);
}

.success-icon-box {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--success-light);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.15);
}

.success-icon-box svg {
    width: 38px;
    height: 38px;
}

.success-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

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

.success-receipt-card {
    background-color: var(--bg-phone);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    width: 100%;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.receipt-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.receipt-label {
    color: var(--text-muted);
    font-weight: 500;
}

.receipt-value {
    font-weight: 700;
    color: var(--text-primary);
}

.receipt-value.large {
    font-size: 16px;
    color: var(--success);
}

/* ==========================================================================
   VIEW: COLLECTION HISTORY LOGS
   ========================================================================== */
.history-header-card {
    background-color: var(--primary);
    color: white;
    padding: 16px;
    margin: 16px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-summary-val {
    font-size: 20px;
    font-weight: 800;
}

.history-summary-lbl {
    font-size: 11px;
    opacity: 0.8;
}

.history-divider {
    width: 1px;
    height: 36px;
    background-color: rgba(255,255,255,0.2);
}

.history-list-scroll {
    padding: 0 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.history-time-mode {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-mode-pill {
    padding: 2px 6px;
    background-color: var(--bg-phone);
    border-radius: 4px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-amount-log {
    font-size: 14px;
    font-weight: 800;
    color: var(--success);
}

/* ==========================================================================
   VIEW: PROFILE / SETTINGS
   ========================================================================== */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.profile-avatar-large {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    box-shadow: var(--shadow-md);
}

.profile-role {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.profile-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-list {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background-color: var(--bg-phone);
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item-left svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.menu-item-right svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.menu-item-left.danger-text {
    color: var(--danger);
}

.menu-item-left.danger-text svg {
    color: var(--danger);
}

/* Alert Dialog Overlay */
.alert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s both;
}

.alert-dialog {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    width: 100%;
    max-width: 310px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideInUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

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

.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.alert-icon svg {
    width: 24px;
    height: 24px;
}

.alert-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.alert-dialog-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-actions {
    display: flex;
    gap: 8px;
}

.alert-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.alert-btn-confirm:active {
    background-color: var(--primary-light);
}

.alert-btn-cancel {
    background-color: var(--bg-phone);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.alert-btn-cancel:active {
    background-color: var(--border-color);
}

/* ==========================================================================
   MEDIA QUERY: RESPONSIVE TO MOBILE VIEW OR WEB VIEW FLAT VIEW
   ========================================================================== */
@media (max-width: 500px) {
    body {
        background-color: var(--bg-phone);
        align-items: stretch;
        min-height: 100vh;
    }
    
    .desktop-wrapper {
        width: 100%;
        height: 100vh;
        gap: 0;
    }
    
    #toggle-frame-btn {
        display: none; /* Hide device simulator toolbar on actual phones */
    }
    
    .phone-container {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .status-bar {
        display: none; /* Hide internal phone clock bar in real mobile viewports */
    }
}
