/* ==========================================================================
   Bespoke Studio Portal CSS — Curious Designs
   Theme: Uber Dark & Refined Glassmorphism
   ========================================================================== */

/* Variables */
:root {
    --bg-main: #060608;
    --bg-darker: #030304;
    --bg-panel: rgba(13, 13, 17, 0.65);
    --bg-panel-solid: #0d0d11;
    --border-light: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    /* Brand Accents */
    --accent-primary: #ffffff;
    --accent-secondary: #a1a1aa;
    
    /* Input colors variables */
    --input-bg: rgba(10, 10, 14, 0.7);
    --input-color: #ffffff;
    
    /* Neon Statuses */
    --status-queue: #3b82f6;      /* Electric Blue */
    --status-progress: #f59e0b;   /* Amber */
    --status-review: #10b981;     /* Emerald Green */
    --status-overdue: #ef4444;    /* Crimson */
    --status-vip: #d4af37;        /* Gold */
    
    /* Fonts */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 25px rgba(255, 255, 255, 0.03);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light Theme Variables Workspace */
[data-theme="light"] {
    --bg-main: #f4f4f5;
    --bg-darker: #e4e4e7;
    --bg-panel: rgba(255, 255, 255, 0.75);
    --bg-panel-solid: #ffffff;
    --border-light: rgba(9, 9, 11, 0.08);
    --border-hover: rgba(9, 9, 11, 0.15);
    
    --accent-primary: #09090b;
    --accent-secondary: #71717a;
    
    --input-bg: #ffffff;
    --input-color: #09090b;
    
    --shadow-main: 0 8px 32px 0 rgba(9, 9, 11, 0.05);
    --shadow-glow: 0 0 25px rgba(9, 9, 11, 0.02);
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--accent-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ambient glow backgrounds */
.ambient-glow-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    right: -200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.ambient-glow-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -150px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.03) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Simulator Bar */
.simulator-bar {
    background: rgba(10, 10, 12, 0.9);
    border-bottom: 1px solid var(--border-light);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
}

.simulator-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.simulator-title .dot {
    width: 6px;
    height: 6px;
    background-color: var(--status-review);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--status-review);
}

.simulator-controls {
    display: flex;
    gap: 8px;
}

.role-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    color: var(--accent-secondary);
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.role-btn:hover {
    color: #fff;
    border-color: var(--border-hover);
}

.role-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Main Layout Grid */
.portal-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 53px);
    position: relative;
}

/* Sidebar Navigation */
.portal-sidebar {
    width: 260px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 20px;
    transition: var(--transition-smooth);
    z-index: 99;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-logo img {
    height: 28px;
    width: auto;
}

.sidebar-logo span {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--accent-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.sidebar-item a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-item a:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.sidebar-item.active a {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333 0%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--border-light);
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--accent-secondary);
}

/* Content Area */
.portal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.portal-topbar {
    height: 80px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(6, 6, 8, 0.4);
    backdrop-filter: blur(10px);
}

.topbar-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-bell {
    position: relative;
    color: var(--accent-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-light);
}

.notification-bell:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.notification-bell .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--status-progress);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--status-progress);
}

.btn-primary {
    background: #fff;
    color: #000;
    border: none;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border: 1px solid var(--border-light);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

/* Dropdown Menu styling */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-main);
    display: none;
    flex-direction: column;
    padding: 12px;
    z-index: 100;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-header {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 12px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--accent-secondary);
}

.dropdown-list {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
}

.dropdown-list::-webkit-scrollbar {
    width: 4px;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.notification-item {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-light);
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.03);
}

.notification-time {
    font-size: 10px;
    color: var(--accent-secondary);
    margin-top: 4px;
}

/* Core Dashboard Layouts */
.portal-body {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(20px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-main), var(--shadow-glow);
}

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

.glass-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
}

/* Client Dashboard: Status Pipeline Pillars */
.pipeline-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.pipeline-pillar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pillar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-light);
}

.pillar-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pillar-count {
    font-size: 11px;
    color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.pillar-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 150px;
}

.project-card {
    background: rgba(18, 18, 24, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-spring);
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.02);
}

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

.project-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
}

.badge {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.badge-queue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-queue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-progress);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-review {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-review);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.badge-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-overdue);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-vip {
    background: rgba(212, 175, 55, 0.15);
    color: var(--status-vip);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-review);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-progress);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--accent-secondary);
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.project-designer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.designer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-secondary);
}

/* Activity Feed */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.activity-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-secondary);
}

.activity-item:hover .activity-icon-container {
    color: #fff;
    border-color: var(--border-hover);
}

.activity-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-title {
    font-size: 13.5px;
    font-weight: 500;
}

.activity-title span {
    font-weight: 700;
    color: #fff;
}

.activity-time {
    font-size: 11px;
    color: var(--accent-secondary);
}

/* Split-screen Project Detail View */
.split-view {
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: 30px;
    align-items: start;
}

.detail-brief-card {
    height: auto;
}

.brief-meta-item {
    margin-bottom: 20px;
}

.brief-meta-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-secondary);
    margin-bottom: 6px;
}

.brief-meta-val {
    font-size: 14px;
    line-height: 1.5;
}

.brief-description {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--accent-secondary);
}

/* Review Canvas Styles */
.review-canvas-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-display {
    position: relative;
    border: 1px solid var(--border-light);
    background: #000;
    border-radius: 16px;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.review-proof-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.review-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--accent-secondary);
    text-align: center;
    padding: 40px;
}

.review-placeholder i {
    font-size: 40px;
    margin-bottom: 10px;
}

.canvas-overlay-tag {
    position: absolute;
    top: 16px;
    left: 16px;
}

.canvas-version-tag {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Review Comments Board */
.comment-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.comments-header {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.comment-bubble {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-bubble-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.comment-author {
    font-weight: 700;
}

.comment-author.admin-author {
    color: var(--status-progress);
}

.comment-time {
    color: var(--accent-secondary);
}

.comment-body {
    font-size: 12.5px;
    line-height: 1.4;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.comment-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

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

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

/* Admin Dashboard Elements */
/* Master Queue Cards & Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.kanban-pillar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Client Accounts Directory */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.client-card {
    background: rgba(18, 18, 24, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    transition: var(--transition-smooth);
}

.client-card:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.02);
}

.client-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.client-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

.client-card-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

.client-company {
    font-size: 12px;
    color: var(--accent-secondary);
}

.client-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}

.client-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-stat-label {
    font-size: 10px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.client-stat-val {
    font-size: 14px;
    font-weight: 700;
}

/* Checklist View inside Project Management */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

.checklist-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    transition: var(--transition-smooth);
}

.checklist-item.checked .checklist-checkbox {
    background: #fff;
    border-color: #fff;
    color: #000;
}

.checklist-text {
    font-size: 13px;
    transition: var(--transition-smooth);
}

.checklist-item.checked .checklist-text {
    text-decoration: line-through;
    color: var(--accent-secondary);
}

/* Asset Upload Area */
.upload-dropzone {
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-dropzone:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.01);
}

.upload-icon {
    font-size: 28px;
    color: var(--accent-secondary);
}

.upload-dropzone:hover .upload-icon {
    color: #fff;
    transform: translateY(-2px);
    transition: var(--transition-smooth);
}

.upload-text {
    font-size: 13px;
    color: var(--accent-secondary);
}

.upload-file-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    font-size: 12px;
}

.uploaded-file-item i {
    color: var(--accent-secondary);
}

/* Settings View styling */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 30px;
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Status Pipeline Switcher Toggle for admin */
.status-toggle-wrapper {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    padding: 4px;
    border-radius: 14px;
}

.status-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--accent-secondary);
    padding: 10px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.status-toggle-btn.active.s-queue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-queue);
}

.status-toggle-btn.active.s-progress {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-progress);
}

.status-toggle-btn.active.s-review {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-review);
}

/* Scrollbars global */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated-view {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .split-view {
        grid-template-columns: 1fr;
    }
    
    .pipeline-container,
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portal-container {
        flex-direction: column;
    }
    
    .portal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 20px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 0;
    }
    
    .sidebar-item a {
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    .user-pill {
        display: none;
    }
    
    .portal-topbar {
        padding: 0 20px;
    }
    
    .portal-body {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid-full {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Bespoke Calendar Tracker & Premium Form Overrides
   ========================================================================== */

/* Calendar Components */
.calendar-wrapper {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(20px);
    margin-bottom: 30px;
}

.calendar-header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-month-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    color: var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-weekday {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-secondary);
    padding: 10px 0;
    letter-spacing: 0.05em;
}

.calendar-day {
    aspect-ratio: 1.1;
    background: rgba(13, 13, 17, 0.35);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    min-height: 100px;
    position: relative;
}

.calendar-day:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day.empty {
    opacity: 0.15;
    pointer-events: none;
}

.calendar-day-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--accent-secondary);
    align-self: flex-start;
}

.calendar-day:hover .calendar-day-num {
    color: #fff;
}

.calendar-day.today {
    border-color: #fff;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.calendar-day.today .calendar-day-num {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.calendar-events-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 60px;
    margin-top: 8px;
}

.calendar-events-container::-webkit-scrollbar {
    width: 2px;
}

.calendar-events-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-event-pill {
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-left: 3px solid transparent;
}

.calendar-event-pill:hover {
    transform: translateX(1px);
    filter: brightness(1.2);
}

.event-vip {
    background: rgba(212, 175, 55, 0.1);
    color: var(--status-vip);
    border-left-color: var(--status-vip);
}

.event-progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-progress);
    border-left-color: var(--status-progress);
}

.event-review {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-review);
    border-left-color: var(--status-review);
}

.event-queue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-queue);
    border-left-color: var(--status-queue);
}

/* Premium Form Elements & Slider */
.budget-display {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-top: 8px;
    letter-spacing: -0.01em;
}

.brief-slider-container {
    padding: 10px 0;
}

/* Range input styling overrides */
input[type="range"].form-range {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

input[type="range"].form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: var(--transition-smooth);
}

input[type="range"].form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--status-review);
    box-shadow: 0 0 12px var(--status-review);
}

.brief-validation-indicator {
    font-size: 11px;
    color: var(--status-overdue);
    margin-top: 4px;
    display: none;
}

/* Calendar Event Detail Hover / Click Modal Card */
.calendar-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.calendar-detail-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.calendar-detail-card {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-hover);
    border-radius: 20px;
    width: 500px;
    max-width: 90%;
    padding: 30px;
    box-shadow: var(--shadow-main), 0 0 40px rgba(255, 255, 255, 0.02);
    transform: translateY(20px);
    transition: var(--transition-spring);
}

.calendar-detail-overlay.show .calendar-detail-card {
    transform: translateY(0);
}

/* ==========================================================================
   Premium Creative Brief Form Upgrades
   ========================================================================== */
.brief-section-card {
    background: rgba(18, 18, 24, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.brief-section-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brief-section-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brief-section-title i {
    color: var(--status-progress);
}

.priority-select-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.priority-select-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.priority-select-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

.priority-select-card.active {
    background: rgba(255, 255, 255, 0.04);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.08);
}

.priority-select-card i {
    font-size: 18px;
    color: var(--accent-secondary);
    transition: var(--transition-smooth);
}

.priority-select-card.active i {
    color: #fff;
    transform: scale(1.1);
}

.priority-title-text {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
}

.priority-desc-text {
    font-size: 10px;
    color: var(--accent-secondary);
}

.brief-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.brief-tag-pill {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    color: var(--accent-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.brief-tag-pill:hover {
    border-color: var(--border-hover);
    color: #fff;
}

.brief-tag-pill.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.15);
}

/* Focus and input visual alignment updates */
.form-control {
    background: rgba(10, 10, 14, 0.7) !important;
    border-color: var(--border-light) !important;
}

.form-control:focus {
    border-color: rgba(255, 255, 255, 0.25) !important;
    background: rgba(15, 15, 20, 0.9) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05) !important;
}

/* ==========================================================================
   Client Onboarding & Authentication Splash Layouts
   ========================================================================== */
#onboarding-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #060608;
    z-index: 3000;
    display: none; /* Controlled by portal.js */
}

#onboarding-container.active {
    display: block;
}

.auth-split {
    display: flex;
    width: 100%;
    height: 100%;
}

.auth-splash-side {
    width: 42%;
    background: linear-gradient(135deg, #09090b 0%, #030304 100%);
    border-right: 1px solid var(--border-light);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-splash-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.auth-splash-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-splash-logo img {
    height: 32px;
}

.auth-splash-logo span {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.auth-splash-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 360px;
    z-index: 10;
}

.auth-splash-h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.auth-splash-p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--accent-secondary);
}

.auth-splash-footer {
    font-size: 11px;
    color: var(--accent-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-form-side {
    width: 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: #060608;
    overflow-y: auto;
}

.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 440px;
    transition: var(--transition-smooth);
}

.auth-card:hover {
    border-color: var(--border-hover);
}

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

.auth-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 12.5px;
    color: var(--accent-secondary);
    margin-top: 6px;
}

.auth-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
    padding-bottom: 2px;
}

.auth-tab-btn {
    background: transparent;
    border: none;
    color: var(--accent-secondary);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 0;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.auth-tab-btn:hover {
    color: #fff;
}

.auth-tab-btn.active {
    color: #fff;
}

.auth-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

.auth-submit-btn {
    width: 100%;
    justify-content: center;
    margin-top: 24px;
}

.auth-switch-prompt {
    font-size: 12.5px;
    color: var(--accent-secondary);
    text-align: center;
    margin-top: 20px;
}

.auth-switch-link {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    margin-left: 4px;
    transition: var(--transition-smooth);
}

.auth-switch-link:hover {
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Onboarding Media Queries */
@media (max-width: 1024px) {
    .auth-split {
        flex-direction: column;
    }
    
    .auth-splash-side {
        width: 100%;
        height: auto;
        padding: 40px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    
    .auth-splash-copy {
        margin: 40px 0;
        max-width: 100%;
    }
    
    .auth-form-side {
        width: 100%;
        padding: 40px 20px;
    }
}

/* ==========================================================================
   Form Vertical Stack Overrides (Inputs placed under titles)
   ========================================================================== */
.form-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
}

.form-label {
    display: block !important;
    font-family: var(--font-heading) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: var(--accent-secondary) !important;
    margin-bottom: 4px !important;
    text-align: left !important;
}

.form-control {
    display: block !important;
    width: 100% !important;
    color: var(--input-color) !important;
    background: var(--input-bg) !important;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.01);
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

/* Light Theme Font Overrides for date, selects, inputs */
[data-theme="light"] input.form-control,
[data-theme="light"] select.form-control,
[data-theme="light"] textarea.form-control {
    color: #09090b !important;
    background: #ffffff !important;
    border: 1px solid rgba(9, 9, 11, 0.15) !important;
}

[data-theme="light"] input.form-control:focus,
[data-theme="light"] select.form-control:focus,
[data-theme="light"] textarea.form-control:focus {
    border-color: rgba(9, 9, 11, 0.4) !important;
    background: #ffffff !important;
    box-shadow: 0 0 10px rgba(9, 9, 11, 0.05) !important;
}

[data-theme="light"] .theme-toggle {
    background: rgba(9, 9, 11, 0.02);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(9, 9, 11, 0.05);
}

/* ==========================================================================
   Client/Admin Messaging Tab Styles
   ========================================================================== */
.messaging-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 500px;
}

@media (min-width: 768px) {
    .messaging-container.admin-chat-grid {
        grid-template-columns: 300px 1fr;
    }
}

/* Left Inbox Pane */
.inbox-pane {
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 15px;
    overflow-y: auto;
}

.inbox-thread-card {
    padding: 15px;
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inbox-thread-card:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--border-hover);
}

.inbox-thread-card.active {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.inbox-thread-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.inbox-thread-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13.5px;
}

.inbox-thread-preview {
    font-size: 11px;
    color: var(--accent-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Pane */
.chat-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-log-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    min-height: 320px;
}

.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-bubble.other-bubble {
    align-self: flex-start;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-light);
    color: var(--accent-primary);
    border-top-left-radius: 4px;
}

.chat-bubble.my-bubble {
    align-self: flex-end;
    background: var(--border-hover);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-right-radius: 4px;
}

/* Light Mode Overrides for Message Bubbles */
[data-theme="light"] .chat-bubble.other-bubble {
    background: #e4e4e7;
    color: #09090b;
    border-color: rgba(9,9,9,0.05);
}

[data-theme="light"] .chat-bubble.my-bubble {
    background: #09090b;
    color: #ffffff;
    border-color: #09090b;
}

.chat-bubble-author {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.8;
}

.chat-bubble-text {
    word-break: break-word;
}

.chat-bubble-time {
    font-size: 9.5px;
    opacity: 0.6;
    text-align: right;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
}

.chat-send-input {
    flex: 1;
    background: var(--input-bg);
    color: var(--input-color);
    border: 1px solid var(--border-light);
    padding: 12px 18px;
    border-radius: 24px;
    font-family: var(--font-body);
    font-size: 13.5px;
    outline: none;
    transition: var(--transition-smooth);
}

.chat-send-input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 10px rgba(255,255,255,0.03);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-smooth);
}

.chat-send-btn:hover {
    background: rgba(255,255,255,0.9);
    transform: scale(1.05);
}

[data-theme="light"] .chat-send-btn {
    background: #09090b;
    color: #fff;
}
[data-theme="light"] .chat-send-btn:hover {
    background: rgba(9, 9, 11, 0.9);
}


/* ==========================================================================
   Studio Modal System — Animated Custom Modals (replaces native alert/confirm)
   ========================================================================== */

@keyframes studio-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes studio-overlay-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes studio-card-in {
    from { opacity: 0; transform: scale(0.82) translateY(28px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@keyframes studio-card-out {
    from { opacity: 1; transform: scale(1)   translateY(0); }
    to   { opacity: 0; transform: scale(0.9) translateY(12px); }
}
@keyframes studio-check-draw {
    from { stroke-dashoffset: 80; }
    to   { stroke-dashoffset: 0; }
}
@keyframes studio-icon-bounce {
    0%   { transform: scale(0.5) rotate(-10deg); opacity: 0; }
    60%  { transform: scale(1.12) rotate(4deg);  opacity: 1; }
    80%  { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1)    rotate(0deg);  }
}
@keyframes studio-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--modal-accent-color); }
    50%       { box-shadow: 0 0 0 8px transparent; }
}
@keyframes studio-progress-shrink {
    from { width: 100%; }
    to   { width: 0%; }
}

#studio-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: studio-overlay-in 0.22s ease forwards;
    padding: 20px;
}

#studio-modal-overlay.closing {
    animation: studio-overlay-out 0.2s ease forwards;
}
#studio-modal-overlay.closing .studio-modal-card {
    animation: studio-card-out 0.18s ease forwards;
}

.studio-modal-card {
    background: rgba(10, 10, 14, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 28px;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 48px 44px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: studio-card-in 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Per-type ambient top glow */
.studio-modal-card::after {
    content: '';
    position: absolute;
    top: -80px; left: 50%; transform: translateX(-50%);
    width: 240px; height: 160px;
    background: radial-gradient(ellipse, var(--modal-glow, rgba(255,255,255,0.02)) 0%, transparent 70%);
    pointer-events: none;
}

/* Icon Ring */
.studio-modal-icon-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--modal-icon-bg, rgba(255, 255, 255, 0.04));
    border: 1.5px solid var(--modal-accent-color, rgba(255,255,255,0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    position: relative;
    animation: studio-icon-bounce 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s both,
               studio-ring-pulse 1.8s ease 0.7s 2;
}

/* Outer halo ring */
.studio-modal-icon-ring::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid var(--modal-accent-color, rgba(255,255,255,0.06));
    opacity: 0.25;
}

/* SVG Icon */
.studio-modal-icon-svg {
    width: 34px;
    height: 34px;
    stroke: var(--modal-accent-color, #ffffff);
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}

.studio-modal-icon-svg .anim-path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: studio-check-draw 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.42s forwards;
}
.studio-modal-icon-svg .anim-path-2 {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: studio-check-draw 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.54s forwards;
}

.studio-modal-title {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 10px;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.studio-modal-message {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--accent-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}
.studio-modal-message strong { color: var(--accent-primary); font-weight: 600; }
.studio-modal-message em { font-style: normal; color: var(--modal-accent-color); }

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

.studio-modal-btn {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    outline: none;
}

.studio-modal-btn.primary {
    background: var(--modal-accent-color, #ffffff);
    color: #000000;
    border-color: var(--modal-accent-color, #ffffff);
}
.studio-modal-btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.studio-modal-btn.primary:active { transform: translateY(0); }

.studio-modal-btn.secondary {
    background: transparent;
    color: var(--accent-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}
.studio-modal-btn.secondary:hover {
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--accent-primary);
    background: rgba(255,255,255,0.04);
}

/* Auto-dismiss progress bar */
.studio-modal-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--modal-accent-color, #ffffff);
    opacity: 0.3;
    border-radius: 0 0 0 28px;
    animation: studio-progress-shrink var(--modal-duration, 3500ms) linear forwards;
    transform-origin: left;
}

/* ── Type Theming ── */
#studio-modal-overlay[data-type="success"] .studio-modal-card {
    --modal-accent-color: #10b981;
    --modal-icon-bg:      rgba(16, 185, 129, 0.09);
    --modal-glow:         rgba(16, 185, 129, 0.08);
}
#studio-modal-overlay[data-type="error"] .studio-modal-card {
    --modal-accent-color: #ef4444;
    --modal-icon-bg:      rgba(239, 68, 68, 0.09);
    --modal-glow:         rgba(239, 68, 68, 0.08);
}
#studio-modal-overlay[data-type="warning"] .studio-modal-card {
    --modal-accent-color: #f59e0b;
    --modal-icon-bg:      rgba(245, 158, 11, 0.09);
    --modal-glow:         rgba(245, 158, 11, 0.08);
}
#studio-modal-overlay[data-type="info"] .studio-modal-card {
    --modal-accent-color: #3b82f6;
    --modal-icon-bg:      rgba(59, 130, 246, 0.09);
    --modal-glow:         rgba(59, 130, 246, 0.08);
}
#studio-modal-overlay[data-type="confirm"] .studio-modal-card {
    --modal-accent-color: #ffffff;
    --modal-icon-bg:      rgba(255, 255, 255, 0.05);
    --modal-glow:         rgba(255, 255, 255, 0.03);
}

/* ── Light Theme Overrides ── */
[data-theme="light"] .studio-modal-card {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(9, 9, 11, 0.07);
    box-shadow:
        0 40px 100px rgba(9, 9, 11, 0.14),
        0 0 0 1px rgba(9, 9, 11, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .studio-modal-title   { color: #09090b; }
[data-theme="light"] .studio-modal-message { color: #52525b; }
[data-theme="light"] .studio-modal-message strong { color: #09090b; }
[data-theme="light"] .studio-modal-btn.primary { color: #ffffff; }
[data-theme="light"] .studio-modal-btn.secondary {
    border-color: rgba(9,9,11,0.12);
    color: #52525b;
}
[data-theme="light"] .studio-modal-btn.secondary:hover {
    color: #09090b;
    background: rgba(9,9,11,0.04);
    border-color: rgba(9,9,11,0.2);
}
[data-theme="light"] #studio-modal-overlay[data-type="confirm"] .studio-modal-card {
    --modal-accent-color: #09090b;
}

