/* MezuSmart Professional - Modern Design System */

/* ============================================================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================================================ */

:root {
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-glow: rgba(59, 130, 246, 0.3);

    /* Accent Colors */
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --purple: #8b5cf6;

    /* Neutral Colors */
    --white: #ffffff;
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-primary: #0f172a;
    --text-secondary: #334155; /* Darker slate-700 for excellent readability */
    --text-muted: #576574;     /* Darker grey-slate for perfect readability on white/light backgrounds */
    --border: rgba(0, 0, 0, 0.08);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================================================
   BASE & RESET
   ============================================================================ */

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

html,
body {
    height: 100%;
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--gradient-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100dvh;
}

/* ============================================================================
   SCREENS
   ============================================================================ */

.screen {
    display: none;
    min-height: 100dvh;
}

.screen:not(.active) {
    display: none !important;
}

.screen.active {
    display: flex;
}

.center-layout {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Kinetic scrolling on iOS */
}

.center-layout > * {
    margin: auto; /* Clean vertical/horizontal centering with overflow support */
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */

#loadingScreen {
    background: var(--gradient-primary);
}

.loader-content {
    text-align: center;
}

.app-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   LOGIN SCREEN
   ============================================================================ */

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card .app-logo {
    width: 100px;
    height: 100px;
}

.login-card h1 {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 16px 48px 16px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--white);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.input-modern {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    margin-bottom: 12px;
    transition: var(--transition-fast);
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
}

.input-with-currency {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    margin-bottom: 12px;
}

.input-with-currency .input-modern {
    margin-bottom: 0;
    flex: 1;
}

.currency-select {
    width: 80px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary);
}

.error-msg {
    color: var(--danger);
    font-size: 0.875rem;
    min-height: 20px;
    margin-bottom: 8px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 16px;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.btn-link strong {
    color: var(--primary);
}

.hidden {
    display: none !important;
}

/* ============================================================================
   TOP BAR
   ============================================================================ */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    background: var(--gradient-primary);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-info span {
    font-weight: 600;
}

.icon-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

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

.btn-icon.danger:hover {
    color: var(--danger-light);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================================================
   SIDE MENU
   ============================================================================ */

.menu-overlay {
    display: none;
    pointer-events: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 200;
}

.menu-overlay.active {
    display: flex;
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.side-menu {
    display: none;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    transition: var(--transition-normal);
    z-index: 201;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Kinetic scrolling on iOS */
}

.side-menu.active {
    display: block;
    visibility: visible;
    pointer-events: auto;
    right: 0;
}

.menu-header {
    padding: 24px;
    background: var(--gradient-primary);
    color: var(--white);
}

.menu-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.menu-header p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Show menu elements when app screen is active - Removed to fix mobile click interception bug */

.menu-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: right;
}

.menu-item:hover,
.menu-item.active {
    background: var(--bg-secondary);
    color: var(--primary);
}

.menu-item i {
    width: 24px;
    color: #404040;
    font-size: 1.1rem;
}

.menu-item span {
    color: #1a1a1a;
    font-weight: 600;
}

.menu-item:hover i,
.menu-item.active i {
    color: var(--primary);
}

.menu-item:hover span,
.menu-item.active span {
    color: var(--primary);
}

.whatsapp-icon-circle {
    background: #25D366;
    color: white !important;
    width: 32px !important;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* ============================================================================
   CONTENT AREA
   ============================================================================ */

.content-area {
    flex: 1;
    padding: 20px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 16px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Kinetic scrolling on iOS */
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.view-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ============================================================================
   STATS GRID
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid.small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.1;
    transform: translate(-30%, -30%);
}

.stat-card.blue::before {
    background: var(--primary);
}

.stat-card.gold::before {
    background: var(--gold);
}

.stat-card.green::before {
    background: var(--success);
}

.stat-card.purple::before {
    background: var(--purple);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card .icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-card.blue .icon {
    color: var(--primary);
}

.stat-card.gold .icon {
    color: var(--gold);
}

.stat-card.green .icon {
    color: var(--success);
}

.stat-card.purple .icon {
    color: var(--purple);
}

.stat-card.danger .icon {
    color: var(--danger);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

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

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.chart-card {
    height: 300px;
}

.chart-card canvas {
    max-height: 240px;
}

/* ============================================================================
   LISTS
   ============================================================================ */

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 4px solid transparent;
}

.list-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.list-item.small {
    padding: 12px;
}

.list-item.overdue {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}
.list-item.overdue h4 {
    color: #991b1b !important;
}
.list-item.overdue p {
    color: #b91c1c !important;
}

.list-item.upcoming {
    border-left-color: var(--gold);
    background: rgba(245, 158, 11, 0.05);
}
.list-item.upcoming h4 {
    color: #92400e !important;
}
.list-item.upcoming p {
    color: #b45309 !important;
}

.list-item.future {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.03);
}
.list-item.future h4 {
    color: #065f46 !important;
}
.list-item.future p {
    color: #047857 !important;
}

.list-item h4 {
    color: var(--text-primary);
}

.list-item p {
    color: var(--text-secondary);
}

.list-item.low-stock {
    border-left-color: var(--danger);
}

.item-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.item-info .status {
    font-weight: 600;
    margin-top: 4px;
}

.item-info .stock.danger {
    color: var(--danger);
}

.item-info .stock.success {
    color: var(--success);
}

.item-price {
    text-align: right;
}

.item-price .price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.item-price .cost {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.serial {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-text {
    color: var(--text-muted);
    font-style: italic;
    padding: 16px 0;
}

/* ============================================================================
   SEARCH
   ============================================================================ */

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 14px 14px 14px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================================================
   PERIOD SELECTOR
   ============================================================================ */

.period-selector {
    margin-bottom: 20px;
}

.period-selector select {
    width: 100%;
    max-width: 200px;
}

/* ============================================================================
   TABS
   ============================================================================ */

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

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

/* ============================================================================
   PREMIUM & BADGES
   ============================================================================ */

.badge-plan {
    background: var(--gradient-gold);
    color: var(--white);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* ============================================================================
   SERVICE PROVIDERS - PREMIUM DESIGN
   ============================================================================ */

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.provider-card-premium {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
}

.provider-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.provider-header-premium {
    padding: 20px;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
    border-bottom: 1px solid var(--border);
}

.provider-header-premium h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.provider-body-premium {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.provider-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.provider-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.provider-info-row i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.provider-info-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.provider-info-row a:hover {
    text-decoration: underline;
}

.approval-notice-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
}

.approval-notice-box i {
    color: var(--gold);
    font-size: 1.2rem;
    margin-top: 2px;
}

.approval-notice-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.badge-plan {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border);
}

.badge-plan.premium {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border: none;
    box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
}

/* Premium Modal */
.modal-sheet.premium {
    border-top: 5px solid var(--gold);
}

.modal-header.center {
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding-bottom: 16px;
}

.premium-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 6px rgba(245, 158, 11, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.highlight-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 16px 0;
}

.price-box {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin: 24px 0;
    border: 2px solid var(--gold);
    background: linear-gradient(to bottom right, #fffbf0, #fff);
}

.price-box .amount {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.price-box .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-bit {
    width: 100%;
    padding: 16px;
    background: #00b9ff;
    /* Bit Blue */
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 185, 255, 0.3);
    transition: transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

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

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 100;
    height: auto;
    min-height: 60px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-item i {
    font-size: 1.25rem;
}

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

.nav-fab-wrapper {
    position: relative;
    top: -20px;
}

.nav-fab {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.nav-fab:hover {
    transform: scale(1.1);
}

/* ============================================================================
   FAB BUTTONS
   ============================================================================ */

.fab-float {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--gradient-success);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-float:hover {
    transform: scale(1.1);
}

.fab-float.green {
    background: var(--gradient-success);
}

.fab-float.blue {
    background: var(--gradient-primary);
}

.fab {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 300;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-sheet {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Kinetic scrolling on iOS */
    transform: translateY(100%);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
    /* Prevent scrolling parent */
}

.modal-sheet form {
    padding-bottom: 40px;
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-sheet.large {
    max-height: 95vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--border);
}

.modal-content-scroll {
    flex: 1;
    /* Allow taking available space */
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Critical for iOS smooth scroll */
    margin-bottom: 16px;
    padding: 2px;
}

.modal-content-scroll iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: var(--radius-md);
}

/* ============================================================================
   PROFILE
   ============================================================================ */

.profile-info {
    margin-bottom: 20px;
}

.profile-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--text-secondary);
}

.profile-info i {
    width: 20px;
    color: var(--text-muted);
}

.btn-whatsapp {
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.btn-whatsapp:hover {
    background: #128C7E;
}

.btn-whatsapp-small {
    padding: 10px 16px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-whatsapp-small:hover {
    background: #128C7E;
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: #25D366;
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
}

#customerProfileModal h4 {
    margin: 20px 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================================
   SERIAL NUMBER DISPLAY
   ============================================================================ */

.serial-number {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.serial-number strong {
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--primary);
}

/* ============================================================================
   TOAST
   ============================================================================ */

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-primary);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: var(--transition-normal);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-info {
    background: var(--primary);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .content-area {
        padding: 32px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .bottom-nav {
        display: none;
    }

    .fab-float {
        bottom: 32px;
    }

    .modal-sheet {
        border-radius: var(--radius-xl);
        margin: auto;
    }

    .list-item:hover {
        transform: translateX(8px);
    }
}

/* Desktop Sidebar Layout (>= 1024px) */
@media (min-width: 1024px) {
    .top-bar {
        margin-right: 280px;
        width: calc(100% - 280px);
    }

    .content-area {
        margin-right: 280px;
        width: calc(100% - 280px);
        padding-bottom: 40px; /* No bottom nav, so standard padding is fine */
    }

    #menuBtn {
        display: none !important;
    }

    .menu-overlay {
        display: none !important;
    }

    .side-menu {
        right: 0 !important;
        left: auto !important;
        position: fixed !important;
        width: 280px !important;
        height: 100vh !important;
        box-shadow: none !important;
        border-left: 1px solid var(--border) !important;
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .content-area {
        padding: 16px;
    }
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

select.input-modern {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-left: 40px;
}

textarea.input-modern {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================================
   PRINT
   ============================================================================ */

/* ============================================================================
   FOOTER CREDIT
   ============================================================================ */

.app-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.7;
    margin-top: auto;
    letter-spacing: 0.5px;
}

/* ============================================================================
   SERVICE PROVIDERS
   ============================================================================ */

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.provider-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.provider-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.provider-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.category-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    margin-right: 8px;
}

.provider-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.provider-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    flex: 1;
}

.provider-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.provider-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Checkbox Container Styling */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-container:hover {
    background: rgba(0, 0, 0, 0.03);
}

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


.provider-details i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

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

.provider-details a:hover {
    text-decoration: underline;
}

.provider-pending {
    border-left: 4px solid var(--gold);
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), transparent);
}

/* iOS Scroll Fix */
body.modal-open {
    overflow: hidden;
}

@media print {

    /* ... existing print styles ... */
    .top-bar,
    .bottom-nav,
    .side-menu,
    .fab-float,
    .modal-overlay {
        display: none !important;
    }

    .content-area {
        padding: 0;
    }
}

/* ============================================================================
   קשר סופר - SCRIBE-MERCHANT CONNECT SYSTEM
   ============================================================================ */

/* --- Entry Portal (Mode selector) --- */
.ks-portal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
}

.ks-portal-title {
    text-align: center;
    margin-bottom: 10px;
}

.ks-portal-title h2 {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6 0%, #f59e0b 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.ks-portal-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ks-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 500px;
}

.ks-mode-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ks-mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ks-mode-card.merchant::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
}

.ks-mode-card.scribe::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
}

.ks-mode-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.ks-mode-card:hover::before {
    opacity: 1;
}

.ks-mode-card.merchant:hover {
    border-color: var(--primary);
}

.ks-mode-card.scribe:hover {
    border-color: var(--gold);
}

.ks-mode-icon {
    font-size: 2.8rem;
    margin-bottom: 14px;
    display: block;
}

.ks-mode-card.merchant .ks-mode-icon {
    color: var(--primary);
}

.ks-mode-card.scribe .ks-mode-icon {
    color: var(--gold);
}

.ks-mode-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.ks-mode-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- Section Headers --- */
.ks-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ks-back-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.ks-back-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.ks-section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* --- Merchant Tabs --- */
.ks-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

.ks-tab-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
}

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

/* --- Scribe Cards (merchant tracking table) --- */
.ks-scribe-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition-fast);
}

.ks-scribe-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

.ks-scribe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ks-scribe-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ks-scribe-username {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ks-scribe-total-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
}

.ks-scribe-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.ks-stat-mini {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
}

.ks-stat-mini .val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.ks-stat-mini .lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

.ks-btn-sm {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

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

.ks-btn-sm.gold {
    background: var(--gradient-gold);
    color: white;
}

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

.ks-btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* --- Pricing Grid --- */
.ks-pricing-grid {
    display: grid;
    gap: 10px;
}

.ks-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.ks-price-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ks-price-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ks-price-input {
    width: 90px;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    text-align: center;
    transition: var(--transition-fast);
}

.ks-price-input:focus {
    outline: none;
    border-color: var(--primary);
}

.ks-currency-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
}

/* --- Scribe Login --- */
.ks-scribe-login {
    max-width: 440px;
    margin: 0 auto;
}

.ks-login-hero {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 60%, #f59e0b 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    color: white;
}

.ks-login-hero i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.9;
}

.ks-login-hero h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.ks-login-hero p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- Scribe Dashboard --- */
.ks-earnings-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    color: white;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.ks-earnings-hero::before {
    content: '✦';
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 8rem;
    opacity: 0.05;
    color: var(--gold);
}

.ks-earnings-hero::after {
    content: '✦';
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 6rem;
    opacity: 0.05;
    color: white;
}

.ks-earnings-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ks-earnings-amount {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.4);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ks-earnings-sub {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* --- Work Report Form --- */
.ks-report-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--gold);
}

.ks-report-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ks-report-card h3 i {
    color: var(--gold);
}

.ks-work-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ks-work-type-btn {
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.ks-work-type-btn:hover,
.ks-work-type-btn.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

.ks-work-type-btn .rate-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gold);
    margin-top: 3px;
    font-weight: 700;
}

.ks-quantity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ks-qty-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

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

.ks-qty-display {
    flex: 1;
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}

/* --- Price Table (Scribe side) --- */
.ks-price-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.ks-price-table-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ks-price-table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-fast);
}

.ks-price-table-row:last-child {
    border-bottom: none;
}

.ks-price-table-row:hover {
    background: var(--bg-secondary);
}

.ks-price-table-row .name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ks-price-table-row .price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
}

/* --- Work Log History --- */
.ks-log-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--success);
}

.ks-log-info .type {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ks-log-info .meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.ks-log-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
}

/* --- Approve payment button --- */
.ks-approve-payment-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ks-approve-payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* --- Badge for pending logs --- */
.ks-pending-badge {
    background: var(--gold);
    color: white;
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 6px;
}

/* --- Empty State --- */
.ks-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.ks-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
    display: block;
}

.ks-empty p {
    font-size: 0.9rem;
}

/* --- Logout link --- */
.ks-logout-row {
    text-align: center;
    margin-top: 20px;
}

.ks-logout-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.ks-logout-link:hover {
    color: var(--danger);
}

/* --- Add Scribe Form --- */
.ks-add-scribe-form {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

/* --- Responsive: on small screens --- */
@media (max-width: 380px) {
    .ks-mode-cards {
        grid-template-columns: 1fr;
    }

    .ks-work-type-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== SCRIBE MOTIVATION (קנאת סופרים) ==================== */
.ks-motivation-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.ks-motivation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ks-motivation-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ks-timer-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    color: var(--primary);
    margin: 20px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--primary-glow);
}

.ks-timer-modes.grid-2-col {
    grid-template-columns: repeat(2, 1fr);
}

.ks-mode-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 50px;
}

.ks-mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-glow);
}

.ks-timer-controls-v2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.ks-action-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ks-action-btn.start { 
    background: var(--gradient-success); 
    color: white; 
}

.ks-action-btn.pause { 
    background: var(--gradient-gold); 
    color: white; 
}

.ks-action-btn.finish { 
    background: var(--gradient-primary); 
    color: white; 
}

.ks-action-btn:hover:not(:disabled) { 
    transform: translateY(-3px) scale(1.02); 
    box-shadow: var(--shadow-xl);
    filter: brightness(1.1);
}

.ks-action-btn:active:not(:disabled) { 
    transform: translateY(0) scale(0.98); 
}

.ks-action-btn:disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
    filter: grayscale(0.5);
    box-shadow: none;
}

.ks-tip-box {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    min-height: 80px;
    display: flex;
    align-items: center;
}

/* --- Animated Quill SVG --- */
.ks-quill-container {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0.2;
    transition: var(--transition-slow);
}

.ks-quill-container.active {
    opacity: 1;
    animation: quill-dance 2s ease-in-out infinite;
}

@keyframes quill-dance {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2px, -5px) rotate(5deg); }
    50% { transform: translate(0, -2px) rotate(-3deg); }
    75% { transform: translate(-2px, -4px) rotate(2deg); }
}

#ksQuillSvg {
    width: 100%;
    height: 100%;
}

/* --- Scribe Stats Redesign --- */
.ks-stats-modal .modal-sheet {
    max-width: 500px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.ks-stats-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.ks-stats-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.ks-summary-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ks-summary-card.money {
    border-top: 4px solid var(--success);
}

.ks-summary-card.time {
    border-top: 4px solid var(--primary);
}

.ks-summary-card .val {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
}

.ks-summary-card .lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.ks-stats-subtitle {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ks-stats-breakdown-list {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.ks-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

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

.ks-breakdown-row:hover {
    background: #f1f5f9;
}

.ks-breakdown-row .item-info {
    display: flex;
    flex-direction: column;
}

.ks-breakdown-row .item-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ks-breakdown-row .item-count {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 800;
}

.ks-breakdown-row .item-count::before {
    content: 'סה"כ: ';
    font-weight: 400;
    color: var(--text-muted);
}

.ks-breakdown-row .item-actions {
    display: flex;
    gap: 10px;
}

.ks-mini-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.ks-mini-btn.plus {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}
.ks-mini-btn.plus:hover {
    background: #16a34a;
    color: white;
    transform: scale(1.1);
}

.ks-mini-btn.minus {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}
.ks-mini-btn.minus:hover:not(:disabled) {
    background: #dc2626;
    color: white;
    transform: scale(1.1);
}
.ks-mini-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}