/**
 * Codélior Studio - Styles principaux
 * Design moderne avec les couleurs du logo Codélior
 *
 * @version 1.0.0
 */

/* ========================================
   FULLSCREEN MODE - Page autonome
   ======================================== */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

.codelior-studio-body {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg-body) !important;
}

.codelior-studio {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-body);
    overscroll-behavior: none;
}

/* Reset pour éviter conflits avec thèmes WordPress */
.codelior-studio *,
.codelior-studio *::before,
.codelior-studio *::after {
    box-sizing: border-box;
}

.codelior-studio button,
.codelior-studio input,
.codelior-studio select,
.codelior-studio textarea {
    font-family: inherit;
    font-size: inherit;
}

.codelior-studio a {
    text-decoration: none;
}

.codelior-studio button:focus,
.codelior-studio input:focus,
.codelior-studio select:focus,
.codelior-studio textarea:focus {
    outline: none;
}

/* ========================================
   CSS Variables - Thème Codélior
   ======================================== */
:root {
    /* Couleurs principales - Inspirées du logo Codélior */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;

    /* Couleurs accent - Logo Codélior */
    --codelior-magenta: #c678dd;
    --codelior-cyan: #56b6c2;
    --codelior-orange: #e5a03b;
    --codelior-yellow: #e5c07b;
    --codelior-blue: #61afef;
    --codelior-green: #42d6a4;
    
    /* Gradients Codélior */
    --accent-gradient: linear-gradient(135deg, #c678dd 0%, #56b6c2 50%, #42d6a4 100%);
    --accent-gradient-alt: linear-gradient(135deg, #e5a03b 0%, #c678dd 50%, #56b6c2 100%);
    --accent-blue: linear-gradient(135deg, #61afef 0%, #56b6c2 100%);
    --accent-success: #42d6a4;
    --accent-warning: #e5a03b;
    --accent-error: #e06c75;
    --accent-info: #61afef;

    /* Couleurs neutres */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Texte */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;

    /* Borders */
    --border-color: #e5e7eb;
    --border-radius-sm: 6px;
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Spacing */
    --header-height: 72px;
    --sidebar-width: 260px;
    --container-max: 1400px;
}

/* ========================================
   Reset & Base
   ======================================== */
.codelior-studio {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.codelior-studio *,
.codelior-studio *::before,
.codelior-studio *::after {
    box-sizing: border-box;
}

.codelior-studio a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition);
}

.codelior-studio a:hover {
    color: var(--primary-700);
}

.codelior-studio img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Typography
   ======================================== */
.codelior-studio h1,
.codelior-studio h2,
.codelior-studio h3,
.codelior-studio h4,
.codelior-studio h5,
.codelior-studio h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.codelior-studio h1 { font-size: 2.5rem; }
.codelior-studio h2 { font-size: 2rem; }
.codelior-studio h3 { font-size: 1.5rem; }
.codelior-studio h4 { font-size: 1.25rem; }
.codelior-studio h5 { font-size: 1.125rem; }
.codelior-studio h6 { font-size: 1rem; }

.codelior-studio p {
    margin: 0 0 1rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    outline: none !important;
}

.btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn-primary {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
    border: none !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    color: #ffffff !important;
}

.btn-primary:focus {
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39), 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary-600) !important;
    border: 2px solid var(--primary-600);
}

.btn-outline:hover {
    background: var(--primary-600);
    color: #ffffff !important;
}

.btn-success {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--accent-error);
    color: var(--text-inverse);
}

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

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

.btn-icon {
    padding: 10px;
    width: 44px;
    height: 44px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Header
   ======================================== */
.studio-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.studio-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    gap: 12px;
}

.studio-logo .logo-icon {
    height: 45px;
    width: auto;
}

.studio-logo img:not(.logo-icon) {
    height: 45px;
    width: auto;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--primary-600);
}

/* Navigation */
.studio-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item a {
    display: block;
    padding: 10px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all var(--transition);
}

.nav-item a:hover,
.nav-item.active a {
    color: var(--primary-600);
    background: var(--primary-50);
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}

.user-menu-toggle:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700, #0369a1));
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
}

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

.user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-menu-toggle i {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.user-menu.open .user-menu-toggle i {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-600);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item:hover i {
    color: var(--primary-600);
}

.dropdown-item .badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-error);
    color: white;
    border-radius: 50px;
}

.dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--border-color);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ========================================
   Sidebar
   ======================================== */
.studio-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 90;
}

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

.sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-header h3 i {
    font-size: 0.875rem;
}

.sidebar-nav {
    padding: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: var(--gray-50);
    color: var(--primary-600);
}

.sidebar-link.active {
    background: var(--primary-50);
    color: var(--primary-600);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
}

.sidebar-link:hover i,
.sidebar-link.active i {
    color: var(--primary-600);
}

.sidebar-link .badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-error);
    color: white;
    border-radius: 50px;
}

.sidebar-divider {
    height: 1px;
    margin: 12px 0;
    background: var(--border-color);
}

.sidebar-switch {
    background: linear-gradient(135deg, rgba(14,165,233,0.06), rgba(14,165,233,0.02));
    border: 1px dashed rgba(14,165,233,0.25);
    border-radius: 8px !important;
    margin: 4px 8px;
    font-weight: 600 !important;
}

/* Sidebar backdrop (hidden on desktop, shown via media query) */
.sidebar-backdrop {
    display: none;
}

/* Mobile-only elements hidden on desktop */
.mobile-nav-auth {
    display: none;
}

/* ========================================
   Bottom Bar (footer compact pour connectés)
   ======================================== */
.studio-bottombar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-card, #fff);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.studio-bottombar.with-sidebar {
    left: var(--sidebar-width);
}

.bb-copy {
    font-size: 11px;
    color: var(--text-muted);
}

.bb-menu-btn {
    height: 28px;
    padding: 0 10px;
    border: none;
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}
.bb-menu-btn i {
    font-size: 10px;
}
.bb-menu-btn:hover,
.bb-menu-btn.open {
    background: var(--primary-50);
    color: var(--primary-600);
}

.bb-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.bb-menu-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.bb-menu {
    position: fixed;
    bottom: 48px;
    right: 16px;
    width: 260px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-card, #fff);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 101;
    transform: translateY(8px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
    transform-origin: bottom right;
}
.bb-menu.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.bb-menu-section {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.bb-menu-section:last-child {
    border-bottom: none;
}

.bb-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 6px 12px 4px;
}

.bb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.15s;
    text-decoration: none;
}
.bb-link:hover {
    background: var(--gray-50);
    color: var(--primary-600);
}
.bb-link i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
.bb-link:hover i {
    color: var(--primary-500);
}

.bb-social {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
}
.bb-social a {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.15s;
    text-decoration: none;
}
.bb-social a:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

.bb-social-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}
.bb-social-inline a {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.15s;
    text-decoration: none;
}
.bb-social-inline a:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

/* ========================================
   Main Content
   ======================================== */
.studio-main {
    flex: 1;
    padding: 32px 24px;
}

.has-bottombar .studio-main {
    padding-bottom: 60px;
}

.studio-main.with-sidebar {
    margin-left: var(--sidebar-width);
}

.main-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* Page header */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    margin-bottom: 8px;
}

.page-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.page-header .breadcrumb a {
    color: var(--text-muted);
}

.page-header .breadcrumb a:hover {
    color: var(--primary-600);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

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

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

.stat-icon.blue {
    background: var(--primary-100);
    color: var(--primary-600);
}

.stat-icon.green {
    background: #d1fae5;
    color: #059669;
}

.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-icon.orange {
    background: #fef3c7;
    color: #d97706;
}

.stat-content h4 {
    margin: 0 0 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

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

.stat-change {
    margin-top: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--accent-success);
}

.stat-change.negative {
    color: var(--accent-error);
}

/* Stat card alert state */
.stat-card-alert {
    border-color: #f59e0b;
    background: #fffbeb;
    animation: pulseAlert 2s ease-in-out infinite;
}
@keyframes pulseAlert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }
}

/* Alert banners */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px;
    border: 1px solid;
}
.alert-banner-warning {
    background: #fffbeb;
    border-color: #fde68a;
}
.alert-banner-info {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.alert-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.alert-banner-warning .alert-banner-icon {
    background: #fef3c7;
    color: #d97706;
}
.alert-banner-info .alert-banner-icon {
    background: #dbeafe;
    color: #2563eb;
}
.alert-banner-content {
    flex: 1;
    min-width: 0;
}
.alert-banner-content h4 {
    margin: 0 0 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}
.alert-banner-item {
    padding: 8px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.alert-banner-item:first-child {
    border-top: none;
    padding-top: 0;
}
.alert-banner-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8125rem;
}
.alert-banner-message {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.alert-banner-action {
    flex-shrink: 0;
}
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

/* Sidebar badge warning */
.sidebar-link .badge-warning {
    background: #f59e0b;
    color: #fff;
}
.sidebar-link .badge-info {
    background: #3b82f6;
    color: #fff;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--accent-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

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

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

.form-hint {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-error {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--accent-error);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--accent-error);
}

/* Checkbox / Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.form-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary-600);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* ========================================
   Tables
   ======================================== */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

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

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

.data-table th {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ========================================
   Footer
   ======================================== */
.studio-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 30px 0 0;
    margin-top: auto;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-700);
}

.footer-col h4 {
    color: white;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.footer-col p {
    font-size: 0.8125rem;
    line-height: 1.5;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 6px;
}

.footer-col ul a {
    color: var(--gray-400);
    font-size: 0.8125rem;
    transition: color var(--transition);
}

.footer-col ul a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.footer-social a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-800);
    color: var(--gray-400);
    border-radius: 50%;
    font-size: 0.8rem;
    transition: all var(--transition);
}

.footer-social a:hover {
    background: var(--primary-600);
    color: white;
}

.footer-bottom {
    padding: 10px 0;
    text-align: center;
    font-size: 0.7rem;
}

/* ========================================
   Loader
   ======================================== */
.studio-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.studio-loader.active {
    opacity: 1;
    visibility: visible;
}

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

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

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: #d1fae5;
    color: #059669;
}

.toast.error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast.warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast.info .toast-icon {
    background: var(--primary-100);
    color: var(--primary-600);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition);
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* ========================================
   Responsive
   ======================================== */
/* ════════════════════════════════════════
   RESPONSIVE — Tablet (≤1024px)
   ════════════════════════════════════════ */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Sidebar becomes drawer overlay */
    .studio-sidebar {
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        z-index: 200;
        box-shadow: none;
    }
    
    .studio-sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,.12);
    }
    
    .studio-main.with-sidebar {
        margin-left: 0;
    }
    
    .studio-bottombar.with-sidebar {
        left: 0;
    }

    /* Sidebar backdrop */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        top: var(--header-height);
        background: rgba(0,0,0,.35);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: all;
    }
}

/* ════════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   ════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }
    
    /* ── Header compact ── */
    .studio-nav {
        display: none;
    }
    .studio-nav.open {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-card, #fff);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 8px 32px rgba(0,0,0,.1);
        z-index: 190;
        padding: 8px;
        animation: mobileNavSlide .25s cubic-bezier(.4,0,.2,1);
    }
    @keyframes mobileNavSlide {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .studio-nav.open .nav-menu {
        flex-direction: column;
        gap: 2px;
    }
    .studio-nav.open .nav-item a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        font-size: 15.5px;
        font-weight: 500;
        border-radius: 12px;
        color: var(--text-secondary);
    }
    .studio-nav.open .nav-item.active a {
        background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(56,189,248,.04));
        color: var(--primary-700);
    }
    /* Mobile auth buttons inside nav */
    .mobile-nav-auth {
        display: flex;
        gap: 10px;
        padding: 14px 8px 6px;
        border-top: 1px solid var(--border-color);
        margin-top: 6px;
    }
    .mobile-nav-auth .btn {
        display: flex;
        flex: 1;
        justify-content: center;
        padding: 13px 16px;
        font-size: 14px;
        border-radius: 12px;
    }
    .mobile-nav-auth .btn-primary {
        box-shadow: 0 2px 8px rgba(14,165,233,.25);
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .header-actions .btn {
        display: none;
    }
    .user-name {
        display: none;
    }
    .user-menu-toggle {
        padding: 4px 8px 4px 4px;
    }
    .user-menu-toggle i.fa-chevron-down {
        display: none;
    }
    .user-avatar { width: 32px; height: 32px; }
    .studio-logo .logo-icon { height: 36px; }
    .studio-logo img:not(.logo-icon) { height: 36px; }
    .logo-text { font-size: 1.3rem; }
    .header-container { padding: 0 16px; gap: 12px; }

    /* Notification bell compact */
    .notif-bell-btn { width: 36px; height: 36px; font-size: 14px; border-radius: 8px; }
    
    /* Notification dropdown → fullscreen sheet on mobile */
    .notif-dropdown {
        position: fixed !important;
        top: var(--header-height) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        z-index: 1050 !important;
    }
    .notif-dropdown-body {
        max-height: none !important;
        flex: 1 !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Hamburger → X animation ── */
    .mobile-menu-toggle { width: 40px; height: 40px; padding: 8px; }
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* ── User dropdown fullscreen on mobile ── */
    .user-dropdown {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        min-width: 100%;
        border-radius: 0 0 16px 16px;
        border-left: none;
        border-right: none;
        max-height: calc(100vh - var(--header-height) - 60px);
        overflow-y: auto;
    }
    .dropdown-item {
        padding: 14px 20px;
        font-size: 1rem;
    }
    .dropdown-item i { font-size: 1rem; width: 22px; }

    /* ── Footer & bottom bar ── */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .alert-banner {
        flex-wrap: wrap;
    }
    .alert-banner-action {
        width: 100%;
        text-align: center;
    }
    
    /* ── Typography ── */
    .codelior-studio h1 { font-size: 1.75rem; }
    .codelior-studio h2 { font-size: 1.35rem; }
    .codelior-studio h3 { font-size: 1.15rem; }
    
    /* ── Main content ── */
    .studio-main {
        padding: 20px 16px;
    }
    .has-bottombar .studio-main {
        padding-bottom: 84px; /* space for 64px mobile tab bar */
    }

    /* ── Page headers compact ── */
    .cdl-page-head { margin-bottom: 20px; }
    .cdl-page-head h1 { font-size: 20px; gap: 8px; }
    .cdl-page-head h1 i { font-size: 18px; }
    .page-header { margin-bottom: 20px; }

    /* ── Desktop bottom bar: hidden on mobile ONLY when tab bar is present ── */
    .has-tabbar .studio-bottombar {
        display: none !important;
    }
    .has-tabbar .bb-menu,
    .has-tabbar .bb-menu-overlay {
        display: none !important;
    }
    /* Bottombar compact for visitors on mobile */
    .studio-bottombar {
        height: 44px;
        padding: 0 12px;
    }
    .bb-social-inline a { width: 26px; height: 26px; font-size: 11px; }
    .bb-copy { font-size: 10px; }
    .bb-menu-btn { font-size: 10px; height: 26px; padding: 0 8px; }
    .bb-menu-btn span { display: none; }

    /* ── Mobile Tab Bar ── */
    .mobile-tabbar {
        display: flex !important;
    }

    /* ── Cards ── */
    .card-header { padding: 16px; }
    .card-body { padding: 16px; }
    .card-footer { padding: 16px; }

    /* ── Forms ── */
    .form-row { flex-direction: column; gap: 0; }
    .form-group { margin-bottom: 16px; }

    /* ── Buttons wrap ── */
    .btn { padding: 12px 20px; font-size: 0.875rem; }
    .btn-sm { padding: 8px 14px; }

    /* ── Tables responsive ── */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

    /* ── Scroll lock when sidebar open ── */
    body.sidebar-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }
}

/* ════════════════════════════════════════
   RESPONSIVE — Small phone (≤480px)
   ════════════════════════════════════════ */
@media (max-width: 480px) {
    .notif-dropdown { /* handled in 768px block */ }

    .codelior-studio h1 { font-size: 1.5rem; }
    .codelior-studio h2 { font-size: 1.2rem; }

    .studio-main { padding: 16px 12px; }

    .logo-text { font-size: 1.15rem; }
    .studio-logo .logo-icon { height: 30px; }

    .cdl-page-head h1 { font-size: 18px; flex-wrap: wrap; }
}

/* ════════════════════════════════════════
   MOBILE TAB BAR — Premium design
   ════════════════════════════════════════ */
.mobile-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(0,0,0,.06);
    z-index: 200;
    align-items: stretch;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-tabbar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    position: relative;
    transition: color .2s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
    padding: 8px 2px 6px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-tabbar .tab-item i {
    font-size: 20px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    position: relative;
    z-index: 1;
}

.mobile-tabbar .tab-item span {
    position: relative;
    z-index: 1;
    letter-spacing: .2px;
}

/* Active state with pill background */
.mobile-tabbar .tab-item.active {
    color: var(--primary-700);
}
.mobile-tabbar .tab-item.active i {
    transform: translateY(-1px);
}
.mobile-tabbar .tab-item.active::before {
    display: none;
}
@keyframes tabPillIn {
    from { transform: translateX(-50%) scale(.6); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Tab badge */
.mobile-tabbar .tab-item .tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239,68,68,.3);
    z-index: 2;
}

/* Icon-only tabs (manager) */
.mobile-tabbar .tab-item.tab-icon-only span { display: none; }
.mobile-tabbar .tab-item.tab-icon-only i { font-size: 22px; }
.mobile-tabbar .tab-item.tab-icon-only { gap: 0; padding: 12px 2px 10px; }

/* Manager icon-only active colors — each tab gets its own color */
.tabbar-manager .tab-item.tab-icon-only.active { color: var(--primary-600); }
.tabbar-manager .tab-item.tab-icon-only.active::before { display: none; }

/* ════════════════════════════════════════
   CENTER HOME BUTTON — Manager tab bar
   ════════════════════════════════════════ */
.mobile-tabbar.tabbar-manager {
    height: 68px;
}
.tab-home-wrap {
    flex: none;
    width: 64px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.tab-home-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    box-shadow: 0 4px 16px rgba(14,165,233,.35), 0 0 0 4px rgba(14,165,233,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 22px;
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    transition: all .2s cubic-bezier(.4,0,.2,1);
    z-index: 2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.tab-home-btn i { color: #fff !important; }
.tab-home-btn:active {
    transform: translateX(-50%) scale(.9);
}
.tab-home-btn.active {
    background: linear-gradient(135deg, #0369a1, #075985);
    box-shadow: 0 4px 20px rgba(14,165,233,.45), 0 0 0 5px rgba(14,165,233,.18);
}

/* Manager tab bar: extra bottom padding for content */
.tabbar-manager ~ .mobile-more-panel {
    bottom: 68px;
}

/* Safe-area bottom margin for rounded screens */
.mobile-tabbar {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
}
.mobile-tabbar.tabbar-manager {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
}

/* ════════════════════════════════════════
   SIDEBAR CATEGORIES — Manager
   ════════════════════════════════════════ */
.sidebar-categorized {
    padding: 8px 10px 20px;
}
.sidebar-dashboard-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px !important;
    margin-bottom: 6px;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(14,165,233,.1), rgba(56,189,248,.05));
    font-weight: 700 !important;
}
.sidebar-dashboard-link i {
    font-size: 17px !important;
    color: var(--primary-600) !important;
}
.sidebar-dashboard-link span {
    font-size: 15px;
    color: var(--primary-700);
}
.sidebar-dashboard-link.active {
    background: linear-gradient(135deg, rgba(14,165,233,.15), rgba(56,189,248,.08)) !important;
}

/* Category headers */
.sidebar-cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 10px 4px;
}
.sidebar-cat-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.sidebar-cat-icon.cat-blue    { background: #eff6ff; color: #3b82f6; }
.sidebar-cat-icon.cat-purple  { background: #f5f3ff; color: #8b5cf6; }
.sidebar-cat-icon.cat-emerald { background: #ecfdf5; color: #10b981; }
.sidebar-cat-icon.cat-amber   { background: #fffbeb; color: #f59e0b; }
.sidebar-cat-icon.cat-gray    { background: #f3f4f6; color: #6b7280; }

.sidebar-cat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-400);
}
.sidebar-cat-line {
    flex: 1;
    height: 1px;
    background: var(--gray-100);
}

/* Switch link style */
.sidebar-switch {
    background: linear-gradient(135deg, rgba(14,165,233,.06), rgba(14,165,233,.02)) !important;
    border: 1px dashed rgba(14,165,233,.25) !important;
    border-radius: 10px !important;
    margin: 6px 4px !important;
    font-weight: 600 !important;
    color: var(--primary-600) !important;
}
.sidebar-switch i {
    color: var(--primary-600) !important;
}

/* ════════════════════════════════════════
   MORE PANEL — Premium bottom sheet
   ════════════════════════════════════════ */
.mobile-more-panel {
    position: fixed;
    bottom: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card, #fff);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 48px rgba(0,0,0,.15);
    z-index: 199;
    max-height: calc(100vh - 64px - var(--header-height, 56px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: all .35s cubic-bezier(.32,1.2,.54,1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-more-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}
.mobile-more-panel .more-handle {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: var(--gray-200);
    margin: 12px auto 8px;
}

/* Section headers */
.mobile-more-panel .more-section {
    padding: 6px 14px;
}
.mobile-more-panel .more-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-400);
    padding: 12px 10px 6px;
}

/* Links with icon backgrounds */
.mobile-more-panel .more-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 14px;
    transition: all .15s;
    text-decoration: none;
}
.mobile-more-panel .more-link:active {
    background: var(--gray-50);
    transform: scale(.98);
}
.mobile-more-panel .more-link.active {
    background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(56,189,248,.04));
    color: var(--primary-700);
}

/* Icon circles */
.mobile-more-panel .more-link i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-muted);
    background: var(--gray-50);
    flex-shrink: 0;
    transition: all .15s;
}
.mobile-more-panel .more-link.active i {
    background: var(--primary-100);
    color: var(--primary-600);
}
/* Colored icon variants */
.mobile-more-panel .more-link i.ic-blue { background: #eff6ff; color: #3b82f6; }
.mobile-more-panel .more-link i.ic-purple { background: #f5f3ff; color: #8b5cf6; }
.mobile-more-panel .more-link i.ic-amber { background: #fffbeb; color: #f59e0b; }
.mobile-more-panel .more-link i.ic-emerald { background: #ecfdf5; color: #10b981; }
.mobile-more-panel .more-link i.ic-rose { background: #fff1f2; color: #f43f5e; }
.mobile-more-panel .more-link i.ic-cyan { background: #ecfeff; color: #06b6d4; }
.mobile-more-panel .more-link i.ic-sky { background: #f0f9ff; color: #0284c7; }
.mobile-more-panel .more-link i.ic-gray { background: #f3f4f6; color: #6b7280; }
.mobile-more-panel .more-link .badge {
    margin-left: auto;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    border-radius: 50px;
    box-shadow: 0 2px 6px rgba(239,68,68,.2);
}
.mobile-more-panel .more-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 6px 16px;
}

/* Danger link (logout) */
.mobile-more-panel .more-link.danger {
    color: var(--accent-error);
}
.mobile-more-panel .more-link.danger i {
    background: #fef2f2;
    color: var(--accent-error);
}

/* Footer with social + copyright */
.mobile-more-panel .more-footer {
    padding: 18px 16px 22px;
    border-top: 1px solid var(--gray-100);
    text-align: center;
}
.mobile-more-panel .more-social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}
.mobile-more-panel .more-social a {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 15px;
    transition: all .15s;
    text-decoration: none;
}
.mobile-more-panel .more-social a:active {
    background: var(--primary-50);
    color: var(--primary-600);
    transform: scale(.92);
}
.mobile-more-panel .more-copy {
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: .2px;
}

/* Backdrop */
.mobile-more-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 198;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.mobile-more-backdrop.open {
    display: block;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Sidebar mobile enhancements ── */
@media (max-width: 1024px) {
    .studio-sidebar {
        width: 280px;
        top: 0;
        height: 100vh;
        padding-top: var(--header-height);
        display: flex;
        flex-direction: column;
        overflow-y: hidden; /* Nav handles scrolling, not parent */
    }
    .studio-sidebar .sidebar-header {
        padding-top: 20px;
        flex-shrink: 0;
    }
    /* Make nav scrollable, leave room for footer */
    .studio-sidebar .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    /* Footer sticks at bottom above tab bar */
    .studio-sidebar .sidebar-footer-mobile {
        border-top: 1px solid var(--gray-100);
        padding: 12px 14px;
        flex-shrink: 0;
        background: var(--bg-card, #fff);
    }
    .has-tabbar .studio-sidebar .sidebar-footer-mobile {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 4px) + 12px);
    }
}

/* Sidebar footer — mobile only */
.sidebar-footer-mobile { display: none; }
@media (max-width: 1024px) {
    .sidebar-footer-mobile {
        display: block;
    }
    .sidebar-footer-links {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 10px;
    }
    .sidebar-footer-links a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        font-size: 12px;
        color: var(--text-muted);
        text-decoration: none;
        border-radius: 8px;
        transition: all .15s;
    }
    .sidebar-footer-links a:active {
        background: var(--gray-50);
    }
    .sidebar-footer-links a i {
        font-size: 11px;
        width: 14px;
        text-align: center;
    }
    .sidebar-footer-copy {
        font-size: 10px;
        color: var(--gray-400);
        text-align: center;
        padding-top: 8px;
    }
    .sidebar-footer-version {
        font-size: 9px;
        color: var(--gray-300);
        text-align: center;
        margin-top: 2px;
    }
}

/* ── Safe area inset for notched phones ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-tabbar {
        height: calc(64px + env(safe-area-inset-bottom));
    }
    .mobile-more-panel {
        bottom: calc(64px + env(safe-area-inset-bottom));
    }
    @media (max-width: 768px) {
        .has-bottombar .studio-main {
            padding-bottom: calc(84px + env(safe-area-inset-bottom));
        }
    }
}

/* ═══ In-App legal/about pages ═══ */
.in-app-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-600);
    text-decoration: none;
    margin-bottom: 14px;
    padding: 6px 12px 6px 8px;
    border-radius: 8px;
    transition: all .15s;
}
.in-app-back:hover { background: var(--primary-50); }
.in-app-back:active { transform: scale(.96); }
.in-app-back i { font-size: 11px; }

/* Compact hero for legal pages inside connected layout */
.in-app-content .legal-hero {
    padding: 24px 20px;
    border-radius: 14px;
    margin-bottom: 18px;
}
.in-app-content .legal-hero h1 { font-size: 22px; }
.in-app-content .legal-hero > p { font-size: 13px; }
.in-app-content .legal-hero-icon { width: 44px; height: 44px; font-size: 20px; }
.in-app-content .legal-page { padding: 10px 0; }
.in-app-content .legal-section { padding: 20px; border-radius: 14px; }

/* About page inside connected layout */
.in-app-content .page-about { padding-top: 0; }
.in-app-content .about-hero { padding-top: 20px; }

/* ════════════════════════════════════════
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-600); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-error); }
.text-warning { color: var(--accent-warning); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ═══════════ NOTIFICATION BELL ═══════════ */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
    position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--gray-200);
    background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.notif-bell-btn:hover { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-200); }
.notif-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px;
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center;
    justify-content: center; padding: 0 4px; border: 2px solid var(--bg-card); line-height: 1;
    animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.notif-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 360px; max-height: 480px;
    background: var(--bg-card); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    border: 1px solid var(--gray-200); overflow: hidden; z-index: 1050; flex-direction: column;
}
.notif-dropdown.active { display: flex; }
.notif-dropdown-header {
    display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200); flex-shrink: 0;
}
.notif-dropdown-header strong { font-size: 15px; color: var(--text-primary); }
.notif-mark-all {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; font-size: 14px; transition: all .2s;
}
.notif-mark-all:hover { background: var(--primary-50); color: var(--primary-600); }
.notif-dropdown-body { overflow-y: auto; flex: 1; max-height: 400px; }
.notif-item {
    display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); cursor: pointer;
    transition: background .15s; position: relative;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #eff6ff; }
.notif-item.unread:hover { background: #dbeafe; }
.notif-item .notif-actions {
    position: absolute; top: 8px; right: 10px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s;
}
.notif-item:hover .notif-actions { opacity: 1; }
.notif-actions .na-btn {
    width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; font-size: 11px; display: flex; align-items: center;
    justify-content: center; transition: all .15s;
}
.notif-actions .na-btn:hover { background: var(--gray-200); }
.notif-actions .na-btn.na-read:hover { color: #3b82f6; background: #eff6ff; }
.notif-actions .na-btn.na-del:hover { color: #ef4444; background: #fef2f2; }
.notif-item.removing { animation: notifSlideOut .25s ease forwards; }
@keyframes notifSlideOut { to { opacity: 0; max-height: 0; padding: 0 18px; overflow: hidden; margin: 0; border: none; } }
.notif-dropdown-header .notif-header-actions { display: flex; gap: 2px; }
.notif-dropdown-header .nh-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; font-size: 14px; transition: all .2s;
    display: flex; align-items: center; justify-content: center;
}
.notif-dropdown-header .nh-btn:hover { background: var(--primary-50); color: var(--primary-600); }
.notif-dropdown-header .nh-btn.nh-del:hover { background: #fef2f2; color: #ef4444; }
.notif-icon {
    width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff; flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-message { font-size: 12px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-empty i { font-size: 28px; margin-bottom: 10px; display: block; opacity: 0.4; }

/* (notification 480px responsive handled in main responsive block) */

/* ════════════════════════════════════════
   GLOBAL MODAL FIXES — Mobile scroll
   ════════════════════════════════════════ */
@media (max-width: 768px) {
    /* All fixed fullscreen modals → ensure scroll */
    .modal-pro .modal-container,
    .cls-modal-overlay > div,
    [style*="position:fixed"][style*="z-index:9999"] > div:not([class*="overlay"]) {
        max-height: 100vh;
        max-height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* modal-pro fullscreen body scroll */
    .modal-pro .modal-body-pro {
        padding: 20px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-pro .modal-header-pro {
        padding: 16px;
    }
    .modal-pro .modal-footer-pro {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .modal-pro .modal-footer-pro .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Inline-style modals (renew, RGPD, etc) → centered with scroll */
    [id="renew-modal"] > div:not(.renew-overlay) {
        margin: 16px auto !important;
        max-height: calc(100vh - 32px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Review modal */
    .rv-modal > div:not([style*="background"]):not(.rv-modal-overlay) {
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* RGPD modal */
    .rgpd-modal-overlay > div {
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* CLS modal (manager orders, quotes) */
    .cls-modal-overlay > div {
        max-width: calc(100vw - 32px) !important;
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Confirm/Alert modals → already good but ensure mobile width */
    #cdl-confirm-overlay > div,
    #cdl-alert-overlay > div {
        max-width: calc(100vw - 40px) !important;
    }
}

/* ═══ UNIFIED PAGE HEADERS (Outfit font) ═══ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

.cdl-page-head { margin-bottom: 28px; }
.cdl-page-head h1 {
    margin: 0 0 4px;
    font-family: 'Outfit', var(--font-family, sans-serif);
    font-size: 24px;
    font-weight: 700;
    color: #1c1917;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cdl-page-head h1 i { flex-shrink: 0; font-size: 22px; }
.cdl-page-head p,
.cdl-page-head .sp-info,
.cdl-page-head .page-subtitle {
    margin: 4px 0 0;
    font-family: 'Outfit', var(--font-family, sans-serif);
    font-size: 14px;
    color: #a8a29e;
}

/* ════════════════════════════════════════
   PWA SPLASH SCREEN — Logo animation
   ════════════════════════════════════════ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: splashFadeOut .4s ease 1.1s forwards;
    pointer-events: all;
}
.splash-screen.hidden { display: none; }
@keyframes splashFadeOut {
    to { opacity: 0; pointer-events: none; }
}

/* SVG paths draw-in */
.splash-svg .sp-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: splashDraw .55s cubic-bezier(.4,0,.2,1) forwards;
}
.splash-svg .sp-path-r { animation-delay: .08s; }
@keyframes splashDraw {
    to { stroke-dashoffset: 0; }
}

/* Dots pop in */
.splash-svg .sp-dot {
    opacity: 0;
    transform-origin: center;
    animation: splashDot .3s cubic-bezier(.34,1.56,.64,1) forwards;
}
.splash-svg .sp-d1 { animation-delay: .25s; }
.splash-svg .sp-d2 { animation-delay: .3s; }
.splash-svg .sp-d3 { animation-delay: .35s; }
.splash-svg .sp-d4 { animation-delay: .4s; }
.splash-svg .sp-d5 { animation-delay: .32s; }
.splash-svg .sp-d6 { animation-delay: .37s; }
.splash-svg .sp-d7 { animation-delay: .42s; }
@keyframes splashDot {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* Lines */
.splash-svg .sp-line {
    opacity: 0;
    animation: splashLine .25s ease forwards;
}
.splash-svg .sp-l1 { animation-delay: .2s; }
.splash-svg .sp-l2 { animation-delay: .22s; }
.splash-svg .sp-l3 { animation-delay: .24s; }
.splash-svg .sp-l4 { animation-delay: .26s; }
@keyframes splashLine {
    to { opacity: 1; }
}

/* Text fade up */
.splash-svg .sp-text {
    opacity: 0;
    animation: splashText .4s ease .55s forwards;
}
@keyframes splashText {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Skip splash on in-app navigation */
.splash-done .splash-screen { display: none !important; }

/* ════════════════════════════════════════
   PWA INSTALL BANNER
   ════════════════════════════════════════ */
.pwa-banner {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
    position: relative;
    z-index: 180;
    animation: pwaBannerSlide .4s cubic-bezier(.4,0,.2,1);
}
@keyframes pwaBannerSlide {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    max-width: 1200px;
    margin: 0 auto;
}
.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.pwa-banner-text {
    flex: 1;
    min-width: 0;
}
.pwa-banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}
.pwa-banner-text span {
    display: block;
    font-size: 12px;
    opacity: .85;
    line-height: 1.4;
    margin-top: 2px;
}
.pwa-banner-install {
    flex-shrink: 0;
    padding: 9px 20px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: #0284c7;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.pwa-banner-install:active {
    transform: scale(.96);
}
.pwa-banner-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    line-height: 1;
}
.pwa-banner-close:active {
    background: rgba(255,255,255,.3);
}

/* PWA banner mobile tweaks */
@media (max-width: 480px) {
    .pwa-banner-inner {
        gap: 10px;
        padding: 10px 12px;
    }
    .pwa-banner-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    .pwa-banner-text strong {
        font-size: 13px;
    }
    .pwa-banner-text span {
        font-size: 11px;
    }
    .pwa-banner-install {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* Hide banner in standalone (already installed) */
@media (display-mode: standalone) {
    .pwa-banner { display: none !important; }
}

/* iOS share icon in banner hint */
.pwa-share-icon {
    display: inline-block;
    font-size: 14px;
    vertical-align: middle;
    margin: 0 2px;
}
