/* =============================================
   SIMPRO - Design System
   Mobile First Approach
   ============================================= */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =============================================
   CSS Variables
   ============================================= */
:root {
    /* Primary Colors — Natadama Indigo */
    --primary: #4348A6;
    /* medium indigo */
    --primary-light: #6368C4;
    /* bright indigo */
    --primary-dark: #35398A;
    /* deep indigo */
    --primary-50: #EEEEFA;
    /* very light lavender */
    --primary-100: #CACAF2;
    /* light lavender */
    --primary-200: #9EA2E4;
    /* medium lavender */

    /* Accent */
    --accent: #F59E0B;
    --accent-light: #FBBF24;
    --accent-dark: #D97706;

    /* Status Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Neutrals */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Backgrounds */
    --bg-body: #F0F0F8;
    /* very subtle indigo tint */
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.7);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -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);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}


/* =============================================
   Reset & Base
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px;
    /* space for bottom nav */
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =============================================
   Typography
   ============================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

.text-muted {
    color: var(--gray-500);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* =============================================
   Layout
   ============================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.page-content {
    padding: var(--space-md) 0;
    padding-top: 70px;
    /* space for top nav */
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

/* =============================================
   Top Navigation
   ============================================= */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
}

.top-nav .logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.top-nav .logo svg {
    width: 28px;
    height: 28px;
}

.top-nav .nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.top-nav .nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.top-nav .nav-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

.top-nav .notif-badge {
    position: relative;
    color: #fff;
    cursor: pointer;
}

.top-nav .notif-badge .count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   Desktop Top Nav Links
   ============================================= */
.top-nav-links {
    display: none;
    /* hidden on mobile */
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.top-nav-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.top-nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.top-nav-links a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.top-nav-links a.nav-logout {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-left: 8px;
}

.top-nav-links a.nav-logout:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.3);
}

@media (min-width: 768px) {
    .top-nav-links {
        display: flex;
    }
}

/* =============================================
   Bottom Navigation (Mobile)
   ============================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-card);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    border-top: 1px solid var(--gray-200);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--gray-400);
    font-size: 0.65rem;
    font-weight: 500;
    padding: var(--space-sm);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    text-decoration: none;
    min-width: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.bottom-nav a svg {
    width: 22px;
    height: 22px;
    transition: var(--transition-fast);
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--primary);
}

.bottom-nav a.active svg {
    transform: scale(1.1);
}

.bottom-nav a.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

.bottom-nav a {
    position: relative;
}

/* =============================================
   Cards
   ============================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: var(--space-lg);
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card .stat-icon.primary {
    background: var(--primary-100);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card .stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-card .stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-card .stat-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Glass Card */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}

.btn-danger:hover {
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
}

.btn-warning:hover {
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    min-height: 44px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 16px 32px;
    min-height: 56px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-float {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    padding: 0;
    box-shadow: var(--shadow-xl);
    z-index: 900;
    animation: pulse-float 2s infinite;
}

@keyframes pulse-float {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(13, 148, 136, 0.6);
    }
}

/* =============================================
   Forms
   ============================================= */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    min-height: 48px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

/* File Input */
.file-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    padding: var(--space-lg);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.file-upload:hover,
.file-upload.dragover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload svg {
    width: 40px;
    height: 40px;
    color: var(--gray-400);
    margin-bottom: var(--space-sm);
}

.file-upload p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* =============================================
   Progress Bar
   ============================================= */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-red .progress-bar,
.progress-bar.progress-red {
    background: linear-gradient(135deg, var(--danger), #f87171);
}

.progress-yellow .progress-bar,
.progress-bar.progress-yellow {
    background: linear-gradient(135deg, var(--warning), var(--accent-light));
}

.progress-green .progress-bar,
.progress-bar.progress-green {
    background: linear-gradient(135deg, var(--success), #34d399);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Big progress display */
.progress-big {
    text-align: center;
    padding: var(--space-lg);
}

.progress-big .percent {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-big .percent-suffix {
    font-size: 1.5rem;
    font-weight: 600;
}

/* =============================================
   Badges
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #1e40af;
}

/* =============================================
   Tables
   ============================================= */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tr:hover {
    background: var(--gray-50);
}

/* =============================================
   Timeline (Instagram-style feed)
   ============================================= */
.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.timeline-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.timeline-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-100);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.timeline-header .meta {
    flex: 1;
}

.timeline-header .meta .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.timeline-header .meta .date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.timeline-header .progress-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.timeline-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    cursor: pointer;
}

.timeline-body {
    padding: var(--space-md);
}

.timeline-body .description {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.timeline-body .location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: var(--space-sm);
}

.timeline-body .location svg {
    width: 14px;
    height: 14px;
}

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-header .close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition-fast);
}

.modal-header .close-btn:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    display: flex;
    gap: var(--space-sm);
}

/* =============================================
   Login Page
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%);
    padding: var(--space-md);
}

.login-page body,
body.login-body {
    padding-bottom: 0;
    background: transparent;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    color: #fff;
}

.login-header .login-icon {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header .login-icon svg {
    width: 36px;
    height: 36px;
}

.login-header h1 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.login-header p {
    opacity: 0.85;
    font-size: 0.9rem;
}

.login-form {
    padding: var(--space-xl) var(--space-lg);
}

/* =============================================
   Flash Messages / Alerts
   ============================================= */
.alert {
    padding: 14px var(--space-md);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* =============================================
   Range Slider (Progress Input)
   ============================================= */
.range-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    outline: none;
    transition: var(--transition);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
    border: 3px solid #fff;
    transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
    border: 3px solid #fff;
}

.range-value {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: var(--space-sm) 0;
}

/* =============================================
   Photo Preview Grid
   ============================================= */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* =============================================
   GPS Indicator
   ============================================= */
.gps-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px var(--space-md);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
}

.gps-status.searching {
    background: var(--warning-light);
    color: #92400e;
}

.gps-status.found {
    background: var(--success-light);
    color: #065f46;
}

.gps-status.error {
    background: var(--danger-light);
    color: #991b1b;
}

.gps-status .dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.gps-status.searching .dot {
    background: var(--warning);
    animation: blink 1s infinite;
}

.gps-status.found .dot {
    background: var(--success);
}

.gps-status.error .dot {
    background: var(--danger);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* =============================================
   Lightbox
   ============================================= */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox .close-lightbox {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   Empty State
   ============================================= */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--gray-400);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-500);
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: 0.875rem;
}

/* =============================================
   Section Headers
   ============================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.section-header h2 {
    font-size: 1.2rem;
}

.section-header a {
    font-size: 0.8rem;
    font-weight: 600;
}

/* =============================================
   Welcome Banner
   ============================================= */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
}

.welcome-banner h2 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.welcome-banner p {
    opacity: 0.85;
    font-size: 0.9rem;
}

/* =============================================
   Project Card (for Mandor)
   ============================================= */
.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.project-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.project-card .project-address {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--space-md);
}

.project-card .project-address svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.project-card .project-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* =============================================
   Chart Container
   ============================================= */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 300px;
}

.chart-container canvas {
    width: 100% !important;
}

/* =============================================
   Gantt Chart (Simple)
   ============================================= */
.gantt-container {
    overflow-x: auto;
    padding: var(--space-md) 0;
}

.gantt-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm);
    gap: var(--space-sm);
}

.gantt-label {
    min-width: 120px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.gantt-bar-bg {
    flex: 1;
    height: 28px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.gantt-bar {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 var(--space-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.gantt-bar.on-track {
    background: linear-gradient(135deg, var(--success), #34d399);
}

.gantt-bar.behind {
    background: linear-gradient(135deg, var(--warning), var(--accent-light));
}

.gantt-bar.critical {
    background: linear-gradient(135deg, var(--danger), #f87171);
}

/* =============================================
   Utilities
   ============================================= */
.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.hidden {
    display: none !important;
}

.w-full {
    width: 100%;
}

/* =============================================
   Responsive: Tablet & Desktop
   ============================================= */
@media (min-width: 480px) {
    .stat-grid-mandor {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }

    .modal-overlay {
        align-items: center;
        padding: var(--space-lg);
    }

    .modal {
        border-radius: var(--radius-xl);
        max-width: 600px;
        max-height: 85vh;
    }

    @keyframes slideUp {
        from {
            transform: translateY(30px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .page-content {
        padding-top: 80px;
    }
}

@media (min-width: 1024px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 var(--space-xl);
    }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {

    .top-nav,
    .bottom-nav,
    .btn-float {
        display: none;
    }

    body {
        padding: 0;
    }

    .page-content {
        padding-top: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* =============================================
   Feedback System Styles
   ============================================= */

/* Tombol Feedback */
.btn-feedback {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    min-height: 48px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    font-family: inherit;
}

.btn-feedback:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.btn-feedback:active {
    transform: scale(0.97);
}

/* --- Feedback Thread & Bubbles --- */
.feedback-history-card {
    border-left: 4px solid #f59e0b;
}

.feedback-thread {
    margin-bottom: 16px;
}

.feedback-thread:last-child {
    margin-bottom: 0;
}

.feedback-bubble {
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
    max-width: 92%;
    position: relative;
}

.feedback-bubble.feedback-klien {
    background: #fff8ec;
    border: 1px solid #fde68a;
    margin-left: 0;
    border-bottom-left-radius: 4px;
}

.feedback-bubble.feedback-admin {
    background: #eef4ff;
    border: 1px solid #bfdbfe;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.fb-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.fb-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
}

.fb-tag {
    font-size: 0.68rem;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 600;
}

.fb-time {
    font-size: 0.68rem;
    color: var(--gray-400);
    margin-left: auto;
}

.fb-text {
    font-size: 0.875rem;
    color: var(--gray-800);
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.feedback-waiting {
    font-size: 0.78rem;
    color: var(--gray-400);
    padding: 6px 12px;
    text-align: center;
    font-style: italic;
}

/* Truncated text in admin table */
.fb-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.fb-reply-preview {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--gray-200);
}

/* Pending row highlight */
.feedback-row-pending {
    background: #fffbeb !important;
}

.feedback-row-pending:hover {
    background: #fef9e3 !important;
}

/* --- Modal Overlay --- */
.feedback-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.feedback-modal-box {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUpModal 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpModal {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.feedback-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.feedback-modal-close {
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    line-height: 1;
}

.feedback-modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.feedback-modal-body {
    padding: 20px 24px;
}

.feedback-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* --- Badge variants --- */
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

/* --- Toast --- */
.feedback-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 3000;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.mb-md {
    margin-bottom: var(--space-md);
}