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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #6b7280;
    --secondary-hover: #4b5563;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --info: #3b82f6;
    --info-hover: #2563eb;
    --dark: #1f2937;
    --light: #f9fafb;
    --border: #e5e7eb;
    --text: #374151;
    --text-muted: #9ca3af;
    --bg: #f3f4f6;
    --card: #ffffff;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--dark);
    color: #fff;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0;
}

.nav-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon { font-size: 1.4rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-selection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 10px;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

.sel-badge-icon {
    font-size: 0.85rem;
}

.sel-badge-count {
    font-size: 0.95rem;
    min-width: 18px;
    text-align: center;
}

.sel-badge-text {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
}

.nav-user {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #9ca3af;
    border-left: 1px solid #374151;
}

.nav-logout {
    color: #fca5a5;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

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

.auth-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.auth-header h1 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.auth-info {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.card-body {
    padding: 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-header {
    margin-bottom: 28px;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar-link {
    flex-shrink: 0;
    text-decoration: none;
    display: block;
    line-height: 0;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
}

.user-avatar-empty {
    width: 56px;
    height: 56px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.user-avatar-empty:hover {
    background: var(--light);
    color: var(--primary);
    border-color: var(--primary);
}

.dashboard-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-muted);
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-badge {
    background: var(--border);
    color: var(--text);
    font-size: 0.75rem;
    padding: 1px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.tab-btn.active .tab-badge {
    background: var(--primary);
    color: #fff;
}

.tab-content {
    display: none;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

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

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.stat-blue .stat-icon { background: #e0e7ff; }
.stat-green .stat-icon { background: #d1fae5; }
.stat-purple .stat-icon { background: #ede9fe; }
.stat-orange .stat-icon { background: #fed7aa; }

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

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

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

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

/* Forms */
.form .form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border 0.2s;
    background: #fff;
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
}

.btn:hover { opacity: 0.9; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-hover); }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: var(--info-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-active, .badge-active { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-archived { background: #e5e7eb; color: #4b5563; }
.badge-supplier { background: #e0e7ff; color: #3730a3; }
.badge-client { background: #fce7f3; color: #831843; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Thumbnail in tables */
.thumb {
    width: 50px;
    height: 40px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--border);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Info */
.gallery-info {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

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

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

.info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 2px;
}

.gallery-desc, .album-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.share-link-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.share-link-box small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.share-link-copy {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.share-link-copy input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--light);
    color: var(--text);
    outline: none;
    min-width: 0;
}

.share-link-copy input:focus {
    border-color: var(--primary);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 24px;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Albums Grid */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.album-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.album-card > a { text-decoration: none; color: inherit; }

.album-cover {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: var(--border);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 12px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
}

.album-info {
    padding: 14px;
}

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

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

.album-actions {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
}

/* Photos Grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.photo-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    position: relative;
}

.photo-card:hover {
    transform: translateY(-2px);
}

.photo-card.selected {
    box-shadow: 0 0 0 3px var(--primary);
}

.photo-thumb {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: var(--border);
}

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

.photo-thumb a { display: block; width: 100%; height: 100%; }

.photo-actions {
    padding: 8px 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.photo-info {
    padding: 8px 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cover-badge {
    font-size: 0.75rem;
}

.photo-selection-count {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(16,185,129,0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

/* Client selection overlay */
.photo-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-card:hover .photo-select-overlay,
.photo-card.selected .photo-select-overlay {
    opacity: 1;
}

.select-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
}

.select-checkbox {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.3);
}

.select-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.selection-toolbar {
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    background: var(--light);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #eef2ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.upload-zone p {
    font-size: 1rem;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px !important;
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.upload-preview-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--border);
    aspect-ratio: 3/2;
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.upload-preview-item .upload-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 8px;
    text-align: center;
}

.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Client Galleries Grid */
.galleries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
}

.gallery-card:hover { transform: translateY(-2px); }

.gallery-card > a { text-decoration: none; color: inherit; display: block; }

.gallery-card-cover {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--border);
}

.gallery-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 16px;
    color: #fff;
}

.photo-count {
    font-size: 0.9rem;
    font-weight: 600;
}

.gallery-card-body {
    padding: 16px;
}

.gallery-card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.gallery-type {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.gallery-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.gallery-meta {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.selection-badge {
    color: var(--primary);
    font-weight: 600;
}

.deadline {
    font-size: 0.85rem;
    color: var(--warning);
    font-weight: 500;
    margin-top: 6px;
}

.client-info p {
    margin-bottom: 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Main content */
.main-content {
    padding-top: 28px;
    padding-bottom: 28px;
    min-height: calc(100vh - 60px - 73px);
}

/* Utilities */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--dark);
        padding: 12px;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .nav-user {
        border-left: none;
        padding: 8px 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .header-actions {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .form-inline {
        flex-direction: column;
    }
}

/* Client Selections */
.client-selections .card-body {
    padding-top: 12px;
}

.sel-count-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
}

.sel-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.sel-status-badge.status-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.sel-status-badge.status-finalized {
    background: #dbeafe;
    color: #1e40af;
}

.header-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.selection-copy-area {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.selection-copy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.selection-copy-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.selection-copy-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    background: #fff;
    color: var(--text);
    resize: vertical;
    outline: none;
}

.selection-copy-text:focus {
    border-color: var(--primary);
}

.client-email {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.selection-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.selection-item {
    width: 120px;
    text-align: center;
}

.selection-thumb {
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border);
    border: 2px solid var(--success);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.selection-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.selection-name {
    font-size: 0.72rem;
    color: var(--text);
    margin-top: 4px;
    word-break: break-all;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 95vh;
}

.modal-close {
    position: fixed;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

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

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    font-size: 1.6rem;
    width: 52px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    z-index: 10;
    user-select: none;
}

.modal-nav:hover {
    background: rgba(255,255,255,0.25);
}

.modal-nav-first { left: 12px; }
.modal-nav-prev { left: 72px; }
.modal-nav-next { right: 72px; }
.modal-nav-last { right: 12px; }

/* Modal selection info bar (above image) */
.modal-selection-info {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(16,185,129,0.15);
    border-radius: 8px;
    margin-bottom: 12px;
    color: #34d399;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-sel-label {
    color: #ccc;
}

.modal-sel-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #34d399;
}

.modal-sel-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
}

.modal-sel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    animation: pulse-dot 1.4s infinite ease-in-out;
}

.modal-sel-dot:nth-child(1) { animation-delay: 0s; }
.modal-sel-dot:nth-child(2) { animation-delay: 0.2s; }
.modal-sel-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* Modal keyboard hint */
.modal-keyboard-hint {
    color: #888;
    font-size: 0.78rem;
    white-space: nowrap;
    margin-right: 10px;
}

.modal-keyboard-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: inherit;
    color: #ccc;
    background: rgba(255,255,255,0.1);
    border: 1px solid #555;
    border-radius: 4px;
    margin: 0 2px;
}

/* Prominent select button in modal */
.btn-select-modal {
    font-size: 1rem !important;
    padding: 10px 28px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.btn-select-modal.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
}

.btn-select-modal.btn-primary:hover {
    background: var(--primary-dark, #4338ca);
    transform: scale(1.03);
}

.btn-select-modal.btn-selected {
    background: var(--success, #10b981);
    color: #fff;
    border: none;
}

.btn-select-modal.btn-selected:hover {
    background: var(--success-dark, #059669);
    transform: scale(1.03);
}

.modal-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.modal-image {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.modal-footer {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #ccc;
}

.modal-counter {
    font-size: 0.9rem;
    font-weight: 500;
}

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

.modal-actions .btn {
    font-size: 0.82rem;
    padding: 6px 14px;
}

/* Photo click cursor */
.photo-thumb img {
    cursor: pointer;
}

/* Password toggle button */
.btn-pw-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    transition: color 0.2s, border-color 0.2s;
    line-height: 0;
}
.btn-pw-toggle:hover {
    color: var(--text);
    border-color: var(--primary);
}

/* Finalize selection modal */
.finalize-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.finalize-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.finalize-box {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1;
}

.finalize-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.finalize-box h2 {
    margin-bottom: 12px;
    color: var(--dark);
}

.finalize-msg {
    font-size: 1.05rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.finalize-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.finalize-question {
    font-weight: 600;
    margin: 16px 0;
    color: var(--dark);
}

.finalize-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.finalize-loading {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Confirmation modals (delete, form, etc) */
.delete-modal, .deleteall-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.delete-backdrop, .deleteall-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.delete-box, .deleteall-box {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1;
}

.delete-thumb-wrap {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--border);
}

.delete-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-question, .deleteall-question {
    font-weight: 600;
    margin: 12px 0 16px;
    color: var(--dark);
}

.delete-actions, .deleteall-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.delete-loading, .deleteall-loading {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.deleteall-msg {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.deleteall-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .modal-nav {
        width: 40px;
        height: 56px;
        font-size: 1.2rem;
    }
    .modal-nav-first { left: 4px; }
    .modal-nav-prev { left: 48px; }
    .modal-nav-next { right: 48px; }
    .modal-nav-last { right: 4px; }
    .modal-footer {
        flex-direction: column;
        gap: 8px;
        bottom: -80px;
    }
    .modal-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

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

    .galleries-grid {
        grid-template-columns: 1fr;
    }

    .selection-item {
        width: 90px;
    }

    .selection-thumb {
        width: 90px;
        height: 68px;
    }
}
