/* ============================================
   CleanMel - Glassmorphism Design System
   Apple iOS Dark Style
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #080816;
    --bg-secondary: #0e0e24;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.45);
    --accent: #0a84ff; /* Apple iOS Dark Blue */
    --accent-light: #64d2ff;
    --success: #30d158; /* Apple iOS Dark Green */
    --warning: #ff9f0a; /* Apple iOS Dark Orange */
    --danger: #ff453a;  /* Apple iOS Dark Red */
    --info: #5ac8fa;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --tab-height: 80px;
}

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

html, body {
    font-family: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
    background: radial-gradient(circle at 50% 50%, #0c0c1e 0%, #030309 100%) no-repeat fixed;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: -15%;
    left: -15%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -2;
    pointer-events: none;
    filter: blur(85px);
}

body::after {
    content: '';
    position: fixed;
    bottom: -15%;
    right: -15%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(175, 82, 222, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: -2;
    pointer-events: none;
    filter: blur(85px);
}


/* ============================================
   Glassmorphism Components
   ============================================ */

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

.glass-sm {
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

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

.btn-primary {
    background: linear-gradient(135deg, #0a84ff 0%, #0056b3 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(10, 132, 255, 0.3) !important;
}

.btn-primary:active {
    box-shadow: 0 2px 6px rgba(10, 132, 255, 0.2) !important;
}

.btn-success {
    background: linear-gradient(135deg, #30d158 0%, #208b3a 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(48, 209, 88, 0.25) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #ff9f0a 0%, #cc7a00 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(255, 159, 10, 0.25) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ff453a 0%, #b31a12 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(255, 69, 58, 0.25) !important;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.07) !important;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
    background: var(--bg-card);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

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

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

.form-control-file {
    position: relative;
}

.form-control-file input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-area:hover,
.file-upload-area.has-files {
    border-color: var(--accent);
    color: var(--accent-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
}

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

.card-title {
    font-size: 17px;
    font-weight: 600;
}

/* ============================================
   Stat Cards
   ============================================ */

.stat-card {
    padding: 20px;
    min-width: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-pending { background: rgba(255, 159, 10, 0.2); color: var(--warning); }
.badge-validated { background: rgba(0, 122, 255, 0.2); color: var(--accent-light); }
.badge-modified { background: rgba(90, 200, 250, 0.2); color: var(--info); }
.badge-paid { background: rgba(52, 199, 89, 0.2); color: var(--success); }

/* ============================================
   Alerts / Flash Messages
   ============================================ */

.flash-messages {
    position: fixed;
    top: calc(16px + var(--safe-top));
    left: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
    pointer-events: none;
}

.flash-message {
    pointer-events: auto;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-message.success { background: rgba(52, 199, 89, 0.9); color: white; }
.flash-message.error { background: rgba(255, 59, 48, 0.9); color: white; }
.flash-message.info { background: rgba(90, 200, 250, 0.9); color: white; }
.flash-message.warning { background: rgba(255, 159, 10, 0.9); color: white; }

/* ============================================
   Page Container
   ============================================ */

.page {
    padding: 16px;
    padding-bottom: calc(var(--tab-height) + 24px + var(--safe-bottom));
    max-width: 600px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: var(--safe-top);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   Bottom Tab Bar (iOS Floating Dock)
   ============================================ */

.tab-bar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 66px;
    background: rgba(14, 14, 28, 0.45);
    backdrop-filter: blur(28px) saturate(1.9);
    -webkit-backdrop-filter: blur(28px) saturate(1.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 33px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    padding: 0 8px;
    transition: all 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.25s ease;
    padding: 6px 0;
    flex: 1;
    border-radius: 20px;
}

.tab-item i {
    font-size: 20px;
    transition: transform 0.2s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.tab-item.active {
    color: var(--accent);
}

.tab-item.active i {
    transform: scale(1.15) translateY(-2px);
    text-shadow: 0 0 10px rgba(10, 132, 255, 0.3);
}

.tab-badge {
    position: absolute;
    top: 6px;
    right: 50%;
    transform: translateX(18px);
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1px solid #080816;
}

/* ============================================
   Bottom Sheet (Menu Plus iOS Style)
   ============================================ */

body.modal-open {
    overflow: hidden;
}

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999;
    display: none;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.active {
    display: flex;
    opacity: 1;
}

.bottom-sheet {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(14, 14, 28, 0.45);
    backdrop-filter: blur(30px) saturate(2.0);
    -webkit-backdrop-filter: blur(30px) saturate(2.0);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    padding: 14px 20px calc(24px + var(--safe-bottom)) 20px;
    z-index: 2000;
}

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

.bottom-sheet-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 22px;
}

.bottom-sheet-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin-bottom: 14px;
}

.bottom-sheet-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.bottom-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}

.sheet-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    padding: 10px 4px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.sheet-grid-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.95);
}

.sheet-grid-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.sheet-grid-item .icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.icon-wrapper.bg-blue { background: linear-gradient(135deg, #0a84ff, #0056b3); }
.icon-wrapper.bg-orange { background: linear-gradient(135deg, #ff9f0a, #cc7a00); }
.icon-wrapper.bg-green { background: linear-gradient(135deg, #30d158, #248a3d); }
.icon-wrapper.bg-purple { background: linear-gradient(135deg, #bf5af2, #7a30a0); }
.icon-wrapper.bg-teal { background: linear-gradient(135deg, #64d2ff, #00a2cc); }
.icon-wrapper.bg-red { background: linear-gradient(135deg, #ff453a, #b31a12); }

.sheet-grid-item.text-danger {
    color: #ff453a;
}


/* ============================================
   Entry List
   ============================================ */

.entry-item {
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
}

.entry-item:active {
    background: var(--bg-card-hover);
}

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

.entry-worker {
    font-weight: 600;
    font-size: 15px;
}

.entry-amount {
    font-size: 17px;
    font-weight: 700;
}

.entry-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.entry-services {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.entry-service-tag {
    background: var(--bg-card);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================
   Checkbox List
   ============================================ */

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 18px 20px !important;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.checkbox-item:active {
    transform: scale(0.97);
}

.checkbox-item:has(input:checked) {
    background: rgba(10, 132, 255, 0.08) !important;
    border-color: rgba(10, 132, 255, 0.35) !important;
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-box {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.checkbox-item input:checked ~ .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(10, 132, 255, 0.5);
}

.checkbox-item input:checked ~ .checkbox-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 13px;
    color: white;
}


.checkbox-label {
    flex: 1;
}

.checkbox-name {
    font-size: 15px;
    font-weight: 500;
}

.checkbox-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.checkbox-price {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

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

.modal-content {
    background: rgba(14, 14, 28, 0.55) !important;
    backdrop-filter: blur(35px) saturate(2.0) !important;
    -webkit-backdrop-filter: blur(35px) saturate(2.0) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 28px 28px 0 0 !important;
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 24px calc(24px + var(--safe-bottom)) 24px;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5) !important;
    animation: slideUp 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    outline: none;
}

.modal-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin: 0 auto 18px;
}

.modal-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
    background: linear-gradient(135deg, #0a0a1a 0%, #16213e 50%, #0a0a1a 100%);
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    overflow: hidden;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.login-form {
    width: 100%;
    max-width: 360px;
}

/* ============================================
   Grid / Stats Grid / Responsive Grid Helpers
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: flex-end;
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Photo Gallery
   ============================================ */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.photo-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-xs);
}

.photo-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    cursor: pointer;
}

/* ============================================
   Notification List
   ============================================ */

.notif-item {
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}

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

.notif-item.unread {
    background: rgba(0, 122, 255, 0.05);
}

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

.notif-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.notif-message {
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* ============================================
   Blocked Page
   ============================================ */

.blocked-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    text-align: center;
}

.blocked-icon {
    font-size: 64px;
    color: var(--danger);
    margin-bottom: 24px;
}

/* ============================================
   Loading / Spinner
   ============================================ */

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}

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

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }

/* ============================================
   Toast Notification
   ============================================ */

.toast {
    position: fixed;
    bottom: calc(var(--tab-height) + 16px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    max-width: 500px;
    margin: 0 auto;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9998;
    display: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideUp 0.3s ease;
}

.toast.show {
    display: block;
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 24px; }
}

@media (min-width: 768px) {
    .page { padding: 32px; padding-bottom: calc(var(--tab-height) + 32px); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }

/* ============================================
   Chart Container
   ============================================ */

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-card {
    padding: 16px !important;
    margin-bottom: 16px !important;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   Service Price Input
   ============================================ */

.price-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.price-input-group .currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================
   Dropdown Menu
   ============================================ */

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.dropdown-menu.active { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover { background: var(--bg-card); }
.dropdown-item.danger { color: var(--danger); }

/* ============================================
   Segmented Control (iOS style switcher)
   ============================================ */

.segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
    gap: 2px;
}

.segmented-control .btn {
    flex: 1;
    background: transparent !important;
    border: none !important;
    border-radius: 9px !important;
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.1, 0.76, 0.55, 0.94) !important;
}

.segmented-control .btn.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   Lightbox Modal (iOS Style Zoom & Download)
   ============================================ */

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 4, 12, 0.95);
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: calc(16px + var(--safe-top, 20px));
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.lightbox-content-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.lightbox-modal.active .lightbox-image {
    transform: scale(1);
}

.lightbox-footer {
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.lightbox-title {
    font-size: 17px;
    font-weight: 700;
}

.lightbox-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.lightbox-download {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 20px;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.lightbox-download:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

/* ============================================
   Service Section Title styling
   ============================================ */

.service-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}

.service-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================
   Validation UI (owner dashboard / entry detail)
   ============================================ */

.validation-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
}

.validation-item-row input[type="number"] {
    width: 80px;
    margin-left: auto;
    text-align: right;
}

.validation-items-list {
    margin: 12px 0;
}

.entry-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
