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

:root {
    --bg-dark: #f8fafc;
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-light: #dbeafe;
    --primary-hover: #2563eb;
    --primary-text: #ffffff;
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================
   Auth Screen
   ============================================ */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-main) 100%);
    padding: 20px;
}

.auth-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    font-size: 2.5rem;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: var(--text-primary);
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-google:hover {
    background: var(--bg-hover);
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-google svg {
    flex-shrink: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-with-action {
    display: flex;
    gap: 6px;
    align-items: center;
}

.input-with-action input {
    flex: 1;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.btn-primary {
    padding: 10px 18px;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-secondary {
    padding: 12px 20px;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    padding: 12px 20px;
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-small {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-small.btn-danger {
    border-color: var(--error);
    color: var(--error);
}

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

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.server-status {
    font-weight: 600;
}

.server-status.online {
    color: var(--success);
}

.server-status.offline {
    color: var(--error);
}

/* ============================================
   Main App Layout
   ============================================ */

.main-app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #fafbfc;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.logo-small {
    display: flex;
    align-items: center;
}

.sidebar-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-small .logo-icon {
    font-size: 1.5rem;
}

.logo-small .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.user-info {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-email {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
}

.btn-logout:hover {
    color: var(--error);
}

.nav-menu {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.nav-icon {
    font-size: 1rem;
}

.nav-text {
    font-weight: 500;
    font-size: 0.85rem;
}

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

.link-external {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.link-external:hover {
    color: var(--primary);
}

/* Debug Toggle */
.debug-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 8px;
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* Back to Zoho Results */
.btn-back-zoho-results {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

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

/* Found Filter Toggle */
.found-filter-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.found-filter-toggle .toggle-label {
    font-size: 0.9rem;
    color: #2e7d32;
    font-weight: 500;
}

.found-filter-toggle .toggle-switch input:checked + .toggle-slider {
    background-color: #2e7d32;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 20px 24px;
    min-height: 100vh;
    background: #ffffff;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Split view: map + results side by side */
.content-section.active.split-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.content-section.split-view .section-header {
    flex-shrink: 0;
}

.content-section.split-view .zoho-search-form {
    flex-shrink: 0;
}

.content-section.split-view .split-view-body {
    flex: 1 1 0;
    display: flex;
    gap: 16px;
    min-height: 0;
    height: 0;
    padding: 0;
}

.content-section.split-view .split-view-body > .radio-map-panel-float {
    width: 40%;
    min-width: 300px;
    max-width: 480px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.content-section.split-view .split-view-body > .radio-map-panel-float .radio-address-row {
    padding: 8px 10px;
    flex-shrink: 0;
}

.content-section.split-view .split-view-body > .radio-map-panel-float .radio-map-container {
    flex: 1;
    height: auto;
    min-height: 200px;
    border-radius: 0;
    border: none;
}

.content-section.split-view .split-view-body > #zohoSearchResults {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-bottom: 20px;
}

/* Fallback: no split-view-body (old structure) */
.content-section.split-view > #zohoSearchResults {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    height: 0;
    padding-bottom: 20px;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .content-section.active.split-view .split-view-body {
        flex-direction: column;
    }

    .content-section.active.split-view .split-view-body > .radio-map-panel-float {
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: 250px;
    }

    .content-section.active.split-view .split-view-body > .radio-map-panel-float .radio-map-container {
        min-height: 150px;
    }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions select {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 200px;
}

/* Directory Select in Folders Section */
#directorySelect {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 300px;
    cursor: pointer;
    order: -1;
}

#directorySelect:hover {
    border-color: var(--primary);
}

#directorySelect:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#section-folders .section-header {
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 20px;
}

#section-browse-folders .section-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    padding: 12px 0;
    margin-top: -12px;
    border-bottom: 1px solid var(--border);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

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

.btn-icon-small {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

/* ============================================
   Photo Grid
   ============================================ */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.photo-card {
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.photo-thumb {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-hover);
    position: relative;
}

.photo-resolution {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 6px;
    text-align: center;
}

.photo-card-info {
    display: none;
}

.photo-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Files List
   ============================================ */

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

.file-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.12s ease;
}

.file-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.file-thumb {
    width: 130px;
    height: 130px;
    background-size: cover;
    background-position: center;
    background-color: #f8fafc;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.file-location-info {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 10px;
}

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

.file-resolution {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.72rem;
}

.file-size {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.72rem;
}

.file-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 3px;
    line-height: 1.45;
}

.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.tag-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 500;
}

/* ============================================
   Folders Grid
   ============================================ */

.folders-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.folder-card {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.folder-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.folder-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.folder-info {
    flex: 1;
    min-width: 0;
}

.folder-info h3 {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.folder-info p {
    display: none;
}

.folder-count {
    display: none;
}

/* ============================================
   Packages Grid
   ============================================ */

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 20px;
}

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.package-icon {
    font-size: 2.5rem;
}

.package-info {
    flex: 1;
}

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

.package-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.package-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.package-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ============================================
   Search
   ============================================ */

.search-form {
    margin-bottom: 24px;
}

.search-bar {
    display: flex;
    gap: 12px;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
}

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

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .btn-primary {
    padding: 14px 28px;
}

/* Inline Geographic Filters (inside semantic-search-toggle row) */
.search-options-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.inline-provincia-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    max-width: 200px;
}

.inline-radio-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-radio-slider {
    width: 120px;
    cursor: pointer;
}

.inline-radio-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 50px;
}

.inline-radio-input {
    width: 80px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
}

.inline-radio-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
}

/* Map panel - visually separate from the form */
.radio-map-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.radio-map-panel-header {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-map-panel-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.radio-map-panel-body {
    padding: 0 16px 16px;
}

.radio-address-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.radio-address-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
}

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

.radio-address-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.geo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.geo-popup {
    background: var(--bg-card, #fff);
    border-radius: var(--radius, 8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.geo-popup-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.geo-popup-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary, #333);
}

.geo-popup-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary, #666);
    padding: 0 4px;
    line-height: 1;
}

.geo-popup-close:hover {
    color: var(--text-primary, #333);
}

.geo-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.geo-popup-list li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #f0f0f0);
    font-size: 0.9rem;
    color: var(--text-primary, #333);
    transition: background 0.15s;
}

.geo-popup-list li:last-child {
    border-bottom: none;
}

.geo-popup-list li:hover {
    background: var(--bg-hover, #f5f5f5);
}

.geo-popup-list li:active {
    background: var(--primary-light, #e3f2fd);
}

.radio-map-container {
    height: 300px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    z-index: 0;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
    z-index: 10001 !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    font-family: inherit;
}

.pac-item {
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
}

.pac-item:hover {
    background: var(--bg-hover);
}

@media (max-width: 768px) {
    .search-options-sep {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }
    .inline-provincia-select {
        max-width: 100%;
        width: 100%;
    }
}

/* Image Search */
.image-search-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.image-search-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.image-search-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.image-search-dropzone {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.image-search-dropzone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.image-search-dropzone input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-search-dropzone .dropzone-content {
    text-align: center;
    padding: 10px;
}

.image-search-dropzone .dropzone-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.image-search-dropzone .dropzone-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.image-search-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-search-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-preview:hover {
    background: var(--error);
}

.similarity-control {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.similarity-control label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.similarity-control label span {
    color: #059669;
    font-weight: bold;
    font-size: 1.2rem;
}

.similarity-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #cbd5e1, #059669);
    outline: none;
    -webkit-appearance: none;
}

.similarity-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #059669;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.similarity-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #059669;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.similarity-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-image-search {
    align-self: center;
    padding: 14px 24px;
}

.btn-image-search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.photo-grid-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 6px;
}

.photo-grid-results .photo-card {
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.photo-grid-results .photo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.photo-grid-results .photo-thumb {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
}

.photo-grid-results .photo-card-info {
    display: none;
}

.photo-grid-results .photo-name {
    display: block;
    font-size: 0.7rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-grid-results .photo-desc {
    display: none;
}

/* ============================================
   Upload
   ============================================ */

.upload-container {
    max-width: 600px;
}

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    position: relative;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-dropzone input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.dropzone-content p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-queue {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.upload-queue h3 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

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

.upload-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.upload-file-item .file-name {
    flex: 1;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-file-item .file-size {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.upload-file-item .btn-remove {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
}

.upload-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.3s;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.modal-small {
    width: 420px;
    padding: 28px;
}

.modal-small h2 {
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: background 0.2s;
}

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

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Photo Modal */
.photo-modal-content {
    display: flex;
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.photo-modal-image {
    flex: 1;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
}

.photo-modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2rem;
    transition: background 0.2s;
}

.nav-arrow:hover {
    background: var(--primary);
}

.nav-prev {
    left: 16px;
}

.nav-next {
    right: 16px;
}

.photo-modal-info {
    width: 340px;
    padding: 28px 24px;
    overflow-y: auto;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
}

.photo-modal-info h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    word-break: break-word;
    padding-right: 28px;
}

.photo-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.meta-item {
    margin-bottom: 8px;
}

.meta-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 0.9rem;
}

.photo-description p,
.photo-tags {
    font-size: 0.9rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag {
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Tags iluminados en el modal fullscreen */
.tags-list .search-tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

/* Cart button in photo modal */
.modal-cart-action {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-cart-action .btn {
    width: 100%;
    justify-content: center;
}

.tags-list .search-tag-match {
    background: var(--success-light);
    color: #047857;
}

.tags-list .search-tag-dim {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.photo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Empty State
   ============================================ */

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

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-page {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

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

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

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

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

.toast.warning {
    background: var(--warning);
    color: #000;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

@media (max-width: 1024px) {
    .photo-modal-content {
        flex-direction: column;
        width: 95vw;
        height: auto;
        max-height: 95vh;
    }

    .photo-modal-image {
        height: 45vh;
        min-height: 200px;
    }

    .photo-modal-info {
        width: 100%;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    /* === Mobile Header === */
    .mobile-header {
        display: flex;
    }

    /* === Main Content: extra padding bottom for bottom nav === */
    .main-content {
        padding-bottom: 68px;
        overflow-x: hidden;
    }

    /* === Shorten long texts for mobile === */
    .section-header h1 {
        font-size: 1rem;
    }

    /* Hide filter-group labels on mobile (selects are self-explanatory) */
    .zoho-form-row .filter-group > label {
        display: none;
    }

    /* Compact selects */
    .zoho-form-row .filter-group select {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    /* Shorter text search input */
    #zohoSearchQuery {
        font-size: 0.85rem;
    }

    /* Shorter slider labels */
    .similitud-label {
        font-size: 0.7rem;
    }

    /* Compact sunlocs checkbox label */
    .sunlocs-controls .checkbox-label span {
        font-size: 0.8rem;
    }

    /* Compact radio map title */
    .radio-map-panel-title {
        font-size: 0.85rem;
    }

    .radio-address-input {
        font-size: 0.8rem;
    }

    /* Shorter zoho dropzone text */
    .zoho-dropzone-text {
        font-size: 0.75rem;
    }

    /* Compact empty state text */
    .empty-state p {
        font-size: 0.8rem;
    }

    /* Compact section header on split-view */
    .content-section.active.split-view .section-header h1 {
        font-size: 0.95rem;
    }

    /* === Sidebar === */
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s ease;
        border-right: 1px solid var(--border);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .cart-button-container {
        display: none;
    }

    /* === Main Content === */
    .main-content {
        margin-left: 0;
        margin-top: 56px;
        padding: 12px;
    }

    .content-section.active.split-view {
        height: calc(100vh - 56px - 56px - 12px);
    }

    #section-browse-folders .section-header {
        top: 56px;
        padding: 8px 0;
        margin-top: -8px;
    }

    /* === Section Header === */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .section-header h1 {
        font-size: 1.1rem;
    }

    /* === Modals === */
    .modal-small {
        width: calc(100vw - 24px);
        max-width: 420px;
        padding: 20px 16px;
    }

    .photo-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .photo-modal-image {
        height: 40vh;
        min-height: 180px;
    }

    .photo-modal-info {
        padding: 16px;
        max-height: 60vh;
    }

    .photo-modal-info h2 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .photo-meta {
        gap: 4px 12px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .nav-prev { left: 8px; }
    .nav-next { right: 8px; }

    .photo-modal-actions {
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
    }

    .photo-modal-actions .btn {
        min-height: 44px;
    }

    .modal-close {
        top: 8px;
        right: 8px;
    }

    /* === Photo Grid === */
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .folders-grid,
    .packages-grid {
        grid-template-columns: 1fr;
    }

    /* === Overflow prevention === */
    #directorySelect {
        min-width: 0;
        width: 100%;
    }

    .section-actions select {
        min-width: 0;
        width: 100%;
    }

    .section-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .authorize-registration-form {
        flex-direction: column;
    }

    .authorize-registration-form input {
        max-width: 100%;
    }

    /* === File Items (Search results) === */
    .files-list .file-item {
        flex-direction: column;
    }

    .files-list .file-thumb {
        width: 100%;
        height: 200px;
        min-width: auto;
    }

    /* === Search Bar === */
    .search-bar {
        flex-direction: column;
    }

    .search-bar input[type="text"] {
        width: 100%;
    }

    /* === Zoho Search Form === */
    .zoho-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .zoho-form-row .filter-group {
        width: 100%;
        min-width: 0;
    }

    .filter-group-radio {
        width: 100% !important;
    }

    .filter-group-radio label:first-child {
        display: none;
    }

    .radio-inline-wrap {
        height: auto;
        flex-wrap: wrap;
    }

    .zoho-form-row-options {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .zoho-btn-buscar {
        width: 100%;
        margin-left: 0;
        min-height: 44px;
        font-size: 1rem;
    }

    .sunlocs-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .similitud-slider-container {
        width: 100%;
    }

    /* === Search Mode Toggle === */
    .search-mode-toggle {
        width: 100%;
    }

    .search-mode-btn {
        flex: 1;
        min-height: 40px;
    }

    /* === Radio Map === */
    .radio-address-row {
        flex-direction: column;
    }

    .radio-address-btn {
        width: 100%;
    }

    /* === Split View on Mobile: stack vertically === */
    .content-section.active.split-view .split-view-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .content-section.active.split-view .split-view-body > .radio-map-panel-float {
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: 300px;
        flex-shrink: 0;
    }

    .content-section.active.split-view .split-view-body > #zohoSearchResults {
        flex: 1 1 auto;
        overflow-y: visible;
        min-height: auto;
    }

    /* === Folder Thumbnails Grid === */
    .folders-thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .folder-thumbnail {
        height: 120px;
    }

    .folder-thumbnail-info {
        padding: 6px 8px;
    }

    .folder-thumbnail-name {
        font-size: 0.75rem;
    }

    .folder-thumbnail-code {
        font-size: 0.65rem;
    }

    .folder-thumbnail-meta {
        font-size: 0.7rem;
    }

    .search-tag {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .btn-add-folder-cart {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    /* === Zoho Location Detail === */
    .zoho-card {
        padding: 12px;
    }

    .zoho-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .zoho-card-header h2 {
        font-size: 1.1rem;
    }

    .zoho-fields {
        grid-template-columns: 1fr;
    }

    .zoho-tarifas {
        grid-template-columns: repeat(2, 1fr);
    }

    .zoho-tags {
        gap: 4px;
    }

    .zoho-tag {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    .zoho-location-header {
        flex-direction: column;
        gap: 6px;
    }

    /* === Admin === */
    .admin-section {
        padding: 12px;
        overflow-x: hidden;
    }

    .admin-section h2 {
        font-size: 1rem;
    }

    .admin-filters {
        flex-direction: column;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    /* === Analytics Dashboard Mobile === */
    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .kpi-card {
        padding: 12px 10px;
        gap: 10px;
    }

    .kpi-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        border-radius: 8px;
    }

    .kpi-value {
        font-size: 1.3rem;
    }

    .kpi-label {
        font-size: 0.7rem;
    }

    .analytics-panels-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .analytics-panel {
        padding: 14px;
    }

    .analytics-bar-label {
        min-width: 80px;
        max-width: 80px;
        font-size: 0.72rem;
    }

    .analytics-engagement-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .engagement-metric-value {
        font-size: 1.2rem;
    }

    .analytics-table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .analytics-table-controls {
        width: 100%;
        flex-direction: column;
    }

    .analytics-search-input,
    .analytics-filter-select {
        width: 100%;
        min-width: auto;
    }

    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }

    .users-table {
        font-size: 0.7rem;
        min-width: 500px;
    }

    .users-table th:nth-child(4),
    .users-table td:nth-child(4) {
        display: none;
    }

    .users-table th,
    .users-table td {
        padding: 6px 4px;
    }

    .actions-cell {
        flex-direction: column;
        gap: 4px;
    }

    .btn-action {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    /* === Packages === */
    .my-packages-grid {
        grid-template-columns: 1fr;
    }

    .package-card {
        padding: 12px;
    }

    .admin-packages-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* === Bulk Actions Bar === */
    .bulk-actions-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
    }

    .bulk-actions-bar .btn {
        font-size: 0.75rem;
        padding: 6px 10px;
        min-height: 36px;
    }

    /* === Cart Modal === */
    .cart-items {
        max-height: 50vh;
    }

    /* === Image Search === */
    .zoho-image-dropzone {
        min-height: 100px;
    }

    .zoho-similarity-control {
        flex-direction: column;
        gap: 6px;
    }

    /* === Toggle Form Button === */
    .btn-toggle-form {
        font-size: 0.8rem;
    }

    /* === Toast === */
    .toast {
        bottom: 80px;
        max-width: calc(100vw - 32px);
        font-size: 0.85rem;
    }

    /* === General buttons: touch targets === */
    .btn-primary,
    .btn-secondary,
    .btn {
        min-height: 40px;
    }

    /* === Upload === */
    .upload-container {
        max-width: 100%;
    }

    .upload-dropzone {
        padding: 24px 16px;
    }

    .upload-dropzone .dropzone-content p {
        font-size: 0.85rem;
    }

    /* === Auth Screen === */
    .auth-container {
        padding: 24px 16px;
        max-width: 100%;
        border-radius: 12px;
    }

    .auth-header {
        margin-bottom: 20px;
    }

    .logo-img {
        height: 40px;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }

    .auth-tabs {
        margin-bottom: 16px;
    }

    .auth-tab {
        min-height: 40px;
        font-size: 0.85rem;
    }

    .auth-form .form-group label {
        font-size: 0.85rem;
    }

    .auth-form input {
        min-height: 44px;
        font-size: 1rem;
    }

    .btn-full {
        min-height: 48px;
        font-size: 1rem;
    }

    .google-btn-container {
        display: flex;
        justify-content: center;
    }

    /* === Fullscreen Viewer === */
    .fullscreen-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .fullscreen-nav {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }

    .fullscreen-prev {
        left: 8px;
    }

    .fullscreen-next {
        right: 8px;
    }

    .fullscreen-viewer-content img {
        max-width: 100vw;
        max-height: 100vh;
    }

    .fullscreen-zoom-hint {
        bottom: 20px;
        font-size: 0.75rem;
        padding: 6px 14px;
    }

    /* === Admin Packages Table === */
    .admin-packages-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }

    .packages-table {
        font-size: 0.7rem;
        min-width: 500px;
    }

    .packages-table th,
    .packages-table td {
        padding: 6px 4px;
        white-space: nowrap;
    }

    /* Hide less important columns on mobile */
    .packages-table th:nth-child(5),
    .packages-table td:nth-child(5),
    .packages-table th:nth-child(6),
    .packages-table td:nth-child(6) {
        display: none;
    }

    /* === Package Activity Modal === */
    .activity-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .activity-stat-value {
        font-size: 1.5rem;
    }

    .activity-dates {
        flex-direction: column;
        gap: 8px;
    }

    .activity-log-item {
        flex-direction: column;
        gap: 4px;
    }

    .activity-log-item .activity-time {
        min-width: auto;
        font-size: 0.75rem;
    }

    /* === Package Details Modal === */
    .package-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

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

    .info-label {
        min-width: auto;
    }

    .share-url-container {
        flex-direction: column;
    }

    .share-url-container input {
        width: 100%;
    }

    /* === My Package Cards === */
    .my-package-header h3 {
        font-size: 0.95rem;
    }

    .my-package-actions {
        flex-direction: column;
    }

    .my-package-actions .btn,
    .my-package-actions button {
        width: 100%;
        min-height: 40px;
        text-align: center;
    }

    /* === File Actions in Search Results === */
    .file-actions {
        flex-direction: row;
        justify-content: flex-start;
    }

    /* === Location Cards === */
    .location-card {
        padding: 12px;
    }

    .location-icon {
        font-size: 1.5rem;
    }

    .location-name {
        font-size: 0.9rem;
    }

    /* === Stat Cards === */
    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        font-size: 1.8rem;
    }

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

    .stat-label {
        font-size: 0.7rem;
    }

    /* === Authorize Registration === */
    .authorize-registration-form {
        flex-direction: column;
    }

    .authorize-registration-form input {
        width: 100%;
    }

    .authorize-registration-form button {
        width: 100%;
        min-height: 44px;
    }

    /* === Cart Modal === */
    .modal-medium {
        width: calc(100vw - 24px);
        max-width: 100%;
        padding: 20px 16px;
    }

    .modal-large {
        width: calc(100vw - 24px);
        max-width: 100%;
        padding: 20px 16px;
    }

    .cart-item {
        gap: 8px;
    }

    .cart-item-thumb {
        width: 48px;
        height: 48px;
    }

    .cart-item-name {
        font-size: 0.8rem;
    }

    /* === Modal Actions === */
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .modal-actions button {
        width: 100%;
        min-height: 44px;
    }

    /* === Empty states === */
    .empty-icon {
        font-size: 2.5rem;
    }

    .empty-state p {
        font-size: 0.85rem;
    }

    /* === Debug toggle === */
    .sidebar-footer {
        padding: 12px;
    }

    .sidebar-footer .link-external {
        font-size: 0.8rem;
    }

    /* === Loading overlay === */
    .loading-overlay .spinner {
        width: 36px;
        height: 36px;
    }

    /* === Inline Radio Input === */
    .inline-radio-input {
        width: 80px;
        font-size: 0.85rem;
    }

    /* === Zoho Image Search === */
    .zoho-image-search {
        flex-direction: column;
        gap: 10px;
    }

    .zoho-image-dropzone {
        width: 100%;
    }
}

/* ============================================
   Zoho CRM Integration Card
   ============================================ */

.zoho-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.zoho-card-header {
    background: #e8f5e9;
    border-bottom: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.zoho-icon {
    font-size: 1rem;
}

.zoho-title {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
    color: #1b5e20;
}

.zoho-codigo {
    background: #c8e6c9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.zoho-estado {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.zoho-estado.estado-activa {
    background: #10b981;
    color: white;
}

.zoho-estado.estado-inactiva {
    background: #ef4444;
    color: white;
}

.zoho-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.zoho-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.zoho-badge-categoria {
    background: #1e40af;
    color: white;
}

.zoho-badge-subcategoria {
    background: #7c3aed;
    color: white;
}

.zoho-badge-caracteristica {
    background: #0d9488;
    color: white;
}

.zoho-card-body {
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.zoho-section {
    margin-bottom: 0;
}

.zoho-section:last-child {
    margin-bottom: 0;
}

.zoho-section-full {
    grid-column: 1 / -1;
}

.zoho-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: #1e40af;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: 0.03em;
}

.zoho-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.zoho-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.zoho-field-full {
    grid-column: 1 / -1;
}

.zoho-label {
    font-size: 0.58rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.zoho-value {
    font-size: 0.75rem;
    color: #1e293b;
}

.zoho-tarifas {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

.zoho-precio {
    font-weight: 600;
    color: #1e40af;
    font-size: 0.9rem;
}

.zoho-observaciones {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.4;
    margin: 0;
    background: #f1f5f9;
    padding: 6px 8px;
    border-radius: 4px;
}

.zoho-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1e40af;
    text-decoration: none;
    font-size: 0.7rem;
    padding: 4px 10px;
    background: #dbeafe;
    border-radius: 4px;
    transition: all 0.15s ease;
    margin-top: 4px;
}

.zoho-link:hover {
    background: #bfdbfe;
    color: #1e3a8a;
}

.zoho-link-inline {
    color: #1e40af;
    text-decoration: none;
}

.zoho-link-inline:hover {
    text-decoration: underline;
}

.zoho-card-body pre {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    overflow-x: auto;
    margin: 0;
}

@media (max-width: 768px) {
    .zoho-fields {
        grid-template-columns: 1fr;
    }

    .zoho-tarifas {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Location Search
   ============================================ */

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 12px;
}

.location-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.location-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.location-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.location-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.location-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-code {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.location-city {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.location-type {
    font-size: 0.75rem;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.location-photo-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.location-address {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .locations-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Folder Thumbnail Cards
   ============================================ */

.folders-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    align-content: start;
}

.folder-thumbnail-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.12s ease;
}

.folder-thumbnail-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.folder-thumbnail {
    width: 100%;
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.folder-thumbnail-placeholder {
    font-size: 1.5rem;
    opacity: 0.3;
}

.folder-thumbnail-info {
    padding: 4px 6px;
    background: #fafbfc;
}

.folder-thumbnail-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.folder-thumbnail-code {
    font-size: 0.58rem;
    color: var(--text-muted);
    display: block;
    margin: 1px 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-thumbnail-count,
.folder-thumbnail-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 3px 0 1px 0;
}

.search-tag {
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-tag-match {
    background: var(--success-light);
    color: #047857;
}

.search-tag-dim {
    background: #f1f5f9;
    color: #94a3b8;
}

.search-highlight {
    background: var(--success-light);
    color: #047857;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Mobile folder thumbnail overrides moved to main 768px media query block */

/* ============================================
   Debug JSON Display
   ============================================ */

.debug-json {
    background: #1e1e1e;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.debug-section {
    margin-bottom: 16px;
}

.debug-section:last-child {
    margin-bottom: 0;
}

.debug-section h4 {
    color: #4fc3f7;
    margin: 0 0 8px 0;
    font-size: 0.85rem;
}

.debug-json pre {
    background: #2d2d2d;
    color: #a5d6a7;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    overflow-x: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* ============================================
   Zoho Sync Button and Modal
   ============================================ */

.btn-sync-zoho {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f5a623 0%, #f78b00 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.btn-sync-zoho:hover {
    background: linear-gradient(135deg, #f78b00 0%, #e07d00 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

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

.sync-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.sync-modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.sync-modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-modal-header.sync-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.sync-modal-header.sync-error {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.sync-icon {
    font-size: 1.5rem;
}

.sync-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.sync-modal-body {
    padding: 24px;
    text-align: center;
}

.sync-stat {
    margin-bottom: 16px;
}

.sync-stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #16a34a;
    line-height: 1;
}

.sync-stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.sync-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0;
}

.sync-modal-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
}

.sync-modal-footer .btn-primary {
    min-width: 120px;
}

/* ============================================
   Toggle Form Button
   ============================================ */

.btn-toggle-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-toggle-form:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.toggle-form-icon {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn-toggle-form.collapsed .toggle-form-icon {
    transform: rotate(180deg);
}

.zoho-search-form.collapsed > .zoho-form-main {
    display: none;
}

/* ============================================
   Zoho Search Section
   ============================================ */

.zoho-search-form {
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.zoho-form-main {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zoho-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.zoho-form-row-options {
    gap: 10px;
}

.sunlocs-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.2s;
}

.sunlocs-controls.disabled {
    opacity: 0.35;
    pointer-events: none;
}


.radio-inline-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 42px;
}

.filter-group-radio {
    min-width: auto !important;
}

.zoho-form-row .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.zoho-form-row .filter-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.zoho-form-row .filter-group select,
.zoho-form-row .filter-group input {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.zoho-form-row .filter-group select:focus,
.zoho-form-row .filter-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.zoho-form-row .filter-group-text {
    flex: 1;
    min-width: 200px;
}

/* Search mode toggle (Text / Image) */
.search-mode-toggle {
    display: flex;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 2px;
    align-self: center;
}

.search-mode-btn {
    padding: 8px 14px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.search-mode-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Zoho image search (thumbnail dropzone) */
.zoho-image-search {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.zoho-image-dropzone {
    position: relative;
    width: 120px;
    height: 90px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.zoho-image-dropzone.has-image {
    border-style: solid;
    border-color: var(--primary);
}

.zoho-image-dropzone:hover {
    border-color: var(--primary);
}

.zoho-image-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.zoho-dropzone-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    pointer-events: none;
    text-align: center;
    padding: 4px;
    line-height: 1.3;
}

.zoho-image-preview {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoho-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.btn-remove-preview-sm {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoho-similarity-control {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.zoho-similarity-control input[type="range"] {
    width: 100px;
}

#zohoSunlocsControls {
    display: contents;
}

#zohoSunlocsControls.hidden {
    display: none;
}

.zoho-btn-buscar {
    margin-left: auto;
    padding: 10px 24px;
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Similitud Slider */

.similitud-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.similitud-slider-container.active {
    opacity: 1;
    pointer-events: auto;
}

.similitud-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.similitud-label-left {
    color: #64748b;
}

.similitud-label-right {
    color: #059669;
}

.similitud-slider {
    width: 200px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #cbd5e1, #059669);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.similitud-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #059669;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.similitud-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.similitud-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #059669;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.similitud-slider:disabled {
    cursor: not-allowed;
}

.similitud-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    border-color: #94a3b8;
}

.similitud-slider:disabled::-moz-range-thumb {
    cursor: not-allowed;
    border-color: #94a3b8;
}

.zoho-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 16px;
}

.zoho-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.zoho-result-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.zoho-result-header {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.zoho-result-icon {
    font-size: 1.2rem;
}

.zoho-result-name {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zoho-result-codigo {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.zoho-result-body {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.zoho-result-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
    width: 100%;
    margin-bottom: 4px;
}

.zoho-detail-view {
    padding: 20px;
}

.zoho-detail-view .btn-secondary {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .zoho-form-row .filter-group {
        width: 100%;
    }

    .zoho-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Admin Section
   ============================================ */

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

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

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Backup & Restore */
.backup-restore-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.backup-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.backup-card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

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

.backup-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.restore-upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.restore-file-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

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

.btn-restore:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .backup-restore-container {
        grid-template-columns: 1fr;
    }
}

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-filters input,
.admin-filters select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 180px;
}

.admin-filters input:focus,
.admin-filters select:focus {
    outline: none;
    border-color: var(--primary);
}

.authorize-registration-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.authorize-registration-form input {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.users-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
}

.users-table tbody tr:hover {
    background: var(--bg-hover);
}

.users-table .user-banned {
    background: #fff5f5;
}

.users-table .user-banned:hover {
    background: #ffe8e8;
}

.users-table .user-current {
    background: #f0f9ff;
}

.user-email-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-text);
    flex-shrink: 0;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-banned {
    background: #fee2e2;
    color: #dc2626;
}

.status-pending {
    background: #fef2f2;
    color: #b91c1c;
}

.role-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-admin {
    background: #fef3c7;
    color: #d97706;
}

.role-user {
    background: #e0e7ff;
    color: #4f46e5;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-action {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-ban {
    color: #d97706;
    border-color: #d97706;
}

.btn-ban:hover {
    background: #d97706;
    color: white;
}

.btn-unban {
    color: #16a34a;
    border-color: #16a34a;
}

.btn-unban:hover {
    background: #16a34a;
    color: white;
}

.btn-make-admin {
    color: #4f46e5;
    border-color: #4f46e5;
}

.btn-make-admin:hover {
    background: #4f46e5;
    color: white;
}

.btn-remove-admin {
    color: #6b7280;
    border-color: #6b7280;
}

.btn-remove-admin:hover {
    background: #6b7280;
    color: white;
}

.btn-delete {
    color: #dc2626;
    border-color: #dc2626;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

.current-user-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.activity-log {
    max-height: 300px;
    overflow-y: auto;
}

.activity-entry {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity-entry:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 140px;
}

.activity-text {
    font-size: 0.9rem;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-filters {
        flex-direction: column;
    }

    .admin-filters input,
    .admin-filters select {
        width: 100%;
    }

    .users-table {
        font-size: 0.8rem;
    }

    .users-table th,
    .users-table td {
        padding: 8px 10px;
    }

    .actions-cell {
        flex-direction: column;
    }
}

/* ============================================
   Package Cart System
   ============================================ */

/* Cart Button in Sidebar */
.cart-button-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.btn-cart {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.btn-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Add to Cart Buttons */
.btn-add-cart {
    padding: 8px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
}

.btn-add-folder-cart {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    z-index: 10;
}

.folder-thumbnail-card {
    position: relative;
}

.folder-thumbnail-card:hover .btn-add-folder-cart {
    opacity: 1;
}

.btn-add-folder-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
}

.btn-add-subfolder-cart {
    flex-shrink: 0;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    opacity: 0;
    transition: opacity 0.15s;
}

.folder-card:hover .btn-add-subfolder-cart {
    opacity: 1;
}

/* Location heart indicator on folder thumbnail cards */
.loc-heart-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
    padding: 0;
    line-height: 1;
}

.loc-heart-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.15);
}

.loc-heart-btn .heart {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
    pointer-events: none;
}

.loc-heart-btn.partial .heart {
    color: #f6ad55;
}

.loc-heart-btn.partial {
    background: rgba(255, 255, 255, 0.85);
}

.loc-heart-btn.all .heart {
    color: #ef4444;
}

.loc-heart-btn.all {
    background: rgba(255, 255, 255, 0.9);
}

@keyframes locHeartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.loc-heart-btn.pop .heart {
    animation: locHeartPop 0.35s ease;
}

/* File item with actions */
.file-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.12s ease;
}

.file-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Modal Sizes */
.modal-medium {
    width: 560px;
    max-width: 95vw;
    padding: 28px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    width: 800px;
    max-width: 95vw;
    padding: 28px;
    max-height: 92vh;
    overflow-y: auto;
}

/* Cart Modal */
.cart-items-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    align-items: center;
}

.cart-item-thumb {
    width: 60px;
    height: 60px;
    background-size: cover;
    background-position: center;
    background-color: var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.cart-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.btn-remove-cart {
    width: 32px;
    height: 32px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-remove-cart:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Package Success Modal */
.share-url-container {
    display: flex;
    gap: 8px;
}

.share-url-container input {
    flex: 1;
    padding: 12px;
    font-size: 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* My Packages Grid */
/* ===== Projects Section ===== */

.projects-grid {
    width: 100%;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.project-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
}

.project-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.project-detail {
    display: flex;
    gap: 6px;
    font-size: 0.85rem;
}

.project-card-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* Project Detail View */

.project-detail-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.project-summary-card {
    padding: 20px 24px;
}

.project-summary-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
}

.project-summary-columns.single-column {
    grid-template-columns: 1fr;
}

.project-summary-section {
    min-width: 0;
}

.project-section-title {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-summary-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.project-info-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.project-info-grid.dates-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

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

.project-info-item.full-width {
    grid-column: 1 / -1;
}

.project-info-item .info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-info-item .info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.project-price {
    font-weight: 600;
    color: var(--primary) !important;
}

/* Project Folder Groups */

.project-folders {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-folder-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.project-folder-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.folder-icon {
    font-size: 1.2rem;
}

.folder-name {
    flex: 1;
}

.folder-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.project-folder-packages {
    display: flex;
    flex-direction: column;
}

.project-package-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.project-package-item.expired {
    opacity: 0.6;
}

.project-pkg-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.project-pkg-name {
    font-weight: 500;
}

.project-pkg-meta {
    display: flex;
    gap: 16px;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.project-pkg-actions {
    display: flex;
    gap: 6px;
}

/* Project Browser - File Navigation */

.project-browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 12px;
}

.project-browser-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
}

.project-browser-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.project-browser-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    flex: 1;
    min-width: 0;
}

.project-browser-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.project-browser-card-body {
    flex: 1;
    min-width: 0;
}

.project-browser-card-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-browser-card-meta {
    display: flex;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    flex-wrap: wrap;
}

.project-browser-card-with-actions {
    flex-wrap: wrap;
}

.project-browser-card-actions {
    width: 100%;
    padding: 0 16px 12px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: -4px;
}

.btn-unlink {
    color: #dc2626;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-unlink:hover {
    color: #fff;
    border-color: #dc2626;
    background: #dc2626;
}

.btn-unlink-table {
    color: #dc2626 !important;
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
}

.btn-unlink-table:hover {
    color: #fff !important;
    background: #dc2626 !important;
}

/* Photo Grid in Project Browser */

.project-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.project-photo-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
}

.project-photo-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.project-photo-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.project-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-photo-name {
    padding: 8px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .project-browser-grid {
        grid-template-columns: 1fr;
    }
    .project-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* Create Project Modal - Form Layout */

.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.project-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.project-form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.project-form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.project-search-bar {
    display: flex;
    gap: 8px;
}

.project-search-bar input {
    flex: 1;
}

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

.input-currency-wrap input {
    flex: 1;
    padding-right: 32px;
}

.input-currency-symbol {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
    user-select: none;
}

.project-dropdown-results {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 6px;
    background: var(--bg-card);
}

.project-dropdown-results.autocomplete-dropdown {
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    max-height: 180px;
}

.autocomplete-loading,
.autocomplete-empty {
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.project-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.project-dropdown-item:hover {
    background: var(--bg-secondary);
}

/* Project combo (searchable dropdown for packages) */
.project-combo {
    position: relative;
}

.project-combo::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 10px;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
}

.project-combo input[type="text"] {
    width: 100%;
    padding-right: 32px;
    cursor: pointer;
}

.project-combo-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-combo-results.open {
    display: block;
}

.project-combo-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.project-combo-item:hover {
    background: var(--bg-secondary);
}

.project-combo-item.no-project {
    color: var(--text-muted);
    font-style: italic;
}

/* Autocomplete combo (searchable select field) */
.autocomplete-combo {
    position: relative;
}

.autocomplete-combo-icon {
    position: absolute;
    left: 10px;
    top: 11px;
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.autocomplete-combo input[type="text"] {
    padding-left: 32px;
    padding-right: 28px;
    width: 100%;
}

.autocomplete-combo-clear {
    position: absolute;
    right: 6px;
    top: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 50%;
    z-index: 1;
}

.autocomplete-combo-clear:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.autocomplete-combo.has-selection input[type="text"] {
    border-color: var(--primary);
    background-color: color-mix(in srgb, var(--primary) 6%, var(--bg-card));
    font-weight: 500;
}

.autocomplete-combo.has-selection .autocomplete-combo-icon {
    color: var(--primary);
}

/* Decorados */
.project-decorados-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-decorado-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

/* Decorados display in detail view */
.project-decorados-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-decorado-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

/* ===== Decorados Management ===== */

.decorados-mgmt {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

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

.decorados-mgmt-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.decorados-mgmt-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
    padding: 8px 0;
}

/* Decorados Table */
.decorados-table-wrap {
    overflow-x: auto;
}

.decorados-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.decorados-table thead th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.decorados-table-row {
    cursor: pointer;
    transition: background 0.15s;
}

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

.decorados-table-row td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.decorados-table-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.decorados-table-desc {
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.4;
}

.decorados-table-files {
    color: var(--text-muted);
    white-space: nowrap;
}

/* Decorado adjuntos previews in table */
.dec-adjuntos-cell {
    min-width: 60px;
}

.dec-adjuntos-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dec-adjunto-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.dec-adjunto-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 2;
}

.dec-adjunto-loading {
    background: var(--bg-secondary);
    animation: dec-thumb-pulse 1s ease-in-out infinite alternate;
}

@keyframes dec-thumb-pulse {
    from { opacity: 0.4; }
    to { opacity: 0.8; }
}

.dec-adjunto-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.dec-adjunto-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 2;
}

.dec-adjunto-pdf {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.dec-adjunto-pdf:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 2;
}

.dec-adjunto-pdf svg {
    width: 100%;
    height: 100%;
}

.decorado-file-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* ============================================================
   Decorados + Packages Unified Section
   ============================================================ */

.decorados-packages-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.decorados-packages-section .decorados-mgmt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.decorados-packages-section .decorados-mgmt-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.decorados-mgmt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter-favs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-favs:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.btn-filter-favs.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-weight: 600;
}

.btn-director-favs {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.18);
    color: #7c3aed;
}

.btn-director-favs:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
}

.btn-director-favs.active {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
    font-weight: 600;
}

/* Decorado Card */
.deco-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.deco-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.deco-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.deco-card-header:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-secondary) 100%);
}

.deco-card-header-muted {
    cursor: default;
    background: var(--bg-card);
}

.deco-card-header-muted:hover {
    background: var(--bg-card);
}

.deco-card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.deco-card-info {
    flex: 1;
    min-width: 0;
}

.deco-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.deco-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deco-card-files {
    flex-shrink: 0;
}

.deco-card-files .dec-adjuntos-previews {
    display: flex;
    gap: 4px;
    align-items: center;
}

.deco-card-files .dec-adjunto-thumb,
.deco-card-files .dec-adjunto-icon,
.deco-card-files .dec-adjunto-pdf {
    width: 32px;
    height: 32px;
}

.deco-card-badge {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.deco-card-locations-btn {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 4px;
}

.deco-card-docs-btn {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 4px;
}

/* Decorado Documents Grid Viewer */
.deco-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.deco-doc-card {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.deco-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.deco-doc-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.deco-doc-thumb-loading {
    background: var(--bg-secondary);
    animation: dec-thumb-pulse 1s ease-in-out infinite alternate;
}

.deco-doc-thumb-loaded {
    background-color: transparent;
}

.deco-doc-thumb-pdf {
    background: #fef2f2;
}

.deco-doc-thumb-pdf svg {
    width: 64px;
    height: 64px;
}

.deco-doc-thumb-icon {
    background: var(--bg-secondary);
}

.deco-doc-thumb-icon span {
    font-size: 2.5rem;
}

.deco-doc-info {
    padding: 8px;
}

.deco-doc-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deco-doc-size {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

@media (max-width: 600px) {
    .deco-docs-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

.deco-loc-fav-heart {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #ef4444;
    font-size: 0.85rem;
    pointer-events: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Nested package rows inside decorado card */
.deco-card-packages {
    display: flex;
    flex-direction: column;
}

.deco-pkg-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 12px 40px;
    border-bottom: 1px solid var(--border-light, var(--border));
    flex-wrap: wrap;
    position: relative;
    transition: background 0.12s;
}

.deco-pkg-row::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.deco-pkg-row:last-child {
    border-bottom: none;
}

.deco-pkg-row:last-child::before {
    bottom: 50%;
}

.deco-pkg-row:hover {
    background: var(--bg-secondary);
}

.deco-pkg-row.expired {
    opacity: 0.6;
}

.deco-pkg-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 150px;
    overflow: hidden;
}

.deco-pkg-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.deco-pkg-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.deco-pkg-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    flex: 0 0 50px;
    min-width: 50px;
    justify-content: center;
}

.deco-pkg-likes-heart {
    font-size: 0.75rem;
    color: #d4d4d4;
    transition: color 0.2s, background 0.2s;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.deco-pkg-likes.has-likes .deco-pkg-likes-heart {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.deco-pkg-likes.has-likes {
    color: #ef4444;
    font-weight: 600;
}

.deco-pkg-likes-count {
    font-variant-numeric: tabular-nums;
}

/* Package table header row */
.deco-pkg-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px 8px 40px;
    border-bottom: 2px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.deco-pkg-header-row .deco-pkg-main {
    font-size: inherit;
    font-weight: inherit;
}

.deco-pkg-header-row .deco-pkg-meta {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.deco-pkg-likes-header {
    min-width: 50px;
    flex: 0 0 50px;
    text-align: center;
}

.deco-pkg-actions-header {
    min-width: 100px;
    flex: 0 0 100px;
    text-align: center;
}

.deco-pkg-folder {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
}

.deco-pkg-desc-col {
    flex: 1 1 0;
    min-width: 120px;
    overflow: hidden;
}

.deco-pkg-desc {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary, var(--text-muted));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deco-pkg-header-row .deco-pkg-desc-col {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.deco-pkg-opened {
    color: var(--text-muted);
    white-space: nowrap;
}

.deco-pkg-meta {
    display: flex;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex: 1.5 1 0;
    min-width: 0;
}

.deco-pkg-meta > span {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deco-pkg-actions {
    display: flex;
    gap: 6px;
    min-width: 100px;
    flex-shrink: 0;
}

/* No-decorado card */
.deco-card-no-decorado {
    border-style: dashed;
    opacity: 0.85;
}

.deco-card-no-decorado .deco-card-badge {
    color: var(--text-muted);
    background: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .deco-card-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .deco-card-files {
        display: none;
    }

    .deco-pkg-row {
        padding: 10px 14px 10px 30px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .deco-pkg-row::before {
        left: 16px;
    }

    .deco-pkg-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .deco-pkg-header-row {
        display: none;
    }
}

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

/* Decorado file lightbox */
.dec-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.dec-lightbox-overlay.show {
    display: flex;
}

.dec-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dec-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s;
}

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

.dec-lightbox-img {
    max-width: 85vw;
    max-height: 75vh;
    border-radius: 8px;
    object-fit: contain;
    transition: opacity 0.3s;
}

.dec-lightbox-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dec-lightbox-name {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Expanded Decorado Row in Form */
.decorado-row-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.decorado-row-top {
    display: flex;
    gap: 8px;
    align-items: center;
}

.decorado-row-top .decorado-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
}

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

.decorado-desc-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

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

.decorado-row-file {
    display: flex;
    align-items: center;
    gap: 8px;
}

.decorado-file-label {
    cursor: pointer;
    white-space: nowrap;
}

.decorado-file-names {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.decorados-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.decorado-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.decorado-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.decorado-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.decorado-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

/* Decorado Detail View */

.decorado-detail-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.decorado-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.decorado-detail-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.decorado-detail-name h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

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

.decorado-name-edit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.decorado-name-edit-input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    min-width: 250px;
}

.decorado-detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.decorado-section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.decorado-descripcion-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.decorado-descripcion-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.decorado-save-desc-btn {
    margin-top: 10px;
}

/* Decorado Files */

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

.decorado-files-header .decorado-section-label {
    margin-bottom: 0;
}

.decorado-upload-btn {
    cursor: pointer;
}

.decorado-files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.decorado-files-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

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

.decorado-file-row:last-child {
    border-bottom: none;
}

.decorado-file-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.decorado-file-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.decorado-file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.decorado-file-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .decorados-cards {
        grid-template-columns: 1fr;
    }

    .decorados-table-desc {
        max-width: 200px;
    }

    .decorado-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .decorado-name-edit-input {
        min-width: 0;
        width: 100%;
    }

    .decorado-files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .decorado-row-file {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Project Share Bar */
.project-share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
}

.project-share-url {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.project-share-url .share-url-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.project-access-key {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.access-key-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.access-key-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #92400e;
    letter-spacing: 2px;
    background: transparent;
    padding: 0;
}

@media (max-width: 768px) {
    .project-share-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .project-share-url {
        flex-direction: column;
    }

    .project-share-url .share-url-input {
        width: 100%;
    }

    .project-form-grid,
    .project-form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ── Director Share Bar ── */
.project-director-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-top: 8px;
}

.project-director-bar .director-bar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #6d28d9;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-director-bar .share-url-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #c4b5fd;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: white;
}

.project-director-bar .project-access-key {
    background: #ede9fe;
    border-color: #c4b5fd;
}

.project-director-bar .access-key-value {
    color: #5b21b6;
}

/* Director selection badge in deco card */
.deco-director-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px 10px 40px;
    border-top: 1px solid var(--border-light, var(--border));
    background: #faf5ff;
    font-size: 0.82rem;
}

.deco-director-selection-icon {
    font-size: 0.9rem;
}

.deco-director-selection-label {
    font-weight: 600;
    color: #6d28d9;
}

.deco-director-selection-count {
    font-weight: 700;
    color: #7c3aed;
    background: #ede9fe;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
}

.deco-director-selection .btn-small {
    margin-left: auto;
    background: #7c3aed;
    color: white;
    border: none;
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.deco-director-selection .btn-small:hover {
    background: #6d28d9;
}

@media (max-width: 768px) {
    .project-director-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== End Projects Section ===== */

.my-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    gap: 20px;
}

.my-package-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}

.my-package-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.my-package-card.expired {
    opacity: 0.7;
    background: #fafafa;
}

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

.my-package-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.package-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.package-status-active {
    background: #dcfce7;
    color: #16a34a;
}

.package-status-expired {
    background: #fee2e2;
    color: #dc2626;
}

.package-opened {
    font-size: 0.8rem;
    color: #16a34a;
}

.package-unopened {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.badge-project {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #dcfce7;
    color: #16a34a;
    white-space: nowrap;
}

.badge-no-project {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fef9c3;
    color: #a16207;
    white-space: nowrap;
}

.my-package-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.my-package-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.my-package-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* Package Details Modal */
.package-details-content {
    padding: 0;
}

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

.package-details-header h3 {
    font-size: 1.3rem;
    margin: 0;
}

.package-details-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.package-details-info {
    background: var(--bg-hover);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.info-value {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-url-input {
    flex: 1;
    padding: 8px;
    font-size: 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.package-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.package-item-card {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.package-item-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.package-item-thumb.clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}

.package-item-thumb.clickable:hover {
    opacity: 0.85;
}

.package-item-info {
    padding: 8px;
}

.package-item-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.package-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.package-item-type {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.btn-tiny {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.65rem;
    line-height: 1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all 0.15s;
}

.btn-tiny.btn-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Admin Packages Table */
.packages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.packages-table th,
.packages-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.packages-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
}

.packages-table tbody tr:hover {
    background: var(--bg-hover);
}

.packages-table .row-expired {
    background: #fafafa;
    opacity: 0.8;
}

.table-responsive {
    overflow-x: auto;
}

.table-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: var(--bg-hover);
}

/* ============================================
   Analytics Dashboard - KPI Cards
   ============================================ */

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s, transform 0.15s;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.kpi-blue { background: #eff6ff; }
.kpi-green { background: #f0fdf4; }
.kpi-orange { background: #fff7ed; }
.kpi-purple { background: #faf5ff; }
.kpi-cyan { background: #ecfeff; }
.kpi-red { background: #fef2f2; }

.kpi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Analytics Panels
   ============================================ */

.analytics-panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.analytics-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

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

/* Bar Charts */
.analytics-chart-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-bar-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    min-width: 120px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.analytics-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.analytics-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.analytics-bar-blue { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.analytics-bar-green { background: linear-gradient(90deg, #4ade80, #22c55e); }
.analytics-bar-purple { background: linear-gradient(90deg, #c084fc, #a855f7); }
.analytics-bar-cyan { background: linear-gradient(90deg, #22d3ee, #06b6d4); }

.analytics-bar-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* Engagement Grid */
.analytics-engagement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.engagement-metric {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
}

.engagement-metric-highlight {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.engagement-metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.engagement-metric-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
}

.engagement-mini-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.engagement-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Timeline */
.analytics-timeline {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.timeline-item:hover {
    background: var(--bg-hover);
}

.timeline-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.timeline-desc {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.timeline-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Table Header with Filters */
.analytics-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.analytics-table-header h2 {
    margin-bottom: 0 !important;
}

.analytics-table-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.analytics-search-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 180px;
}

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

.analytics-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input, #fff);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

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

/* Table Metric Cells */
.table-metric {
    font-weight: 600;
    color: var(--text-primary);
}

.table-metric-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Empty State Small */
.empty-state-small {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 24px 12px;
}

/* Activity Section Block */
.activity-section-block {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.activity-section-block h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Package Activity Modal */
.package-activity-content h3 {
    margin-bottom: 20px;
}

.activity-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.activity-stat {
    background: var(--bg-hover);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
}

.activity-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.activity-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.activity-dates {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-log-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-log-item {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.activity-log-item .activity-time {
    color: var(--text-muted);
    min-width: 160px;
}

.activity-log-item .activity-ip {
    color: var(--text-secondary);
}

.activity-log-item .activity-detail {
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .project-summary-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .project-summary-columns > .project-summary-section + .project-summary-section {
        border-top: 1px solid var(--border);
        margin-top: 12px;
        padding-top: 12px;
    }

    .project-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .project-info-grid.compact {
        grid-template-columns: 1fr 1fr;
    }

    .project-package-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-pkg-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .my-packages-grid {
        grid-template-columns: 1fr;
    }

    .activity-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .my-package-details {
        grid-template-columns: 1fr;
    }

    .packages-table {
        font-size: 0.78rem;
    }

    .packages-table th,
    .packages-table td {
        padding: 8px 6px;
    }
}

/* ============================================
   Mobile Header & Sidebar Toggle
   ============================================ */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 999;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border: none;
    background: none;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.2s;
}

.mobile-logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.btn-cart-mobile {
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
}

.btn-cart-mobile .cart-badge {
    position: absolute;
    top: 2px;
    right: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

/* Mobile Header Right Group */
.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Mobile User Button & Dropdown */
.mobile-user-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Avatar inside bottom nav: smaller */
.mobile-nav-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-user-dropdown {
    display: none;
    position: fixed;
    bottom: 62px;
    right: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 12px 16px;
    z-index: 1002;
    min-width: 220px;
}

.mobile-user-dropdown.show {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.mobile-user-logout {
    padding: 8px 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    min-width: 56px;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.mobile-nav-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.mobile-nav-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

/* ============================================
   Photo Modal Actions (download, link, cart)
   ============================================ */

.photo-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.photo-modal-actions .btn {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: center;
    width: 100%;
}

.photo-modal-actions .btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.photo-modal-actions .btn.btn-primary {
    background: var(--primary);
    color: var(--primary-text);
    border-color: var(--primary);
}

.photo-modal-actions .btn.btn-primary:hover {
    background: var(--primary-hover);
}

.photo-modal-actions .modal-cart-action {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.photo-description,
.photo-tags,
.photo-camera-info,
.photo-directory {
    margin-bottom: 14px;
}

/* Fullscreen button on photo */
.btn-fullscreen {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.4rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fullscreen:hover {
    background: var(--primary);
}

.photo-modal-image img {
    cursor: zoom-in;
}

/* ============================================
   Fullscreen Photo Viewer
   ============================================ */

.fullscreen-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.fullscreen-viewer.show {
    display: flex;
}

.fullscreen-viewer-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    overflow: hidden;
}

.fullscreen-viewer-content img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transition: transform 0.15s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.fullscreen-zoom-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.fullscreen-zoom-hint.show {
    opacity: 1;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.8rem;
    transition: background 0.2s;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2.2rem;
    transition: background 0.2s;
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.fullscreen-prev {
    left: 24px;
}

.fullscreen-next {
    right: 24px;
}

/* Search results container */
.search-results-container {
    display: block;
}

/* ============================================
   Bulk Select for Search Results
   ============================================ */

.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.bulk-actions-bar .btn-select-all {
    padding: 6px 14px;
    font-size: 0.85rem;
    border: 1px solid var(--primary);
    background: var(--bg-card);
    color: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-actions-bar .btn-select-all:hover,
.bulk-actions-bar .btn-select-all.active {
    background: var(--primary);
    color: white;
}

.bulk-actions-bar .btn-add-selected {
    padding: 6px 14px;
    font-size: 0.85rem;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-actions-bar .btn-add-selected:hover {
    background: var(--primary-hover);
}

.bulk-actions-bar .btn-add-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bulk-actions-bar .selected-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.file-item.selected {
    background: var(--primary-light);
    border-color: var(--primary);
}

.file-select-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    align-self: center;
}

/* ============================================
   CRUD Screens (Accounts, Contacts, Locations)
   ============================================ */

.crud-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.crud-filters input,
.crud-filters select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 180px;
}

.crud-filters input {
    flex: 1;
    min-width: 220px;
}

.crud-filters input:focus,
.crud-filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.crud-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.crud-stat-badge {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 4px 12px;
    border-radius: 20px;
}

.crud-stat-badge strong {
    color: var(--text-primary);
}

.crud-table-container {
    overflow-x: auto;
}

.crud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.crud-table th,
.crud-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.crud-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.crud-table tbody tr {
    transition: background 0.12s;
}

.crud-table tbody tr:hover {
    background: var(--bg-hover);
}

.crud-table code {
    font-size: 0.82rem;
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--primary);
}

.crud-table .crud-coords {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
}

.btn-edit-crud {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-edit-crud:hover {
    background: var(--primary) !important;
    color: white !important;
}

/* CRUD Pagination */
.crud-pagination {
    margin-top: 16px;
}

.crud-pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.btn-page {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-page:disabled,
.btn-page.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* CRUD responsive */
@media (max-width: 768px) {
    .crud-filters {
        flex-direction: column;
    }

    .crud-filters input,
    .crud-filters select {
        width: 100%;
        min-width: 0;
    }

    .crud-table {
        font-size: 0.78rem;
    }

    .crud-table th,
    .crud-table td {
        padding: 8px 8px;
    }

    .crud-table th:nth-child(n+4),
    .crud-table td:nth-child(n+4) {
        display: none;
    }

    .crud-table th:last-child,
    .crud-table td:last-child {
        display: table-cell;
    }

    .crud-pagination-controls {
        gap: 8px;
    }

    .btn-page {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* ============================================
   CRUD Modals - Form Grid Override
   ============================================ */

.project-form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 600px) {
    .project-form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* CRUD Detail Modal */
.crud-detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: 16px;
}

.crud-detail-field {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.crud-detail-field:nth-last-child(-n+2) {
    border-bottom: none;
}

.crud-detail-field.full-width {
    grid-column: 1 / -1;
}

.crud-detail-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.crud-detail-value {
    font-size: 0.92rem;
    color: var(--text-primary);
    word-break: break-word;
}

.crud-detail-value:empty::after,
.crud-detail-value .detail-empty {
    color: var(--text-muted);
    font-style: italic;
}

.crud-table tbody tr {
    cursor: pointer;
}

/* Detail view: section headers */
.crud-detail-section {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
    padding: 14px 0 6px;
    border-bottom: 2px solid var(--primary);
    margin-top: 4px;
}

.crud-detail-section:first-child {
    padding-top: 0;
    margin-top: 0;
}

/* Detail view: tags (subcategorias) */
.crud-tag {
    display: inline-block;
    font-size: 0.78rem;
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 2px 4px 2px 0;
}

/* Detail view: boolean badges */
.crud-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.crud-badge.badge-yes {
    background: #dcfce7;
    color: #166534;
}

.crud-badge.badge-no {
    background: #fef2f2;
    color: #991b1b;
}

/* Detail view: expandable JSON block */
.btn-json-toggle {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-json-toggle:hover {
    background: var(--primary);
    color: white;
}

.crud-json-block {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.crud-json-block.open {
    display: block;
}

@media (max-width: 600px) {
    .crud-detail-body {
        grid-template-columns: 1fr;
    }

    .crud-detail-field:last-child {
        border-bottom: none;
    }

    .crud-detail-field:nth-last-child(2) {
        border-bottom: 1px solid var(--border);
    }

    .crud-detail-section {
        padding-top: 10px;
    }
}

/* ============================================
   Development mode — yellow background
   Applied when body has class "dev-mode"
   ============================================ */

body.dev-mode {
    --bg-main: #fffde7;
    --bg-dark: #fff9c4;
    --bg-card: #fffef5;
    --bg-input: #fffef5;
}

body.dev-mode,
body.dev-mode .main-content,
body.dev-mode .file-item,
body.dev-mode .zoho-badges,
body.dev-mode .folder-thumbnail-card,
body.dev-mode .sync-modal,
body.dev-mode .auth-screen {
    background: #fffde7 !important;
}

body.dev-mode .sidebar {
    background: #fff9c4 !important;
}

body.dev-mode .mobile-bottom-nav {
    background: #fff9c4 !important;
}

