@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --bg-color: #f0f2f5;
    --card-color: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #f8fafc;
    
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --primary-glow: rgba(79, 70, 229, 0.25);
    
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info-color: #06b6d4;
    
    --border-color: rgba(0, 0, 0, 0.06);
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus: #4f46e5;
    
    --border-radius: 14px;
    --border-radius-sm: 10px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.2);
    
    --sidebar-width: 280px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0b0f19;
    --card-color: rgba(17, 24, 39, 0.7);
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #0f172a;
    
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --primary-light: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --border-color: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(15, 23, 42, 0.5);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #818cf8;
    
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.35);
}

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

html {
    font-size: 15px;
}

body {
    font-family: var(--font-main);
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ================= LOGIN PAGE ================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at top left, #6366f1 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, #a855f7 0%, transparent 50%),
                linear-gradient(135deg, #f0f2f5 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234f46e5' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
}

[data-theme="dark"] .auth-page {
    background: radial-gradient(ellipse at top left, #4f46e5 0%, transparent 45%),
                radial-gradient(ellipse at bottom right, #7c3aed 0%, transparent 45%),
                linear-gradient(135deg, #0b0f19 0%, #1e1b4b 100%);
}

[data-theme="dark"] .auth-page::before {
    opacity: 0.15;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--border-radius);
    padding: 42px 34px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.5) inset;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: var(--transition);
}

[data-theme="dark"] .auth-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

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

.brand-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.35);
    transition: transform 0.3s ease;
}

.brand-icon:hover {
    transform: translateY(-2px) rotate(3deg);
}

.auth-brand h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .auth-alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.25);
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.input-wrapper input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

[data-theme="dark"] .input-wrapper input:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.4);
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    margin-top: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.demo-creds {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex: 1;
}

.demo-creds i {
    color: var(--primary-color);
    font-size: 14px;
}

.theme-toggle-mini {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
    backdrop-filter: blur(4px);
}

.theme-toggle-mini:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(20deg);
    background: var(--primary-light);
}

/* ================= SIDEBAR - FUTURISTIC ================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(255, 255, 255, 0.78);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .sidebar {
    background: rgba(11, 15, 25, 0.82);
    border-right-color: rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.94rem;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
    border: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    transition: transform 0.2s ease;
    opacity: 0;
}

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

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}

.nav-item.active::before {
    transform: translateY(-50%) scaleY(1);
    opacity: 1;
    background: rgba(255,255,255,0.9);
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-danger:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0.75rem;
    list-style: none;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 1.25rem;
    right: -3.25rem;
    background: var(--card-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.85rem;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

/* ================= MAIN CONTENT ================= */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    position: sticky;
    top: 0;
    background: var(--card-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(4px);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
    transform: rotate(20deg);
}

.user-info {
    text-align: right;
}

.user-info span {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
}

.user-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.container {
    padding: 1.5rem;
    max-width: 1400px;
}

.card {
    background: var(--card-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background: var(--card-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    flex-shrink: 0;
}

.bg-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-yellow { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.bg-orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bg-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-info span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary { 
    background: var(--primary-color); 
    color: #fff; 
}
.btn-primary:hover { 
    background: var(--primary-hover); 
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
}

.btn-secondary { background: var(--secondary-color); color: #fff; }
.btn-success { background: var(--success-color); color: #fff; }
.btn-warning { background: var(--warning-color); color: #fff; }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-info { background: var(--info-color); color: #fff; }

.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

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

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

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.03);
}

[data-theme="dark"] .data-table tr:hover td {
    background: rgba(99, 102, 241, 0.06);
}

.data-table .actions {
    display: flex;
    gap: 0.5rem;
}

.data-table .actions a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    color: var(--text-muted);
}

.data-table .actions a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ================= FORMS ================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.form-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-section h4 {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.form-actions .btn {
    min-width: 120px;
}

.form-actions .btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.form-actions .btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ================= BADGES ================= */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-draft { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
[data-theme="dark"] .badge-draft { background: rgba(75, 85, 99, 0.2); color: #e5e7eb; border-color: rgba(75, 85, 99, 0.3); }

.badge-review { background: #fef3c7; color: #92400e; border-color: #fde68a; }
[data-theme="dark"] .badge-review { background: rgba(180, 83, 9, 0.2); color: #fcd34d; border-color: rgba(180, 83, 9, 0.3); }

.badge-approved { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
[data-theme="dark"] .badge-approved { background: rgba(5, 150, 105, 0.2); color: #6ee7b7; border-color: rgba(5, 150, 105, 0.3); }

.badge-generated { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
[data-theme="dark"] .badge-generated { background: rgba(37, 99, 235, 0.2); color: #93c5fd; border-color: rgba(37, 99, 235, 0.3); }

.badge-archived { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
[data-theme="dark"] .badge-archived { background: rgba(126, 34, 206, 0.2); color: #d8b4fe; border-color: rgba(126, 34, 206, 0.3); }

/* ================= ALERTS ================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success { 
    background: rgba(16, 185, 129, 0.08); 
    color: #065f46; 
    border-color: rgba(16, 185, 129, 0.2);
}
[data-theme="dark"] .alert-success { 
    background: rgba(16, 185, 129, 0.12); 
    color: #6ee7b7; 
    border-color: rgba(16, 185, 129, 0.25);
}

.alert-error { 
    background: rgba(239, 68, 68, 0.08); 
    color: #991b1b; 
    border-color: rgba(239, 68, 68, 0.2);
}
[data-theme="dark"] .alert-error { 
    background: rgba(239, 68, 68, 0.12); 
    color: #fca5a5; 
    border-color: rgba(239, 68, 68, 0.25);
}

/* ================= DYNAMIC LISTS ================= */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dynamic-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 0.75rem;
    align-items: end;
}

.dynamic-item.phases {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--danger-color);
}

.btn-icon:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ================= MODAL ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--card-color);
    color: var(--text-color);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.preview-frame {
    width: 100%;
    min-height: 500px;
    border: none;
    background: #fff;
}

/* ================= TIMELINE ================= */
.timeline {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.timeline-step {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.timeline-step.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.timeline-step.completed {
    background: var(--success-color);
    color: #fff;
    border-color: var(--success-color);
}

/* ================= UTILITIES ================= */
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-actions h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.3px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle,
    .sidebar-toggle {
        display: block;
    }
    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        backdrop-filter: blur(2px);
    }
    .overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .dynamic-item,
    .dynamic-item.phases {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .topbar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .page-title {
        font-size: 1rem;
    }
    .auth-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 1rem;
    }
    .auth-brand h1 {
        font-size: 1.5rem;
    }
    .auth-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .form-actions .btn {
        width: 100%;
    }
}
