/* ============================================
   TicketFlow - Design System & Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Primary palette */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gray-950: #020617;

    /* Accent colors */
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --sky-400: #38bdf8;
    --sky-500: #0ea5e9;

    /* Surfaces */
    --bg-base: #0a0e1a;
    --bg-surface: rgba(15, 23, 42, 0.8);
    --bg-elevated: rgba(30, 41, 59, 0.6);
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* Glass */
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-base);
    color: var(--gray-200);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Animated Background --- */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(52, 211, 153, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.04) 0%, transparent 70%);
    animation: bgDrift 20s ease-in-out infinite alternate;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes bgDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-3%, 3%) rotate(5deg); }
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* --- Layout --- */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.hidden {
    display: none !important;
}

/* --- Header --- */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.3)); }
    100% { filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.6)); }
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--gray-400);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Auth Card --- */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 
        var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.6s ease;
}

/* --- Form Header --- */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-50);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.form-header p {
    font-size: 0.9rem;
    color: var(--gray-400);
}

/* --- Input Groups --- */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-500);
    transition: color var(--transition-base);
    flex-shrink: 0;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    color: var(--gray-100);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--gray-600);
}

.input-wrapper input:hover {
    border-color: rgba(100, 116, 139, 0.4);
}

.input-wrapper input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

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

.input-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--primary-300);
    opacity: 0.85;
}

/* --- Input Row (side by side) --- */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- Password Toggle --- */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
    z-index: 2;
}

.toggle-password:hover { color: var(--gray-300); }
.toggle-password.active { color: var(--primary-400); }

/* --- Password Strength --- */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.password-strength.visible { opacity: 1; }

.strength-bars {
    display: flex;
    gap: 4px;
}

.strength-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-700);
    transition: background var(--transition-base);
}

.strength-bar.weak { background: var(--rose-500); }
.strength-bar.medium { background: var(--amber-500); }
.strength-bar.strong { background: var(--emerald-400); }
.strength-bar.very-strong { background: var(--primary-400); }

.strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-400);
}

/* --- Form Options --- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-400);
    position: relative;
    padding-left: 26px;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-600);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.checkbox-wrapper input:checked ~ .checkmark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox-wrapper input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-link:hover { color: var(--primary-300); }

/* --- Primary Button --- */
.btn-primary {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

.btn-primary .btn-text,
.btn-primary .btn-loader {
    position: relative;
    z-index: 1;
}

.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Form Divider --- */
.form-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-700), transparent);
}

.form-divider span {
    padding: 0 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Switch Form Link --- */
.switch-form {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-400);
}

.switch-form a {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.switch-form a:hover { color: var(--primary-300); }

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.9rem;
    font-weight: 500;
}

.toast.success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--emerald-400);
}

.toast.error {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(251, 113, 133, 0.3);
    color: var(--rose-400);
}

.toast.info {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(129, 140, 248, 0.3);
    color: var(--primary-300);
}

.toast.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(100px) scale(0.9); }
}

/* --- Footer --- */
.app-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--gray-600);
    animation: fadeInUp 0.8s ease;
}

/* --- Animations --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-container { animation: fadeInUp 0.4s ease; }

/* ============================================
   Dashboard Styles
   ============================================ */

.dashboard-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: var(--bg-base);
}

/* --- Dashboard Nav --- */
.dashboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-nav .logo {
    margin-bottom: 0;
    justify-content: flex-start;
}

.dashboard-nav .logo-text { font-size: 1.35rem; }

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.user-info:hover {
    background: rgba(99, 102, 241, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.02em;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-200);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-sm);
    color: var(--rose-400);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
}

/* --- Admin Mode Button --- */
.btn-admin {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.15), rgba(244, 63, 94, 0.1));
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: var(--radius-sm);
    color: var(--rose-400);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-admin::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.25), rgba(244, 63, 94, 0.2));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-admin:hover::before { opacity: 1; }

.btn-admin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.2);
    border-color: rgba(251, 113, 133, 0.5);
}

.btn-admin svg, .btn-admin span {
    position: relative;
    z-index: 1;
}

/* --- Dashboard Content --- */
.dashboard-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease;
}

.welcome-banner {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
}

.welcome-text { margin-bottom: 1.5rem; }

.welcome-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-50);
    margin-bottom: 0.5rem;
}

.welcome-text h2 span {
    background: linear-gradient(135deg, var(--primary-400), var(--emerald-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text p {
    color: var(--gray-400);
    font-size: 0.95rem;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.1);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: rgba(100, 116, 139, 0.25);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.open { background: rgba(99, 102, 241, 0.15); color: var(--primary-400); }
.stat-icon.progress { background: rgba(251, 191, 36, 0.15); color: var(--amber-400); }
.stat-icon.closed { background: rgba(52, 211, 153, 0.15); color: var(--emerald-400); }

.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 1.5rem; font-weight: 700; color: var(--gray-50); }
.stat-label { font-size: 0.8rem; color: var(--gray-400); }

/* --- Dashboard Placeholder --- */
.dashboard-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--gray-500);
    border: 2px dashed rgba(100, 116, 139, 0.15);
    border-radius: var(--radius-xl);
}

.dashboard-placeholder svg { margin-bottom: 1.5rem; opacity: 0.3; }
.dashboard-placeholder h3 { font-size: 1.15rem; font-weight: 600; color: var(--gray-400); margin-bottom: 0.5rem; }
.dashboard-placeholder p { font-size: 0.9rem; max-width: 400px; }

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */

.admin-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: var(--bg-base);
}

/* --- Admin Nav Branding --- */
.admin-nav { border-bottom-color: rgba(251, 113, 133, 0.2) !important; }

.admin-logo {
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, var(--rose-500), var(--rose-400));
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: 20px;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
}

/* --- Admin Tabs --- */
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.admin-tab:hover {
    color: var(--gray-200);
    background: rgba(100, 116, 139, 0.1);
}

.admin-tab.active {
    background: rgba(251, 113, 133, 0.15);
    color: var(--rose-400);
    font-weight: 600;
}

/* --- Admin Content Area --- */
.admin-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease;
}

/* --- Section Header --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-50);
    margin-bottom: 0.25rem;
}

.section-header p {
    font-size: 0.9rem;
    color: var(--gray-400);
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Search Box --- */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.search-box:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box svg { color: var(--gray-500); flex-shrink: 0; }

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--gray-200);
    font-family: var(--font-family);
    font-size: 0.9rem;
    width: 200px;
}

.search-box input::placeholder { color: var(--gray-600); }

.user-count {
    font-size: 0.85rem;
    color: var(--gray-400);
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* --- Data Table --- */
.data-table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(100, 116, 139, 0.06);
    transition: background var(--transition-fast);
}

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

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

.data-table tbody td {
    padding: 1rem 1.25rem;
    color: var(--gray-200);
    vertical-align: middle;
}

.data-table .user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.data-table .user-cell .mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.data-table .email-cell {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.data-table .date-cell {
    color: var(--gray-500);
    font-size: 0.82rem;
}

/* --- Alert Badge --- */
.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.alert-badge.on {
    background: rgba(52, 211, 153, 0.15);
    color: var(--emerald-400);
}

.alert-badge.off {
    background: rgba(100, 116, 139, 0.15);
    color: var(--gray-500);
}

/* --- Action Buttons --- */
.action-btns {
    display: flex;
    gap: 0.4rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-400);
}

.action-btn:hover {
    background: rgba(100, 116, 139, 0.1);
    color: var(--gray-200);
}

/* Botons de targetes de tickets: mida gran i colors sòlids */
.ticket-card-actions .action-btn {
    width: 38px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid;
    gap: 0.3rem;
}

.ticket-card-actions .action-btn.edit {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.35);
}
.ticket-card-actions .action-btn.edit:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
}

.ticket-card-actions .action-btn.close-ticket {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}
.ticket-card-actions .action-btn.close-ticket:hover {
    background: rgba(52, 211, 153, 0.3);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.6);
    transform: translateY(-1px);
}

.ticket-card-actions .action-btn.delete {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.35);
}
.ticket-card-actions .action-btn.delete:hover {
    background: rgba(244, 63, 94, 0.3);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.6);
    transform: translateY(-1px);
}

.ticket-card-actions .action-btn.pdf {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.ticket-card-actions .action-btn.pdf:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.55);
    transform: translateY(-1px);
}

.ticket-card-actions .action-btn.send-mail {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}
.ticket-card-actions .action-btn.send-mail:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.55);
    transform: translateY(-1px);
}

.send-ticket-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

/* Botons de taula admin (mida normal) */
.action-btn.edit:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
    border-color: rgba(99, 102, 241, 0.2);
}

.action-btn.password:hover {
    background: rgba(251, 191, 36, 0.15);
    color: var(--amber-400);
    border-color: rgba(251, 191, 36, 0.2);
}

.action-btn.delete:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose-400);
    border-color: rgba(244, 63, 94, 0.2);
}

.action-btn.close-ticket:hover {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.2);
}

/* Tooltip for action buttons */
.action-btn {
    position: relative;
}

.action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.3rem 0.6rem;
    background: var(--gray-800);
    color: var(--gray-200);
    font-size: 0.72rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    margin-bottom: 4px;
}

.action-btn:hover::after { opacity: 1; }

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-500);
}

.empty-state svg { margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ============================================
   TICKETS SECTION
   ============================================ */

.btn-create-ticket {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-create-ticket:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

/* --- Ticket Filters --- */
.ticket-filters {
    display: flex;
    gap: 0.5rem;
}

.ticket-filters select,
.input-group select {
    padding: 0.6rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    color: var(--gray-200);
    font-family: var(--font-family);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-base);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.ticket-filters select:focus,
.input-group select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ticket-filters select option,
.input-group select option {
    background: var(--gray-900);
    color: var(--gray-200);
}

/* --- Textarea --- */
.input-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    color: var(--gray-100);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    outline: none;
    resize: vertical;
    min-height: 100px;
}

.input-group textarea::placeholder { color: var(--gray-600); }

.input-group textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

/* --- Tickets Grid --- */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

/* --- Ticket Card --- */
.ticket-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
    animation: fadeInUp 0.3s ease;
    position: relative;
    overflow: visible;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ticket-card.priority-baja::before { background: var(--emerald-400); }
.ticket-card.priority-media::before { background: var(--amber-400); }
.ticket-card.priority-alta::before { background: #f97316; }
.ticket-card.priority-critica::before { background: var(--rose-500); }

.ticket-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.ticket-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-50);
    flex: 1;
    margin-right: 0.75rem;
}

.ticket-card-id {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

.ticket-card-body {
    margin-bottom: 1rem;
}

.ticket-card-body p {
    font-size: 0.85rem;
    color: var(--gray-400);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ticket-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ticket-tag.status-abierto {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
}

.ticket-tag.status-en_progreso {
    background: rgba(251, 191, 36, 0.15);
    color: var(--amber-400);
}

.ticket-tag.status-cerrado {
    background: rgba(52, 211, 153, 0.15);
    color: var(--emerald-400);
}

.ticket-tag.priority-baja {
    background: rgba(52, 211, 153, 0.1);
    color: var(--emerald-400);
}

.ticket-tag.priority-media {
    background: rgba(251, 191, 36, 0.1);
    color: var(--amber-400);
}

.ticket-tag.priority-alta {
    background: rgba(249, 115, 22, 0.1);
    color: #fb923c;
}

.ticket-tag.priority-critica {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose-400);
}

.ticket-card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(100, 116, 139, 0.08);
}

.ticket-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-400);
}

.ticket-assignee .mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
}

.ticket-date {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.ticket-card-actions {
    display: flex;
    gap: 0.3rem;
}

/* ============================================
   ATTACHMENTS
   ============================================ */

.attachments-section {
    margin-bottom: 1.25rem;
}

.attachments-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 0.6rem;
}

.attachments-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
}

.attach-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.25rem 1rem;
    border: 1.5px dashed rgba(100, 116, 139, 0.35);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--gray-500);
    text-align: center;
}

.attach-dropzone:hover,
.attach-dropzone.dragover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
    color: var(--gray-300);
}

.attach-dropzone span {
    font-size: 0.85rem;
}

.attach-dropzone-hint {
    font-size: 0.75rem !important;
    color: var(--gray-600) !important;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.attach-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.attach-item-icon {
    color: var(--primary-400);
    flex-shrink: 0;
    display: flex;
}

.attach-item-name {
    flex: 1;
    color: var(--gray-200);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attach-item-size {
    color: var(--gray-500);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.attach-item-status {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
}

.attach-item-status.uploading {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.attach-item-status.done {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.attach-item-status.error {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
}

.attach-item-del {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    padding: 2px;
    border-radius: 4px;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.attach-item-del:hover { color: #fb7185; }

.attach-item-dl {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    padding: 2px;
    border-radius: 4px;
    transition: color var(--transition-fast);
    flex-shrink: 0;
    text-decoration: none;
}

.attach-item-dl:hover { color: #818cf8; }

/* ============================================
   MODAL STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-wide { max-width: 560px; }
.modal-small { max-width: 400px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(100, 116, 139, 0.1);
    color: var(--gray-400);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose-400);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-icon.admin-icon {
    background: rgba(251, 113, 133, 0.15);
    color: var(--rose-400);
}

.modal-icon.ticket-icon {
    background: rgba(56, 189, 248, 0.15);
    color: var(--sky-400);
}

.modal-icon.danger-icon {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose-400);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-50);
    margin-bottom: 0.5rem;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--gray-400);
}

.modal-header p strong {
    color: var(--primary-300);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-cancel {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    color: var(--gray-300);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-cancel:hover {
    background: rgba(100, 116, 139, 0.2);
}

.btn-danger {
    flex: 1;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--rose-500), #e11d48);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35);
}

.btn-admin-submit {
    background: linear-gradient(135deg, var(--rose-500), #e11d48) !important;
}

.btn-admin-submit::before {
    background: linear-gradient(135deg, var(--rose-400), var(--rose-500)) !important;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 900px) {
    .admin-nav .nav-right {
        gap: 0.5rem;
    }

    .admin-tabs {
        order: 3;
        width: 100%;
    }

    .section-header {
        flex-direction: column;
    }

    .section-header-actions {
        width: 100%;
    }

    .tickets-grid {
        grid-template-columns: 1fr;
    }

    .data-table { font-size: 0.82rem; }
    .data-table thead th { padding: 0.75rem; }
    .data-table tbody td { padding: 0.75rem; }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 1.75rem;
        border-radius: var(--radius-lg);
    }

    .input-row { grid-template-columns: 1fr; }

    .form-options {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .dashboard-nav, .admin-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .welcome-stats { grid-template-columns: 1fr; }
    .toast { min-width: unset; max-width: calc(100vw - 3rem); }

    .modal { padding: 1.5rem; margin: 0.5rem; }
    
    .ticket-filters { flex-direction: column; width: 100%; }
    .ticket-filters select { width: 100%; }

    /* Table overflow for small screens */
    .data-table-container { overflow-x: auto; }
    .data-table { min-width: 700px; }
}

@media (max-width: 380px) {
    .auth-card { padding: 1.25rem; }
    .logo-text { font-size: 1.4rem; }
}

/* ============================================
   Language Switcher
   ============================================ */

.lang-switcher-global {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    z-index: 9000;
    display: flex;
    gap: 0.35rem;
}

.lang-switcher {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 30px;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 3px 4px;
    opacity: 0.55;
    filter: grayscale(20%);
}

.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

.lang-btn:hover {
    opacity: 1;
    filter: grayscale(0%);
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.lang-btn.active {
    opacity: 1;
    filter: grayscale(0%);
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* User info with role */
.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-role {
    font-size: 0.72rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ============================================
   CALENDARI DE VENCIMENTS
   ============================================ */

.btn-toggle-calendar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.3);
    color: #818cf8;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-toggle-calendar:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.5);
}

.calendar-widget {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    user-select: none;
    max-width: 340px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cal-month-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-100);
    text-transform: capitalize;
}

.cal-nav-btn {
    background: none;
    border: 1px solid #334155;
    border-radius: 5px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.cal-nav-btn:hover {
    background: rgba(99,102,241,0.15);
    color: #6366f1;
    border-color: #6366f1;
}

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

.cal-day-name {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gray-500);
    padding: 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--gray-300);
    position: relative;
    transition: background 0.15s;
    min-height: 28px;
}

.cal-cell:not(.empty) {
    cursor: pointer;
}

.cal-cell:not(.empty):hover {
    background: rgba(99,102,241,0.1);
}

.cal-cell.has-due .cal-day-num {
    color: #6366f1;
    font-weight: 700;
}

.cal-cell.has-overdue .cal-day-num {
    color: #ef4444;
    font-weight: 700;
}

.cal-cell.today .cal-day-num {
    background: #6366f1;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.cal-cell.empty {
    opacity: 0;
    pointer-events: none;
}

.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6366f1;
    margin-top: 2px;
    flex-shrink: 0;
}

.cal-cell.has-overdue .cal-dot {
    background: #ef4444;
}

.cal-cell.has-due:hover,
.cal-cell.has-overdue:hover {
    background: rgba(99,102,241,0.15);
}

/* Tooltip */
.cal-tooltip {
    position: absolute;
    z-index: 9999;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.cal-tip-item {
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: #0f172a;
    gap: 2px;
}
.cal-tip-item:last-child { margin-bottom: 0; }

.cal-tip-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-tip-time {
    font-size: 0.72rem;
    color: #64748b;
}

.cal-tip-new-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px 0;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 6px;
    color: #818cf8;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.cal-tip-new-btn:hover {
    background: rgba(99,102,241,0.25);
}

/* ============================================
   BUSCADOR DE TICKETS
   ============================================ */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: #64748b;
    pointer-events: none;
}

.search-box input {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.85rem;
    padding: 7px 32px 7px 32px;
    outline: none;
    width: 220px;
    transition: border-color 0.15s, width 0.2s;
}

.search-box input::placeholder {
    color: #475569;
}

.search-box input:focus {
    border-color: #6366f1;
    width: 280px;
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    line-height: 1;
}
.search-clear:hover {
    color: #f1f5f9;
}

/* ============================================
   FEEDBACK WIDGET
   ============================================ */

.feedback-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.feedback-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(99,102,241,0.45);
    transition: box-shadow 0.2s, transform 0.15s;
    white-space: nowrap;
}

.feedback-trigger:hover,
.feedback-trigger.active {
    box-shadow: 0 6px 24px rgba(99,102,241,0.6);
    transform: translateY(-2px);
}

.feedback-trigger .feedback-icon {
    font-size: 1rem;
}

.feedback-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    width: 320px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.55);
    overflow: hidden;
    animation: feedbackSlideIn 0.2s ease;
}

@keyframes feedbackSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.feedback-panel.hidden {
    display: none;
}

.feedback-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #6366f1cc, #8b5cf6cc);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
}

.feedback-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s;
}
.feedback-close:hover { color: #fff; }

.feedback-form {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-type-row {
    display: flex;
    gap: 10px;
}

.feedback-type-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    flex: 1;
    transition: border-color 0.15s, background 0.15s;
}

.feedback-type-opt:has(input:checked) {
    border-color: #6366f1;
    background: #6366f115;
    color: #a5b4fc;
}

.feedback-type-opt input[type="radio"] {
    accent-color: #6366f1;
}

.feedback-input,
.feedback-textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.83rem;
    padding: 9px 12px;
    outline: none;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.feedback-input:focus,
.feedback-textarea:focus {
    border-color: #6366f1;
}

.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: #475569;
}

.feedback-submit {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.feedback-submit:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.feedback-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   TICKETS TABLE (dashboard)
   ============================================ */

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.tbl-th {
    text-align: left;
    padding: 9px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    border-bottom: 1px solid #1e293b;
    white-space: nowrap;
}

.tbl-th-actions { text-align: right; }

.tbl-row {
    border-bottom: 1px solid #1e293b;
    transition: background 0.12s;
}

.tbl-row:last-child { border-bottom: none; }

.tbl-row:hover { background: rgba(99,102,241,0.06); }

.tbl-td {
    padding: 10px 14px;
    vertical-align: middle;
    color: #cbd5e1;
}

.tbl-td-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tbl-prio-bar {
    flex-shrink: 0;
    width: 3px;
    height: 32px;
    border-radius: 2px;
}
.tbl-prio-bar.prio-baja    { background: #22c55e; }
.tbl-prio-bar.prio-media   { background: #eab308; }
.tbl-prio-bar.prio-alta    { background: #f97316; }
.tbl-prio-bar.prio-critica { background: #ef4444; }

.tbl-title {
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
}

.tbl-id {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: #475569;
    font-weight: 500;
}

.tbl-td-date {
    white-space: nowrap;
    font-size: 0.8rem;
    color: #64748b;
}

.tbl-td-actions {
    text-align: right;
    white-space: nowrap;
}

/* Botons de la taula */
.tbl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    color: #64748b;
    margin-left: 3px;
    position: relative;
}
.tbl-btn:hover { transform: translateY(-1px); }

.tbl-btn.edit       { color: #818cf8; }
.tbl-btn.edit:hover { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.35); color: #a5b4fc; }

.tbl-btn.close-ticket       { color: #34d399; }
.tbl-btn.close-ticket:hover { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.35); color: #6ee7b7; }

.tbl-btn.delete       { color: #fb7185; }
.tbl-btn.delete:hover { background: rgba(244,63,94,0.15); border-color: rgba(244,63,94,0.35); color: #fda4af; }

.tbl-btn.send-mail       { color: #38bdf8; }
.tbl-btn.send-mail:hover { background: rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.35); color: #7dd3fc; }

.tbl-btn.pdf       { color: #f87171; }
.tbl-btn.pdf:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.35); color: #fca5a5; }

/* Tooltip reutilitzat */
.tbl-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 5px;
    white-space: nowrap;
    border: 1px solid #334155;
    pointer-events: none;
    z-index: 100;
}

/* ============================================
   TICKET DETAIL MODAL
   ============================================ */

.detail-modal {
    max-width: 620px;
    width: 95%;
    padding: 0;
    overflow: hidden;
}

.detail-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #1e293b;
}

.detail-modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.detail-prio-bar {
    flex-shrink: 0;
    width: 4px;
    height: 36px;
    border-radius: 3px;
}

.detail-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
}

.detail-modal-id {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 500;
}

.detail-modal-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 16px 24px;
    border-bottom: 1px solid #1e293b;
    background: #0f172a44;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
}

.detail-meta-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    font-weight: 600;
}

.detail-meta-val {
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 500;
}

.detail-due {
    color: #f97316;
}

.detail-modal-desc-label {
    padding: 14px 24px 6px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    font-weight: 600;
}

.detail-modal-desc {
    padding: 0 24px 20px;
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.7;
    max-height: 220px;
    overflow-y: auto;
    word-break: break-word;
}

.detail-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid #1e293b;
    gap: 8px;
}

.tbl-row:hover .tbl-title {
    color: #a5b4fc;
}
