/* ============================================================
   IT EQUIPMENT TRACKER — COMPLETE STYLESHEET
   Order:
     1. Design tokens
     2. Base / typography
     3. Layout (sidebar, topbar, content)
     4. Cards & containers
     5. Buttons
     6. Badges & pills
     7. Forms
     8. Tables
     9. Modals
     10. Alerts
     11. Equipment-specific
     12. Shops / Categories / Ownership specifics
     13. Repairs specifics
     14. Reports specifics
     15. Profile & Settings
     16. Timeline
     17. Utilities
     18. Mobile responsive (LAST — must override)
     19. Print styles
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --primary: #4361ee;
    --primary-dark: #3a52d4;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --info: #118ab2;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

/* ============================================================
   2. BASE / TYPOGRAPHY
   ============================================================ */
* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.min-width-0 { min-width: 0; }

.text-mono {
    font-family: ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Code', monospace;
    font-size: 0.85em;
}

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 16px 0;
}

/* ============================================================
   3. LAYOUT
   ============================================================ */

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.25s ease;
    will-change: transform;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    text-decoration: none;
    color: var(--gray-800);
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-text small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--gray-600);
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    -webkit-overflow-scrolling: touch;
}

.sidebar-section {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-600);
    padding: 12px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: var(--gray-50);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--gray-600);
    text-transform: capitalize;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.show {
    opacity: 1;
}

/* ---------- Main wrapper ---------- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.topbar {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--gray-700);
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.topbar-toggle:hover {
    background: var(--gray-100);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-breadcrumb {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.content {
    flex: 1;
    padding: 24px;
    max-width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   4. CARDS & CONTAINERS
   ============================================================ */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: #fff;
    transition: all 0.15s ease;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--gray-800);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-body {
    padding: 20px;
}

/* ---------- Stat cards ---------- */
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 14px;
}

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-card-meta {
    font-size: 0.78rem;
    color: var(--gray-600);
    margin-top: 6px;
}

.stat-icon-primary { background: rgba(67, 97, 238, 0.1);  color: var(--primary); }
.stat-icon-success { background: rgba(6, 214, 160, 0.12); color: #059669; }
.stat-icon-warning { background: rgba(255, 209, 102, 0.2); color: #d97706; }
.stat-icon-info    { background: rgba(17, 138, 178, 0.12); color: var(--info); }
.stat-icon-danger  { background: rgba(239, 71, 111, 0.12); color: var(--danger); }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h5 {
    color: var(--gray-800);
    font-weight: 600;
    margin-bottom: 6px;
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(67, 97, 238, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ============================================================
   6. BADGES & PILLS
   ============================================================ */
.badge {
    font-weight: 500;
    padding: 0.35em 0.7em;
    font-size: 0.72rem;
    border-radius: 6px;
}

.badge-soft-success   { background: rgba(6, 214, 160, 0.15);   color: #047857; }
.badge-soft-warning   { background: rgba(255, 209, 102, 0.25); color: #b45309; }
.badge-soft-danger    { background: rgba(239, 71, 111, 0.15);  color: #be123c; }
.badge-soft-info      { background: rgba(17, 138, 178, 0.15);  color: #0369a1; }
.badge-soft-secondary { background: var(--gray-100);           color: var(--gray-700); }
.badge-soft-primary   { background: rgba(67, 97, 238, 0.12);   color: var(--primary-dark); }

/* ============================================================
   7. FORMS
   ============================================================ */
.form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.form-control::placeholder {
    color: var(--gray-300);
}

.input-group-text {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-600);
    font-size: 0.875rem;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* Search bar */
.search-bar {
    position: relative;
}

.search-bar .form-control {
    padding-left: 40px;
    background: var(--gray-50);
    border-color: transparent;
}

.search-bar .form-control:focus {
    background: #fff;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-600);
    pointer-events: none;
    font-size: 0.95rem;
}

/* Password strength */
.password-strength {
    margin-top: 4px;
}

.strength-bar {
    height: 4px;
    background: var(--gray-100);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--gray-300);
    border-radius: 2px;
    transition: all 0.25s ease;
}

.strength-text {
    font-size: 0.72rem;
    font-weight: 500;
}

/* ============================================================
   8. TABLES
   ============================================================ */
.table-responsive {
    border-radius: var(--radius);
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.table {
    margin: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tfoot th {
    padding: 14px 16px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Shared table style alias */
.shops-table thead th,
.shops-table tbody td,
.shops-table tfoot th {
    /* Uses .table defaults above */
}

/* Horizontal scroll indicator */
.table-responsive.can-scroll-left::before,
.table-responsive.can-scroll-right::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 8px;
    width: 24px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.table-responsive.can-scroll-left::before {
    left: 0;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.08), transparent);
}

.table-responsive.can-scroll-right::after {
    right: 0;
    background: linear-gradient(to left, rgba(15, 23, 42, 0.08), transparent);
}

/* List group */
.list-group-item {
    border-color: var(--gray-100);
    padding: 14px 20px;
    font-size: 0.875rem;
}

.list-group-item-action:hover {
    background: var(--gray-50);
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    color: var(--gray-700);
    border-color: var(--gray-200);
    font-weight: 500;
    padding: 0.4rem 0.7rem;
}

.pagination .page-link:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.35);
}

.pagination .page-item.disabled .page-link {
    color: var(--gray-300);
}

/* ============================================================
   9. MODALS
   ============================================================ */
.modal-dialog {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
}

.modal-dialog-centered {
    min-height: calc(100% - 1rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 560px;
        margin: 1.75rem auto;
    }
    .modal-dialog.modal-lg {
        max-width: 720px;
    }
    .modal-dialog.modal-sm {
        max-width: 380px;
    }
}

.modal-content {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: #fff;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-body {
    padding: 20px;
    background: #fff;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    gap: 8px;
}

/* Form sections (repair modal, etc.) */
.form-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-600);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-600);
    background: rgba(67, 97, 238, 0.04);
    border-left: 3px solid var(--primary);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.form-hint i {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================================
   10. ALERTS
   ============================================================ */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.alert-success { background: #ecfdf5; color: #065f46; border-left: 4px solid #10b981; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-info    { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ============================================================
   11. EQUIPMENT
   ============================================================ */
.equipment-card {
    overflow: hidden;
    transition: all 0.2s ease;
}

.equipment-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.equipment-thumb {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    overflow: hidden;
}

.equipment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.equipment-card:hover .equipment-thumb img {
    transform: scale(1.05);
}

.equipment-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--gray-300);
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
}

.equipment-thumb-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.equipment-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--gray-600);
}

.equipment-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.equipment-meta-row i {
    width: 14px;
    color: var(--gray-300);
    flex-shrink: 0;
}

/* Hero image (view page) */
.equipment-hero {
    background: var(--gray-50);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equipment-hero img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.equipment-hero-empty {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 2px dashed var(--gray-200);
}

/* Photo gallery scroll */
.photo-gallery-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.photo-gallery-scroll::-webkit-scrollbar { height: 4px; }
.photo-gallery-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 2px;
}

.photo-gallery-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.photo-gallery-thumb:hover,
.photo-gallery-thumb.active {
    border-color: var(--primary);
    transform: scale(1.03);
}

.photo-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.photo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 1rem;
}

/* Photo dropzone */
.photo-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 24px 16px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    color: var(--gray-600);
}

.photo-dropzone:hover,
.photo-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.04);
    color: var(--primary);
}

.photo-dropzone i {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

/* Photo preview */
.photo-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--gray-100);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

.photo-preview-remove:hover { background: #dc2626; }

.photo-preview-primary {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(67, 97, 238, 0.9);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.photo-actions {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    padding: 4px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.photo-preview-item:hover .photo-actions { opacity: 1; }

.photo-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0;
    cursor: pointer;
}

.photo-btn:hover {
    background: #fff;
    color: var(--primary);
}

.photo-btn-danger:hover { color: #dc2626; }

/* ============================================================
   12. SHOPS / CATEGORIES / OWNERSHIP
   ============================================================ */
.shop-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.shop-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.shop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.shop-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 2px;
}

.shop-card-code {
    font-size: 0.72rem;
    color: var(--gray-600);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.shop-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-600);
    padding: 8px 0;
}

.shop-card-body .shop-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.shop-card-body .shop-info-row i {
    width: 16px;
    color: var(--gray-300);
    flex-shrink: 0;
}

.shop-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
    gap: 8px;
    flex-wrap: wrap;
}

.shop-card-actions {
    display: flex;
    gap: 6px;
}

/* Row icon */
.shop-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.12) 0%, rgba(99, 102, 241, 0.06) 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Category icon */
.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.12) 0%, rgba(99, 102, 241, 0.06) 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Equipment count — inline (table cell) */
.equipment-count-inline {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
    border-radius: 8px;
    min-width: 70px;
}

.equipment-count-inline-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.equipment-count-inline-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--gray-600);
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 2px;
}

/* Equipment count — block (card) */
.equipment-count-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--gray-50) 0%, #fff 100%);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    margin: 8px 0;
}

.equipment-count-primary {
    flex-shrink: 0;
    text-align: center;
    padding-right: 14px;
    border-right: 1px solid var(--gray-200);
    min-width: 82px;
}

.equipment-count-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.equipment-count-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gray-600);
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 3px;
}

.equipment-count-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.equipment-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    width: fit-content;
}

.equipment-count-active    { background: rgba(6, 214, 160, 0.12);   color: #047857; }
.equipment-count-warning   { background: rgba(255, 209, 102, 0.22); color: #b45309; }
.equipment-count-info      { background: rgba(17, 138, 178, 0.12);  color: #0369a1; }
.equipment-count-secondary { background: var(--gray-100);           color: var(--gray-700); }
.equipment-count-danger    { background: rgba(239, 71, 111, 0.12);  color: #be123c; }
.equipment-count-muted     { background: var(--gray-100);           color: var(--gray-600); }

/* Distribution bar */
.equipment-distribution {
    padding: 4px 2px 10px;
}

.equipment-distribution-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.equipment-distribution-label strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* Location card */
.location-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.04) 0%, rgba(99, 102, 241, 0.02) 100%);
    border: 1px solid rgba(67, 97, 238, 0.1);
    border-radius: var(--radius);
}

.location-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(67, 97, 238, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Detail rows */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 16px;
    font-size: 0.875rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    color: var(--gray-600);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-value {
    color: var(--gray-800);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

/* ============================================================
   13. TIMELINE
   ============================================================ */
.timeline { padding: 8px 0; }

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 46px;
    bottom: -8px;
    width: 2px;
    background: var(--gray-100);
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    background: var(--gray-100);
}

.timeline-content {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
}

.timeline-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.timeline-meta {
    font-size: 0.72rem;
    color: var(--gray-600);
    margin-top: 4px;
}

/* ============================================================
   14. REPORTS
   ============================================================ */
.report-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.report-tabs::-webkit-scrollbar { height: 6px; }
.report-tabs::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 3px;
}

.report-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    scroll-snap-align: start;
}

.report-tab:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.report-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

/* ============================================================
   15. PROFILE & SETTINGS
   ============================================================ */
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.profile-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.35);
    transition: transform 0.15s ease;
    margin: 0;
}

.profile-avatar-edit:hover {
    transform: scale(1.08);
    background: var(--primary-dark);
}

/* Company logo */
.company-logo-wrap {
    position: relative;
    display: inline-block;
}

.company-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    background: var(--gray-50);
    padding: 8px;
}

.company-logo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 2.5rem;
}

/* User avatars */
.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-small.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    flex-shrink: 0;
}

.user-avatar-large.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

/* ============================================================
   16. UTILITIES
   ============================================================ */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   17. MOBILE RESPONSIVE (must be last to override)
   ============================================================ */

/* ---------- Tablet & below: sidebar becomes drawer ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        height: 100vh;
        height: 100dvh;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }
    .sidebar-overlay.show {
        pointer-events: auto;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .topbar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .topbar {
        padding: 0 16px;
    }
    .content {
        padding: 16px;
    }
}

/* ---------- Tablet landscape / small desktop ---------- */
@media (max-width: 767.98px) {
    .content {
        padding: 12px;
    }
    .page-header {
        margin-bottom: 14px;
    }
    .page-title {
        font-size: 1.25rem;
    }
    .page-subtitle {
        font-size: 0.8rem;
    }
    .page-actions {
        width: 100%;
    }
    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }
    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }
    .stat-card-value { font-size: 1.5rem; }

    /* Table tightening */
    .table > :not(caption) > * > * {
        padding: 10px 12px !important;
        font-size: 0.82rem;
    }
    .shops-table thead th {
        font-size: 0.68rem;
        padding: 10px 12px;
    }
    .shops-table tbody td {
        padding: 12px !important;
    }

    /* Table scroll hint */
    .table-responsive {
        background-image:
            linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 20px,
                            transparent calc(100% - 20px), rgba(0, 0, 0, 0.04));
        background-attachment: local, local, scroll, scroll;
    }

    /* Action buttons */
    .table .btn-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    .shops-table tbody td:last-child {
        white-space: normal !important;
    }
    .shops-table tbody td:last-child .btn {
        margin-bottom: 2px;
    }

    /* Modal */
    .modal-header { padding: 14px 16px; }
    .modal-title  { font-size: 1rem; }
    .modal-body   { padding: 16px; }
    .modal-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-footer .btn {
        width: 100%;
        padding: 0.6rem 1rem;
    }

    /* Alert */
    .alert {
        padding: 10px 14px;
        font-size: 0.82rem;
        gap: 8px;
    }
}

/* ---------- Phone ---------- */
@media (max-width: 575.98px) {
    .content { padding: 10px; }
    .card-body { padding: 14px; }
    .card-header {
        padding: 12px 14px;
        font-size: 0.88rem;
    }

    /* Stat cards */
    .stat-card { padding: 14px; }
    .stat-card-icon {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
        margin-bottom: 10px;
    }
    .stat-card-value { font-size: 1.4rem; }
    .stat-card-label { font-size: 0.68rem; }
    .stat-card-meta  { font-size: 0.68rem; }

    /* Tables */
    .table > :not(caption) > * > * {
        padding: 8px 10px !important;
        font-size: 0.78rem;
    }
    .shops-table thead th  { padding: 8px 10px; }
    .shops-table tbody td  { padding: 10px !important; }
    .equipment-count-inline {
        padding: 4px 8px;
        min-width: 55px;
    }
    .equipment-count-inline-value { font-size: 1.05rem; }
    .equipment-count-inline-label { font-size: 0.6rem; }
    .equipment-count-pill {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .badge {
        font-size: 0.65rem;
        padding: 0.28em 0.55em;
    }

    /* Prevent iOS zoom on focus */
    .form-control,
    .form-select {
        font-size: 16px !important;
        padding: 0.5rem 0.75rem;
    }
    .form-label { font-size: 0.8rem; }
    .input-group-text {
        font-size: 0.8rem;
        padding: 0.5rem 0.65rem;
    }

    /* Search bar */
    .search-bar .form-control {
        padding-left: 36px;
        font-size: 16px !important;
    }
    .search-bar .search-icon {
        left: 12px;
        font-size: 0.9rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 2px;
    }
    .pagination .page-link {
        padding: 0.35rem 0.55rem;
        font-size: 0.8rem;
        min-width: 32px;
        text-align: center;
    }

    /* Dropdown */
    .dropdown-menu { min-width: 220px; }
    .topbar-actions .btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    /* Equipment gallery */
    .equipment-hero { aspect-ratio: 4/3; }
    .photo-gallery-thumb {
        width: 56px;
        height: 56px;
    }
    .photo-preview-item { aspect-ratio: 1; }

    /* Timeline */
    .timeline-item {
        padding: 10px 12px;
        gap: 10px;
    }
    .timeline-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .timeline-item:not(:last-child)::before {
        left: 26px;
        top: 40px;
    }
    .timeline-content { font-size: 0.78rem; }
    .timeline-title   { font-size: 0.82rem; }

    /* Profile */
    .profile-avatar {
        width: 90px;
        height: 90px;
    }
    .profile-avatar-initials { font-size: 1.8rem; }
}

/* ---------- iOS specific ---------- */
@supports (-webkit-touch-callout: none) {
    .sidebar {
        height: -webkit-fill-available;
    }
    input,
    select,
    textarea {
        border-radius: 8px;
        -webkit-appearance: none;
    }
    select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23475569' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 14px;
        padding-right: 2.25rem;
    }
}

/* ---------- Date inputs ---------- */
input[type="date"] {
    min-height: 40px;
    -webkit-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 2px;
}

/* ---------- Print button hide on mobile ---------- */
@media (max-width: 575.98px) {
    .print-hide-mobile { display: none !important; }
}

/* ============================================================
   18. PRINT STYLES
   ============================================================ */
.print-header,
.print-footer { display: none; }

@media print {
    .sidebar,
    .topbar,
    .page-actions,
    .no-print,
    .report-tabs,
    footer,
    .sidebar-overlay,
    form button,
    .btn,
    .alert {
        display: none !important;
    }

    body {
        background: #fff !important;
        font-size: 11pt;
        color: #000;
    }

    .main-wrapper { margin-left: 0 !important; }

    .content {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .page-header { margin-bottom: 12px; }

    /* Print header */
    .print-header {
        display: block !important;
        text-align: center;
        border-bottom: 2px solid #333;
        padding-bottom: 12px;
        margin-bottom: 18px;
    }
    .print-header h2 {
        font-size: 18pt;
        margin: 0 0 4px;
        color: #000;
    }
    .print-header .print-subtitle {
        font-size: 11pt;
        color: #555;
        margin: 2px 0;
    }
    .print-header .print-meta {
        font-size: 9pt;
        color: #777;
        margin: 2px 0;
    }
    .print-header .print-logo {
        max-height: 60px;
        margin-bottom: 8px;
    }

    /* Print footer */
    .print-footer {
        display: block !important;
        text-align: center;
        border-top: 1px solid #999;
        margin-top: 20px;
        padding-top: 8px;
        font-size: 8pt;
        color: #666;
    }

    /* Cards */
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        border-radius: 4px !important;
        page-break-inside: avoid;
    }
    .card-header {
        background: #f5f5f5 !important;
        border-bottom: 1px solid #ccc !important;
        padding: 8px 12px !important;
        font-size: 11pt;
        font-weight: 600;
    }
    .card-body { padding: 12px !important; }

    /* Tables */
    table {
        border-collapse: collapse !important;
        width: 100%;
        font-size: 9pt;
    }
    table th,
    table td {
        border: 1px solid #ccc !important;
        padding: 6px 8px !important;
    }
    table thead th {
        background: #f0f0f0 !important;
        color: #000 !important;
        font-weight: 600;
        text-align: left;
    }
    table tfoot th {
        background: #f0f0f0 !important;
        font-weight: 600;
    }

    /* Badges */
    .badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #999 !important;
        padding: 1px 6px !important;
        font-size: 8pt !important;
    }

    /* Stat cards */
    .stat-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        padding: 10px !important;
        page-break-inside: avoid;
    }
    .stat-card-icon { display: none !important; }
    .stat-card-value { font-size: 14pt !important; color: #000 !important; }
    .stat-card-label { font-size: 9pt !important; color: #333 !important; }

    /* Progress bars hidden in print */
    .progress { display: none !important; }

    /* Color corrections */
    .text-success { color: #15803d !important; }
    .text-warning { color: #b45309 !important; }
    .text-danger  { color: #b91c1c !important; }

    /* Page setup */
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    tr { page-break-inside: avoid; }

    /* Stack rows */
    .row { display: block !important; }
    .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 12px;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}

@media print and (max-width: 800px) {
    @page { size: A4 portrait; }
}

/* ============================================================
   PHASE 1 — EMPLOYEES & SUPPLIERS
   ============================================================ */

/* User avatar inside table rows (reused from users module) */
.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-small.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    flex-shrink: 0;
}

.user-avatar-large.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

/* Form sections inside modals (reused from repairs) */
.form-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-600);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Profile avatar wrap (for photo pickers) */
.profile-avatar-wrap {
    position: relative;
    display: inline-block;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.35);
    transition: transform 0.15s ease;
    margin: 0;
}

.profile-avatar-edit:hover {
    transform: scale(1.08);
    background: var(--primary-dark);
}

/* ============================================================
   MOBILE — Phase 1 additions
   ============================================================ */
@media (max-width: 575.98px) {
    .user-avatar-small {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }
    .user-avatar-large {
        width: 64px;
        height: 64px;
        font-size: 1.25rem;
    }
    .profile-avatar-edit {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    .form-section {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
}

/* ============================================================
   PHASE 2 — MOVEMENTS & VOUCHER
   ============================================================ */

/* Movement type grid */
.movement-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.movement-type-option input { display: none; }
.movement-type-option { cursor: pointer; }
.movement-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.15s ease;
    background: #fff;
}
.movement-type-card:hover { border-color: var(--gray-300); background: var(--gray-50); }
.movement-type-option input:checked + .movement-type-card {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}
.movement-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.movement-type-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.2;
}

/* ---------- Voucher ---------- */
.voucher {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.voucher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-800);
    gap: 16px;
    flex-wrap: wrap;
}

.voucher-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 3px;
}

.voucher-ref {
    font-family: ui-monospace, monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.voucher-value {
    font-weight: 500;
    color: var(--gray-800);
}

.voucher-status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.voucher-status-item {
    text-align: left;
}

.voucher-section {
    margin-bottom: 24px;
}

.voucher-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-700);
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.voucher-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.voucher-table tr {
    border-bottom: 1px solid var(--gray-100);
}

.voucher-table tr:last-child {
    border-bottom: none;
}

.voucher-td-label {
    padding: 8px 0;
    color: var(--gray-600);
    font-weight: 500;
    width: 18%;
    vertical-align: top;
}

.voucher-td-value {
    padding: 8px 12px 8px 0;
    color: var(--gray-800);
    width: 32%;
    vertical-align: top;
}

.voucher-custody {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.voucher-party {
    text-align: center;
}

.voucher-party-role {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 6px;
}

.voucher-party-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.voucher-party-sub {
    font-size: 0.78rem;
    color: var(--gray-600);
}

.voucher-arrow {
    font-size: 1.5rem;
    color: var(--primary);
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.signature-block {
    text-align: center;
}

.signature-line {
    height: 1px;
    background: var(--gray-800);
    margin-bottom: 6px;
}

.signature-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--gray-800);
}

.signature-hint {
    font-size: 0.68rem;
    color: var(--gray-600);
    margin-top: 2px;
}

.voucher-footer-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    margin-top: 24px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.72rem;
    color: var(--gray-600);
}

/* Print adjustments for voucher */
@media print {
    .voucher {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    .voucher-custody {
        background: #fff !important;
        border: 1px solid #ccc !important;
    }
    .voucher-status-bar {
        background: #fff !important;
        border: 1px solid #ccc !important;
    }
    .signature-line {
        background: #000 !important;
    }
    .print-header {
        display: block !important;
    }
    .voucher-ref {
        color: #000 !important;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 575.98px) {
    .movement-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .movement-type-card {
        padding: 10px 8px;
    }
    .movement-type-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    .movement-type-label {
        font-size: 0.7rem;
    }
    .voucher {
        padding: 18px 14px;
    }
    .voucher-ref {
        font-size: 1.1rem;
    }
    .voucher-custody {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .voucher-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
    .voucher-table td {
        display: block;
        width: 100%;
        padding: 4px 0;
    }
    .voucher-td-label {
        font-size: 0.7rem;
        margin-top: 6px;
    }
    .signature-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .voucher-footer-meta {
        flex-direction: column;
    }
}

/* ============================================================
   PHOTO SOURCE BUTTONS (Camera + Gallery)
   ============================================================ */
.photo-source-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.photo-source-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 60px;
}

.photo-source-btn:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.03);
    transform: translateY(-1px);
}

.photo-source-btn:active {
    transform: translateY(0);
    background: rgba(67, 97, 238, 0.06);
}

.photo-source-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(67, 97, 238, 0.25);
}

.photo-source-btn:nth-child(2) .photo-source-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}

.photo-source-text {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.photo-source-text .fw-semibold {
    font-size: 0.82rem;
    color: var(--gray-800);
}

.photo-source-text small {
    font-size: 0.7rem;
}

/* Preview grid */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.photo-preview-cell {
    aspect-ratio: 1;
}

.photo-preview-item {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-100);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.photo-preview-remove:hover { background: #dc2626; }

.photo-preview-set-primary {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.photo-preview-set-primary:hover {
    background: #fff;
    transform: scale(1.1);
}

/* Mobile */
@media (max-width: 420px) {
    .photo-source-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .photo-source-btn {
        padding: 10px 12px;
        min-height: 54px;
    }
    .photo-source-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    .photo-source-text .fw-semibold {
        font-size: 0.78rem;
    }
}