/* ============================================================
   CV GENERATOR PRO - Main CSS
   Design System: Dark Mode + Glassmorphism + Vibrant Accents
   ============================================================ */

/* ── Variables ── */
:root {
    --bg-900: #0a0f1a;
    --bg-800: #0f172a;
    --bg-700: #1e2942;
    --bg-600: #243050;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-md: rgba(255, 255, 255, 0.08);
    --surface-hi: rgba(255, 255, 255, 0.12);

    --primary: #4f80ff;
    --primary-md: #6b94ff;
    --primary-lo: rgba(79, 128, 255, 0.15);
    --accent: #a855f7;
    --accent-lo: rgba(168, 85, 247, 0.15);
    --success: #10b981;
    --success-lo: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-lo: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-lo: rgba(245, 158, 11, 0.15);
    --info: #06b6d4;

    --text-100: #f1f5f9;
    --text-200: #cbd5e1;
    --text-300: #94a3b8;
    --text-400: #64748b;

    --border: rgba(255, 255, 255, 0.08);
    --border-md: rgba(255, 255, 255, 0.15);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --sidebar-w: 260px;
    --topbar-h: 64px;

    --font-main: 'Inter', system-ui, sans-serif;
    --font-display: 'Sora', 'Inter', sans-serif;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --glow: 0 0 30px rgba(79, 128, 255, 0.2);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-900);
    color: var(--text-100);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary-md);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-800);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-600);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-800);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .profile-info-sm,
.sidebar.collapsed .sidebar-progress,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span {
    display: none !important;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item svg {
    margin: 0;
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 70px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--glow);
}

.brand-icon svg {
    width: 20px;
    height: 20px;
    color: white;
    stroke: white;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-md), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Profile */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.profile-info-sm {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-name-sm {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 20px;
    width: fit-content;
}

.profile-role-badge.admin {
    background: var(--accent-lo);
    color: var(--accent);
}

.profile-role-badge.user {
    background: var(--primary-lo);
    color: var(--primary-md);
}

/* Progress */
.sidebar-progress {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-300);
    margin-bottom: 6px;
    font-weight: 500;
}

.progress-percent {
    color: var(--primary-md);
    font-weight: 700;
}

.progress-bar-wrap {
    height: 5px;
    background: var(--surface-md);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(79, 128, 255, 0.5);
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-400);
    padding: 12px 20px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-300);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--surface-md);
    color: var(--text-100);
}

.nav-item.active {
    background: var(--primary-lo);
    color: var(--primary-md);
    font-weight: 600;
}

.nav-item.active svg {
    stroke: var(--primary-md);
}

.logout-item:hover {
    background: var(--danger-lo);
    color: var(--danger);
}

.sidebar-footer {
    padding: 8px 0 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-layout {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-layout.sidebar-collapsed {
    margin-left: 64px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-300);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--surface-md);
    color: var(--text-100);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.topbar-title {
    flex: 1;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-100);
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.main-content {
    padding: 28px;
    flex: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-main);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-md));
    color: white;
    box-shadow: 0 4px 15px rgba(79, 128, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 128, 255, 0.45);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #c084fc);
    color: white;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: #0a0f1a;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-1px);
    color: #0a0f1a;
}

.btn-ghost {
    background: var(--surface);
    color: var(--text-200);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface-md);
    border-color: var(--border-md);
    color: var(--text-100);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-md);
    border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary-lo);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: var(--border-md);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-100);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 18px;
    height: 18px;
}

.card-icon.blue {
    background: var(--primary-lo);
    color: var(--primary-md);
}

.card-icon.purple {
    background: var(--accent-lo);
    color: var(--accent);
}

.card-icon.green {
    background: var(--success-lo);
    color: var(--success);
}

.card-icon.red {
    background: var(--danger-lo);
    color: var(--danger);
}

.card-icon.yellow {
    background: var(--warning-lo);
    color: var(--warning);
}

/* Stats cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.stat-card.blue::before {
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.stat-card.green::before {
    background: linear-gradient(180deg, var(--success), #34d399);
}

.stat-card.accent::before {
    background: linear-gradient(180deg, var(--accent), #c084fc);
}

.stat-card.yellow::before {
    background: linear-gradient(180deg, var(--warning), #fbbf24);
}

.stat-card:hover {
    border-color: var(--border-md);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon.blue {
    background: var(--primary-lo);
    color: var(--primary-md);
}

.stat-icon.green {
    background: var(--success-lo);
    color: var(--success);
}

.stat-icon.accent {
    background: var(--accent-lo);
    color: var(--accent);
}

.stat-icon.yellow {
    background: var(--warning-lo);
    color: var(--warning);
}

.stat-card.purple::before {
    background: linear-gradient(180deg, var(--accent), #c084fc);
}

.stat-icon.purple {
    background: var(--accent-lo);
    color: var(--accent);
}

.stat-data {
    flex: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-100);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-300);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-200);
    margin-bottom: 7px;
}

.form-control,
.form-select,
textarea.form-control {
    width: 100%;
    background: var(--surface-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-100);
    font-family: var(--font-main);
    font-size: 14px;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    appearance: none;
}

.form-control::placeholder {
    color: var(--text-400);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 128, 255, 0.15);
    background: var(--surface-hi);
}

.form-select,
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}

.form-select option,
select.form-control option {
    background: #1e2942;
    color: #f1f5f9;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-400);
    margin-top: 5px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
    position: relative;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert span {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: var(--success-lo);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-error,
.alert-danger {
    background: var(--danger-lo);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-warning {
    background: var(--warning-lo);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
    color: var(--info);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: var(--surface-md);
}

thead th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-300);
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--surface-md);
}

td {
    padding: 13px 16px;
    font-size: 14px;
    color: var(--text-200);
    vertical-align: middle;
}

.table-actions {
    display: flex;
    gap: 6px;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--surface-md) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-100) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 10px !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-300) !important;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-200) !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
    padding: 4px 10px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-lo) !important;
    border-color: var(--primary) !important;
    color: var(--primary-md) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--surface-md) !important;
    color: var(--text-100) !important;
}

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-lo);
    color: var(--primary-md);
}

.badge-accent {
    background: var(--accent-lo);
    color: var(--accent);
}

.badge-success {
    background: var(--success-lo);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-lo);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-lo);
    color: var(--warning);
}

.badge-info {
    background: rgba(6, 182, 212, 0.12);
    color: var(--info);
}

.badge-gray {
    background: var(--surface-md);
    color: var(--text-300);
}

/* Nivel bars */
.skill-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-bar {
    flex: 1;
    height: 6px;
    background: var(--surface-md);
    border-radius: 10px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-100);
    margin-bottom: 4px;
}

.page-header-subtitle {
    font-size: 14px;
    color: var(--text-300);
}

/* ============================================================
   AUTH PAGES (login/register)
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.auth-left {
    background: linear-gradient(135deg, var(--bg-800), var(--bg-700));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 128, 255, 0.15) 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.auth-brand-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow);
}

.auth-brand-icon svg {
    width: 26px;
    height: 26px;
    stroke: white;
}

.auth-brand-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-md), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-illustration {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 360px;
}

.auth-illustration-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-100), var(--text-200));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-illustration-text {
    font-size: 15px;
    color: var(--text-300);
    line-height: 1.7;
}

.auth-features {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    width: 100%;
    max-width: 320px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-200);
}

.auth-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-lo);
    color: var(--primary-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon svg {
    width: 16px;
    height: 16px;
}

.auth-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background: var(--bg-900);
    overflow-y: auto;
}

.auth-form-wrap {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.auth-form-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-100);
    margin-bottom: 6px;
}

.auth-form-subtitle {
    font-size: 14px;
    color: var(--text-300);
    margin-bottom: 32px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 13px;
    color: var(--text-400);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-link {
    font-size: 14px;
    color: var(--text-300);
    text-align: center;
    margin-top: 24px;
}

.auth-link a {
    color: var(--primary-md);
    font-weight: 600;
}

.auth-link a:hover {
    color: var(--primary);
}

/* ============================================================
   SECTION ITEMS (education/experience cards)
   ============================================================ */
.section-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 14px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.2s;
    position: relative;
}

.section-item:hover {
    border-color: var(--border-md);
    box-shadow: var(--shadow-sm);
}

.section-item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-item-icon svg {
    width: 20px;
    height: 20px;
}

.section-item-body {
    flex: 1;
    min-width: 0;
}

.section-item-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-100);
}

.section-item-subtitle {
    font-size: 13.5px;
    color: var(--text-300);
    margin-top: 2px;
}

.section-item-date {
    font-size: 12px;
    color: var(--text-400);
    margin-top: 4px;
}

.section-item-desc {
    font-size: 13.5px;
    color: var(--text-300);
    margin-top: 8px;
    line-height: 1.6;
}

.section-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-800);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-100);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-400);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--surface-md);
    color: var(--text-100);
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   GRID HELPERS
   ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ============================================================
   TEMPLATE SELECTOR
   ============================================================ */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.template-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.template-card:hover {
    border-color: var(--primary);
    background: var(--primary-lo);
}

.template-card.selected {
    border-color: var(--primary);
    background: var(--primary-lo);
    box-shadow: 0 0 0 3px rgba(79, 128, 255, 0.2);
}

.template-preview {
    height: 120px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.template-preview.clasico {
    background: linear-gradient(180deg, #1e3a8a 30px, #f8fafc 30px);
}

.template-preview.moderno {
    background: linear-gradient(135deg, #0f172a 50%, #2563eb 50%);
}

.template-preview.minimalista {
    background: #fff;
    border: 1px solid #e2e8f0;
}

.minimalista-line {
    height: 3px;
    background: #0f172a;
    margin: 20px auto 0;
    width: 60%;
}

.template-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-100);
}

.template-desc {
    font-size: 12px;
    color: var(--text-400);
    margin-top: 3px;
}

/* ============================================================
   COLOR PICKER
   ============================================================ */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover,
.color-option.selected {
    border-color: white;
    transform: scale(1.2);
}

/* ============================================================
   SHARE LINK
   ============================================================ */
.share-input-wrap {
    display: flex;
    gap: 8px;
}

.share-input-wrap .form-control {
    font-family: monospace;
    font-size: 13px;
}

/* ============================================================
   DASHBOARD WELCOME
   ============================================================ */
.welcome-banner {
    background: linear-gradient(135deg, var(--bg-700) 0%, rgba(79, 128, 255, 0.1) 60%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 128, 255, 0.1) 0%, transparent 70%);
}

.welcome-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-100);
    margin-bottom: 6px;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-300);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-400);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--surface-md);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-400);
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-300);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet (1024px) ── */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .welcome-banner {
        padding: 24px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .stat-value {
        font-size: 22px;
    }
}

/* ── Mobile overlay backdrop ── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* ── Mobile (768px) ── */
@media (max-width: 768px) {
    /* Auth pages */
    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 24px 20px;
        min-height: 100vh;
    }

    .auth-form-wrap {
        max-width: 100%;
    }

    .auth-form-title {
        font-size: 24px;
    }

    .auth-form-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }

    /* Sidebar: off-canvas drawer */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }

    /* Main layout */
    .main-layout {
        margin-left: 0 !important;
    }

    .main-content {
        padding: 16px 14px;
    }

    /* Topbar */
    .topbar {
        padding: 0 12px;
        height: 56px;
    }

    .topbar-title {
        font-size: 15px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions .btn span,
    .topbar-actions .btn-sm {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* Hide "Ver Mi CV" text on mobile, show icon only */
    .topbar-actions .btn-sm {
        padding: 8px 10px;
        gap: 0;
    }

    .topbar-actions .btn-sm svg + *:not(svg) {
        display: none;
    }

    /* Grids → single column */
    .grid-2,
    .grid-3,
    .grid-4,
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .page-header-title {
        font-size: 22px;
    }

    .page-header-subtitle {
        font-size: 13px;
    }

    .page-header .d-flex {
        width: 100%;
    }

    .page-header .btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Cards */
    .card {
        padding: 18px;
        border-radius: var(--radius);
    }

    .card-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .card-title {
        font-size: 15px;
    }

    /* Stat cards */
    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* Welcome banner */
    .welcome-banner {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
        margin-bottom: 20px;
    }

    .welcome-title {
        font-size: 18px;
    }

    .welcome-subtitle {
        font-size: 13px;
    }

    /* Section items (education, experience cards) */
    .section-item {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .section-item-icon {
        width: 38px;
        height: 38px;
    }

    .section-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Forms: larger touch targets */
    .form-control,
    .form-select,
    textarea.form-control {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .form-label {
        font-size: 13px;
    }

    .btn {
        padding: 12px 18px;
        font-size: 14px;
    }

    .btn-sm {
        padding: 9px 14px;
    }

    /* Tables: responsive card layout */
    .table-wrap {
        border: none;
        border-radius: 0;
    }

    table.mobile-cards thead {
        display: none;
    }

    table.mobile-cards tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 14px;
        margin-bottom: 10px;
    }

    table.mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
    }

    table.mobile-cards td:last-child {
        border-bottom: none;
        padding-top: 10px;
    }

    table.mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-300);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .table-actions {
        flex-wrap: wrap;
    }

    /* Preview page: stack sidebar + iframe */
    .grid-2[style*="grid-template-columns: 280px"] {
        grid-template-columns: 1fr !important;
    }

    /* CV preview iframe */
    #cv-preview-frame {
        height: 500px !important;
    }

    /* Modals */
    .modal {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
        max-height: 85vh;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 0;
    }

    /* SweetAlert modals */
    .swal-dialog {
        padding: 28px 20px 22px;
        max-width: 340px;
        border-radius: 16px;
    }

    .swal-icon {
        width: 60px;
        height: 60px;
    }

    .swal-icon svg {
        width: 30px;
        height: 30px;
    }

    .swal-title {
        font-size: 19px;
    }

    .swal-text {
        font-size: 14px;
        margin-bottom: 22px;
    }

    .swal-btn {
        padding: 10px 22px;
        font-size: 14px;
        min-width: 100px;
    }

    /* Confirm dialog */
    .confirm-dialog {
        padding: 28px 20px 22px;
        max-width: 340px;
        border-radius: 16px;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-actions .btn {
        width: 100%;
    }

    /* Share link */
    .share-input-wrap {
        flex-direction: column;
    }

    /* DataTables */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
        margin-bottom: 10px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        padding-top: 10px !important;
    }

    /* Badges in nav items */
    .nav-item .badge {
        font-size: 9px;
        padding: 1px 5px;
    }

    /* Color picker */
    .color-option {
        width: 28px;
        height: 28px;
    }
}

/* ── Small Mobile (480px) ── */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .main-content {
        padding: 12px 10px;
    }

    .topbar {
        padding: 0 10px;
        height: 52px;
    }

    .topbar-title {
        font-size: 14px;
    }

    .page-header-title {
        font-size: 19px;
    }

    /* Auth form */
    .auth-right {
        padding: 20px 16px;
    }

    .auth-form-title {
        font-size: 22px;
    }

    /* Cards extra compact */
    .card {
        padding: 14px;
    }

    .card-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .card-title {
        font-size: 14px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
    }

    .card-icon svg {
        width: 15px;
        height: 15px;
    }

    /* Stat cards compact */
    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 16px;
        height: 16px;
    }

    .stat-value {
        font-size: 18px;
    }

    /* Welcome */
    .welcome-banner {
        padding: 16px 14px;
    }

    .welcome-title {
        font-size: 16px;
    }

    .welcome-subtitle {
        font-size: 12px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-lg {
        padding: 12px 22px;
        font-size: 14px;
    }

    /* Section items */
    .section-item {
        padding: 14px;
    }

    .section-item-title {
        font-size: 14px;
    }

    .section-item-subtitle,
    .section-item-desc {
        font-size: 12px;
    }

    /* CV preview iframe */
    #cv-preview-frame {
        height: 400px !important;
    }

    /* Modals almost full width */
    .swal-dialog,
    .confirm-dialog {
        max-width: calc(100vw - 32px);
    }

    .swal-actions {
        flex-direction: column;
    }

    .swal-btn {
        width: 100%;
    }

    /* Register form: plan cards */
    .plan-card {
        padding: 14px !important;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 128, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(79, 128, 255, 0.4);
    }
}

.animate-in {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-in-delay-1 {
    animation-delay: 0.05s;
}

.animate-in-delay-2 {
    animation-delay: 0.1s;
}

.animate-in-delay-3 {
    animation-delay: 0.15s;
}

.animate-in-delay-4 {
    animation-delay: 0.2s;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary {
    color: var(--primary-md);
}

.text-accent {
    color: var(--accent);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--text-400);
}

.fw-700 {
    font-weight: 700;
}

.fw-600 {
    font-weight: 600;
}

.fs-sm {
    font-size: 13px;
}

.fs-xs {
    font-size: 12px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-32 {
    margin-bottom: 32px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.w-100 {
    width: 100%;
}

.separator {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ============================================================
   MESSAGE MODAL (SweetAlert-style, replaces alert())
   ============================================================ */
.swal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.swal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.swal-dialog {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
    max-width: 420px;
    width: 100%;
    padding: 36px 32px 28px;
    transform: scale(0.7) translateY(30px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.swal-overlay.show .swal-dialog {
    transform: scale(1) translateY(0);
}

/* Circular animated icon */
.swal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: swalIconPop 0.4s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.swal-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 2;
}

.swal-icon.swal-error {
    border: 3px solid #ef4444;
    color: #ef4444;
}

.swal-icon.swal-warning {
    border: 3px solid #f59e0b;
    color: #f59e0b;
}

.swal-icon.swal-success {
    border: 3px solid #10b981;
    color: #10b981;
}

.swal-icon.swal-info {
    border: 3px solid #3b82f6;
    color: #3b82f6;
}

.swal-title {
    font-family: var(--font-display), 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.3;
}

.swal-text {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
    padding: 0 8px;
}

.swal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.swal-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body), 'Segoe UI', sans-serif;
    min-width: 120px;
}

.swal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.swal-btn:active {
    transform: translateY(0);
}

.swal-btn-confirm {
    background: #3b82f6;
    color: #fff;
}

.swal-btn-confirm:hover {
    background: #2563eb;
}

.swal-btn-error {
    background: #ef4444;
    color: #fff;
}

.swal-btn-error:hover {
    background: #dc2626;
}

.swal-btn-success {
    background: #10b981;
    color: #fff;
}

.swal-btn-success:hover {
    background: #059669;
}

.swal-btn-warning {
    background: #f59e0b;
    color: #fff;
}

.swal-btn-warning:hover {
    background: #d97706;
}

.swal-btn-cancel {
    background: #e2e8f0;
    color: #475569;
}

.swal-btn-cancel:hover {
    background: #cbd5e1;
}

@keyframes swalIconPop {
    from {
        transform: scale(0) rotate(-15deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Multiple modals stacking */
.swal-overlay+.swal-overlay {
    z-index: 100000;
}

/* ============================================================
   CONFIRMATION MODAL (replaces confirm())
   ============================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
    max-width: 420px;
    width: 100%;
    padding: 36px 32px 28px;
    transform: scale(0.7) translateY(30px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.confirm-overlay.show .confirm-dialog {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: swalIconPop 0.4s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.confirm-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 2;
}

.confirm-icon.danger {
    border: 3px solid #ef4444;
    color: #ef4444;
}

.confirm-icon.warning {
    border: 3px solid #f59e0b;
    color: #f59e0b;
}

.confirm-icon.info {
    border: 3px solid #3b82f6;
    color: #3b82f6;
}

.confirm-icon.success {
    border: 3px solid #10b981;
    color: #10b981;
}

.confirm-title {
    font-family: var(--font-display), 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-actions .btn {
    flex: unset;
    min-width: 120px;
    justify-content: center;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
}

.confirm-actions .btn-ghost {
    background: #3b82f6;
    color: #fff;
    border: none;
}

.confirm-actions .btn-ghost:hover {
    background: #2563eb;
}

.confirm-actions .btn-danger {
    background: #ef4444;
    color: #fff;
}

.confirm-actions .btn-danger:hover {
    background: #dc2626;
}