/* ============================================
   DigiBiz Pro - Apple-Style Antigravity Design
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Apple-Style Light Mode */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f2f2f7;
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-sidebar: rgba(245, 245, 247, 0.75);
    --bg-input: rgba(255, 255, 255, 0.8);
    
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-muted: #86868b;
    
    --border-default: rgba(0, 0, 0, 0.08);
    --border-focus: #0066cc;
    
    --accent-primary: #0071e3;
    --accent-primary-hover: #0077ed;
    --accent-secondary: #5e5ce6;
    --accent-gradient: linear-gradient(135deg, #0071e3, #5e5ce6);
    --accent-gradient-hover: linear-gradient(135deg, #0077ed, #6b69f6);
    
    --color-success: #34c759;
    --color-warning: #ff9f0a;
    --color-danger: #ff3b30;
    --color-info: #32ade6;
    
    --color-success-bg: rgba(52, 199, 89, 0.12);
    --color-warning-bg: rgba(255, 159, 10, 0.12);
    --color-danger-bg: rgba(255, 59, 48, 0.12);
    --color-info-bg: rgba(50, 173, 230, 0.12);

    /* Spatial Depth / Floating Elevation */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12);
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(24px) saturate(180%);
    
    /* Spacing & Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    
    /* Border Radius (Squircle-like) */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* Smooth Apple-like Transitions */
    --transition-fast: 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-normal: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-card: rgba(28, 28, 30, 0.65);
    --bg-sidebar: rgba(28, 28, 30, 0.75);
    --bg-input: rgba(44, 44, 46, 0.8);
    
    --text-primary: #f5f5f7;
    --text-secondary: #ebebf5;
    --text-muted: #8e8e93;
    
    --border-default: rgba(255, 255, 255, 0.1);
    --border-focus: #0a84ff;
    
    --accent-primary: #0a84ff;
    --accent-primary-hover: #409cff;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.8);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.9);
    
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
}


/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 15% 50%, rgba(0, 113, 227, 0.04), transparent 25%), radial-gradient(circle at 85% 30%, rgba(94, 92, 230, 0.04), transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6, .card-title, .stat-value {
    font-family: 'Hanken Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

code, pre, .badge, .label-md {
    font-family: 'Space Grotesk', monospace;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

::selection {
    background: var(--accent-primary);
    color: white;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-bounce), transform var(--transition-bounce);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    min-height: 64px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.logo-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 0;
}

.sidebar.collapsed .sidebar-logo {
    display: none;
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Sidebar User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 16px 16px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

[data-theme="dark"] .sidebar-user {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-sm);
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 10px 0;
    margin: 4px 12px 16px;
    background: transparent;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px; /* Squircle */
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .user-info {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 6px;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .nav-section-title, .sidebar.collapsed .nav-locked-info {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
    width: 44px;
    height: 44px;
    margin: 0 auto 6px;
}

.sidebar.collapsed .nav-item span {
    display: none !important;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--color-info-bg);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.nav-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: white;
    letter-spacing: 0.5px;
}

.nav-badge.admin {
    background: linear-gradient(135deg, #F59E0B, #EF4444);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun,
:root:not([data-theme]) .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon,
:root:not([data-theme]) .icon-moon {
    display: block;
}

.logout-btn:hover {
    background: var(--color-danger-bg) !important;
    color: var(--color-danger) !important;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 28px 32px;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
    max-width: calc(100vw - var(--sidebar-width));
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed);
    max-width: calc(100vw - var(--sidebar-collapsed));
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-header .page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--glass-padding, 24px);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-4px) translateZ(10px);
    box-shadow: var(--shadow-lg);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title .icon.blue {
    background: var(--color-info-bg);
    color: var(--accent-primary);
}

.card-title .icon.green {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.card-title .icon.orange {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.card-title .icon.red {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.card-title .icon.purple {
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-secondary);
}

/* --- Stat Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-default);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    opacity: 0.8;
}

.stat-card.blue::before {
    background: var(--accent-gradient);
}

.stat-card.green::before {
    background: linear-gradient(135deg, #22C55E, #16A34A);
}

.stat-card.orange::before {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.stat-card.purple::before {
    background: linear-gradient(135deg, #818CF8, #6366F1);
}

.stat-card:hover {
    transform: translateY(-4px) translateZ(10px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: var(--color-info-bg);
    color: var(--accent-primary);
}

.stat-icon.green {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.stat-icon.orange {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.stat-icon.purple {
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-secondary);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 2px;
}

.stat-change {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up {
    color: var(--color-success);
}

.stat-change.down {
    color: var(--color-danger);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.72rem;
    color: var(--color-danger);
    margin-top: 4px;
}

.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 40px;
}

.input-group .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-bounce);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--border-default);
}

.btn-danger {
    background: var(--color-danger);
    color: #ffffff;
}

.btn-success {
    background: var(--color-success);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--bg-secondary);
    box-shadow: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 0.95rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-card);

}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.83rem;
    border-bottom: 1px solid var(--border-default);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.7rem;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}

.data-table tr:hover td {
    background: var(--bg-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--accent-primary);
}

.badge-purple {
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-secondary);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);

    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 420px;
    animation: toastIn 0.3s ease;
    transition: all var(--transition-base);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.toast.error .toast-icon {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.toast.warning .toast-icon {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.toast.info .toast-icon {
    background: var(--color-info-bg);
    color: var(--accent-primary);
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-xl);
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-default);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-default);
}

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* --- Score Gauge --- */
.score-gauge {
    width: 140px;
    height: 140px;
    position: relative;
    margin: 0 auto;
}

.score-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-gauge .track {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.score-gauge .fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* --- Tabs --- */
.tab-nav {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border-default);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* --- Steps / Timeline --- */
.steps-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    background: var(--bg-secondary);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 6px;
    position: sticky;
    top: 10px;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.step-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.step-item:hover {
    color: var(--text-primary);
}

.step-item.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.step-item.completed {
    color: var(--color-success);
}

.step-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-item.active .step-number {
    background: var(--accent-gradient);
    color: white;
}

.step-item.completed .step-number {
    background: var(--color-success);
    color: white;
}

/* --- Grid Layouts --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 360px;
    margin: 0 auto 20px;
}

/* --- BMC Canvas --- */
.bmc-canvas {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 8px;
    background: var(--bg-secondary);
}

.bmc-block {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 14px;
    min-height: 120px;
}

.bmc-block-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bmc-block textarea {
    width: 100%;
    min-height: 70px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    resize: vertical;
    outline: none;
}

/* BMC grid positions */
.bmc-kp {
    grid-column: 1;
    grid-row: 1;
}

.bmc-ka {
    grid-column: 2;
    grid-row: 1;
}

.bmc-vp {
    grid-column: 3;
    grid-row: 1 / 3;
}

.bmc-cr {
    grid-column: 4;
    grid-row: 1;
}

.bmc-cs {
    grid-column: 5;
    grid-row: 1;
}

.bmc-kr {
    grid-column: 2;
    grid-row: 2;
}

.bmc-ch {
    grid-column: 4;
    grid-row: 2;
}

.bmc-cost {
    grid-column: 1 / 4;
    grid-row: 3;
}

.bmc-rev {
    grid-column: 4 / 6;
    grid-row: 3;
}

/* --- Auth Pages --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
}

.auth-logo .logo-icon svg {
    width: 56px;
    height: 56px;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.83rem;
    color: var(--text-secondary);
}

/* --- Workspace specific --- */
.workspace-section {
    margin-bottom: 24px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* --- Prototype Preview --- */
.prototype-preview {
    width: 100%;
    min-height: 500px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    background: white;
    overflow: hidden;
}

.prototype-preview iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
}

/* --- AI Chat / Prompt --- */
.ai-prompt-area {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.ai-prompt-area textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    resize: none;
    outline: none;
    min-height: 44px;
    max-height: 120px;
}

/* --- Evaluation Results --- */
.eval-result {
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.eval-result.passed {
    border-color: var(--color-success);
}

.eval-result.failed {
    border-color: var(--color-danger);
}

.eval-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-secondary);
}

.eval-body {
    padding: 24px;
}

.eval-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-default);
}

.eval-metric:last-child {
    border-bottom: none;
}

.eval-metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.eval-metric-value {
    font-size: 1rem;
    font-weight: 700;
}

/* --- Version History --- */
.version-timeline {
    position: relative;
    padding-left: 28px;
}

.version-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-default);
}

.version-item {
    position: relative;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.version-item:hover {
    box-shadow: var(--shadow-md);
}

.version-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-default);
    border: 2px solid var(--bg-primary);
}

.version-item.passed::before {
    background: var(--color-success);
}

.version-item.failed::before {
    background: var(--color-danger);
}

.version-item.current::before {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

/* --- Comments --- */
.comment-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-bubble {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
}

.comment-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.comment-text {
    font-size: 0.83rem;
    color: var(--text-primary);
    margin-top: 2px;
}

.comment-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.comment-input-area {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.comment-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.83rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.comment-input-area input:focus {
    border-color: var(--accent-primary);
}

/* --- Notification Bell --- */
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-sidebar);
}

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-default) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Utility Classes --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-warning {
    color: var(--color-warning);
}

.text-accent {
    color: var(--accent-primary);
}

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .bmc-canvas {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .bmc-vp {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .bmc-cost {
        grid-column: 1 / -1;
    }

    .bmc-rev {
        grid-column: 1 / -1;
    }

    .steps-nav {
        overflow-x: auto;
    }

    .step-item {
        min-width: 140px;
    }
}

/* --- DataTable Components --- */
.dt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.dt-search-wrap {
    position: relative;
}

.dt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
}

.dt-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dt-pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}

.dt-page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dt-page-btn:hover:not(:disabled):not(.active) {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.dt-page-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.dt-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.dt-page-dots {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 4px;
}

.dt-sort {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.dt-sort:hover {
    color: var(--accent-primary);
}

.sort-icon {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* Extra small button */
.btn-xs {
    padding: 4px 10px;
    font-size: 0.72rem;
    border-radius: 6px;
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[style*="flex"],
.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-default);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-content form {
    padding: 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .bmc-canvas {
        grid-template-columns: 1fr;
    }

    .bmc-cost,
    .bmc-rev {
        grid-column: 1;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .dt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .dt-footer {
        flex-direction: column;
        align-items: center;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
}

/* --- Prototyper Styles --- */
.prototype-preview {
    width: 100%;
    min-height: 600px;
    background: #fff;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-default);
    border-top: none;
}

.prototype-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    transition: opacity 0.3s;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 280px;
    margin: 0 auto;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

[data-theme="dark"] .prototype-preview {
    background: #fff;
    /* Keep preview white as it is a web preview */
}

/* --- Row Blink Animation --- */
@keyframes rowBlink {
    0% { background-color: transparent; }
    50% { background-color: var(--row-blink-color, var(--color-danger-bg)); }
    100% { background-color: transparent; }
}

.row-blink {
    --row-blink-color: var(--color-danger-bg);
    animation: rowBlink 1.5s infinite;
}

[data-theme="dark"] .row-blink {
    --row-blink-color: rgba(239, 68, 68, 0.25);
}

.row-blink td {
    position: relative;
}

/* ═══ Workshop ═══ */
.hidden { display: none !important; }

.ws-prd-mode.active {
    background: var(--accent-primary) !important;
    color: white !important;
    border-color: var(--accent-primary) !important;
}

#wsPrdPreview {
    font-size: 0.88rem;
    line-height: 1.8;
}

#wsPrdPreview h1, #wsPrdPreview h2, #wsPrdPreview h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

#wsPrdPreview code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

#wsPrdPreview pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
    margin: 10px 0;
}

#wsPrdPreview pre code {
    background: none;
    padding: 0;
}

#wsPrdPreview table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

#wsPrdPreview th, #wsPrdPreview td {
    border: 1px solid var(--border-default);
    padding: 8px 12px;
    text-align: left;
    font-size: 0.82rem;
}

#wsPrdPreview th {
    background: var(--bg-secondary);
    font-weight: 700;
}

#wsPrdPreview ul, #wsPrdPreview ol {
    padding-left: 20px;
    margin: 8px 0;
}

/* --- PRD Mermaid Diagram Styles --- */
.prd-mermaid-container {
    margin: 20px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.prd-mermaid-container:hover {
    box-shadow: var(--shadow-md);
}

.prd-mermaid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(129, 140, 248, 0.08) 100%);
    border-bottom: 1px solid var(--border-default);
}

[data-theme="dark"] .prd-mermaid-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(129, 140, 248, 0.1) 100%);
}

.prd-mermaid-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-secondary);
    letter-spacing: 0.3px;
}

.prd-mermaid-container .mermaid {
    padding: 24px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    min-height: 120px;
}

.prd-mermaid-container .mermaid-rendered {
    animation: mermaidFadeIn 0.5s ease-out;
}

.prd-mermaid-container .mermaid svg {
    max-width: 100%;
    height: auto;
}

@keyframes mermaidFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mermaid Error Fallback */
.mermaid-error {
    padding: 16px;
    background: var(--color-warning-bg);
    border-radius: var(--radius-sm);
    margin: 12px;
}

.mermaid-error-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-warning);
    margin-bottom: 8px;
}

.mermaid-error-code {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'Geist Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* PRD Preview Code Block Styles */
#wsPrdPreview pre {
    position: relative;
}

#wsPrdPreview pre code {
    display: block;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-family: 'Geist Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    overflow-x: auto;
    color: var(--text-primary);
}

/* --- Responsive & Mobile Enhancements --- */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 80;
    box-shadow: var(--shadow-sm);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
    }
    
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
        min-height: calc(100vh - 60px); /* Adjust for mobile header height */
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.4rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 16px;
    }
    .main-content {
        padding: 20px 16px;
    }
}










/* ============================================
   Landing Page Styles (Merged)
   ============================================ */


body.page-landing {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: default;
}

/* Moving Mesh Gradient Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-primary);
}

.bg-mesh::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(var(--border-default) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.05;
}

@keyframes meshFlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, -5%) rotate(10deg); }
}

.landing-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 60px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

/* Navbar */
.landing-nav {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 3px solid var(--border-default);
    margin-bottom: 40px;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-heading);
    letter-spacing: -1.5px;
}

.landing-brand strong {
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
}

/* Floating Elements */
.float-element {
    position: absolute;
    z-index: -1;
    opacity: 0.5;
    filter: blur(40px);
    border-radius: 50%;
    background: var(--accent-gradient);
    animation: float 20s infinite alternate;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 100px) scale(1.5); }
}

/* Main Layout */
.landing-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 80px;
    align-items: center;
    padding-bottom: 60px;
}

.hero-content {
    position: relative;
    animation: revealLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes revealLeft {
    0% { opacity: 0; transform: translateX(-80px); }
    100% { opacity: 1; transform: translateX(0); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 32px;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 6vw, 6rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -5px;
    margin-bottom: 32px;
    color: var(--text-primary);
    
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 56px;
    max-width: 580px;
    
}

/* Premium Button Upgrade */
.btn-premium {
    background: var(--accent-gradient);
    color: #ffffff !important;
    padding: 22px 48px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    border: none;
}
.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Bento Grid Upgrade */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 24px;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Card Glow Effect */


.bento-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}



.bento-item.large {
    grid-row: span 2;
    background: var(--accent-gradient);
    color: #ffffff !important;
    justify-content: center;
    border: none;
}

.bento-item.large * { color: #ffffff !important; }

.bento-icon {
    font-size: 3.5rem;
    margin-bottom: 28px;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.1));
}

.bento-item h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.bento-item p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    
}

/* Stats */
.hero-stats-inline {
    display: flex;
    gap: 60px;
    margin-top: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--border-default);
}

.hero-stat-num {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

/* Footer */
.landing-footer {
    padding: 32px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 1024px) {
    body.page-landing { overflow: auto; height: auto; }
    .landing-main { grid-template-columns: 1fr; padding: 60px 0; }
}

/* ═══════════════ Admin DataTable Core Styles ═══════════════ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.admin-table th {
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}
:is(.dark .admin-table th) {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: #334155;
}
.admin-table th:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}
:is(.dark .admin-table th:hover) {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}
.admin-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
:is(.dark .admin-table td) {
    border-bottom-color: #1e293b;
}
.admin-table tbody tr {
    transition: background-color 0.15s ease;
}
.admin-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.015);
}
:is(.dark .admin-table tbody tr:hover td) {
    background: rgba(255, 255, 255, 0.02);
}
.admin-table .sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}
.admin-table th:hover .sort-icon {
    opacity: 0.9;
}

