/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; font-size: 14px; color: #1e2433; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* ===== VARIABLES ===== */
:root {
    --primary:    #0057b7;
    --primary-dk: #003f8a;
    --accent:     #00a651;
    --danger:     #e53935;
    --warn:       #f59e0b;
    --info:       #3b82f6;
    --bg:         #f0f4f9;
    --card:       #ffffff;
    --border:     #e2e8f0;
    --text:       #1e2433;
    --muted:      #64748b;
    --sidebar-w:  240px;
    --radius:     10px;
}

/* ===== LANDING CINÉMATIQUE ===== */
.landing-body { margin: 0; padding: 0; overflow: hidden; height: 100vh; font-family: 'Inter', sans-serif; }

.video-bg {
    position: fixed; inset: 0; z-index: 0;
}
.video-bg video {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
}
.video-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,10,30,.55) 0%,
        rgba(0,20,60,.45) 40%,
        rgba(0,10,30,.75) 100%
    );
}

.landing-content {
    position: relative; z-index: 1;
    height: 100vh; display: flex; flex-direction: column;
    justify-content: space-between; padding: 36px 52px;
    color: #fff;
}

/* Top: logo */
.landing-top { display: flex; align-items: center; }
.landing-logo-img {
    height: 70px; width: auto; object-fit: contain;
    animation: fadeDown .8s ease both;
}

/* Center: hero text */
.landing-center {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; width: 100%;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 20px;
    padding: 48px 56px;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.landing-tag {
    display: inline-block;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(6px);
    padding: 6px 16px; border-radius: 20px;
    font-size: 12px; font-weight: 600; letter-spacing: 1.2px;
    text-transform: uppercase; color: rgba(255,255,255,.85);
    margin-bottom: 22px;
    animation: fadeUp .7s .1s ease both;
}
.landing-hero-title {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800; line-height: 1.15;
    letter-spacing: -.5px; margin-bottom: 20px;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
    animation: fadeUp .7s .2s ease both;
}
.title-accent { color: #60a5fa; }
.landing-hero-sub {
    font-size: 16px; font-weight: 400; line-height: 1.7;
    color: rgba(255,255,255,.75); margin-bottom: 40px;
    animation: fadeUp .7s .3s ease both;
}
.landing-actions { animation: fadeUp .7s .4s ease both; }
.btn-hero {
    display: inline-flex; align-items: center; gap: 12px;
    background: #fff; color: var(--primary);
    padding: 16px 36px; border-radius: 12px;
    font-size: 16px; font-weight: 700;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none; margin-bottom: 14px; display: inline-flex;
}
.btn-hero:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.landing-hint { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 4px; }

/* Bottom: features bar + footer */
.landing-bottom { display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.landing-features-bar {
    display: flex; align-items: center; gap: 0;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border-radius: 12px; padding: 14px 28px;
    width: fit-content;
    animation: fadeUp .7s .5s ease both;
}
.feat-bar-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); padding: 0 20px; }
.feat-bar-item:first-child { padding-left: 0; }
.feat-bar-sep { width: 1px; height: 20px; background: rgba(255,255,255,.2); }
.feat-bar-icon { font-size: 18px; }
.landing-footer-links {
    font-size: 12px; color: rgba(255,255,255,.4);
    animation: fadeUp .7s .6s ease both;
}
.landing-footer-links .sep { margin: 0 8px; }
.landing-footer-links a { color: rgba(255,255,255,.6); font-weight: 500; transition: color .2s; }
.landing-footer-links a:hover { color: #fff; }

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

/* ===== CLIENT PAGE ===== */
.client-bg { background: var(--bg); min-height: 100vh; }

.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
    color: #fff; padding: 18px 0; box-shadow: 0 2px 12px rgba(0,87,183,.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.logo { display: flex; align-items: center; }
.logo-img { height: 48px; width: auto; object-fit: contain; }
.header-subtitle { font-size: 13px; opacity: .8; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-welcome { display: flex; flex-direction: column; align-items: flex-end; }
.welcome-bank { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .8px; }
.welcome-name { font-size: 14px; font-weight: 600; }
.btn-header-logout {
    background: rgba(255,255,255,.15); color: #fff; padding: 7px 14px;
    border-radius: 8px; font-size: 13px; font-weight: 500;
    transition: background .2s; border: 1px solid rgba(255,255,255,.2);
}
.btn-header-logout:hover { background: rgba(255,255,255,.25); }
.name-highlight { color: var(--primary); }

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.main-content { padding: 40px 20px; }

.page-intro { margin-bottom: 28px; }
.page-intro h1 { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.page-intro p  { color: var(--muted); max-width: 600px; }

/* ===== FORM CARD ===== */
.form-card {
    background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 20px rgba(0,0,0,.07);
    padding: 32px; border: 1px solid var(--border);
}
.form-section-title {
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
    color: var(--muted); margin: 24px 0 14px; border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.form-section-title:first-child { margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 580px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group label { font-weight: 500; font-size: 13px; color: var(--text); }
.required { color: var(--danger); }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 14px; color: var(--text);
    transition: border-color .2s, box-shadow .2s; background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,87,183,.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.form-footer { margin-top: 24px; display: flex; justify-content: flex-end; }

/* ===== SUCCESS CARD ===== */
.success-card {
    background: var(--card); border-radius: var(--radius); padding: 48px 32px; text-align: center;
    box-shadow: 0 2px 20px rgba(0,0,0,.07); border: 1px solid var(--border);
}
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.ticket-number-badge {
    display: inline-block; background: var(--primary); color: #fff;
    font-size: 20px; font-weight: 700; letter-spacing: 1px;
    padding: 12px 28px; border-radius: 8px; margin: 16px 0;
}
.success-note { color: var(--muted); margin-bottom: 24px; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; font-size: 13px;
}
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; border-radius: 8px; font-weight: 600; font-size: 14px;
    border: none; cursor: pointer; transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dk); }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover  { background: var(--bg); }
.btn-lg  { padding: 13px 28px; font-size: 15px; }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== SITE FOOTER ===== */
.site-footer { background: var(--primary-dk); color: rgba(255,255,255,.6); text-align: center; padding: 18px 0; margin-top: 60px; font-size: 13px; }

/* ===== LOGIN PAGE ===== */
.login-bg { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--card); border-radius: 16px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.login-logo .logo-img { height: 52px; width: auto; object-fit: contain; }
.login-title    { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-back     { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.login-back a   { color: var(--primary); font-weight: 500; }

/* ===== ADMIN LAYOUT ===== */
.admin-bg { background: var(--bg); }
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w); background: #1a2540; color: #c5d0e8;
    display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.sidebar-logo { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.sidebar-logo-img { height: 40px; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
.sidebar-nav, .sidebar-banks { padding: 12px 0; }
.sidebar-section-title { padding: 12px 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.35); }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 20px;
    font-size: 13px; font-weight: 500; color: #c5d0e8; cursor: pointer;
    transition: background .15s, color .15s; border-radius: 0;
}
.nav-item:hover  { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(0,87,183,.35); color: #fff; border-left: 3px solid var(--primary); }
.nav-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-count { margin-left: auto; background: rgba(255,255,255,.15); padding: 1px 7px; border-radius: 10px; font-size: 11px; }

.sidebar-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.btn-logout {
    display: flex; align-items: center; gap: 8px; color: #c5d0e8; font-size: 13px;
    font-weight: 500; transition: color .2s; cursor: pointer; background: none; border: none;
}
.btn-logout:hover { color: #fff; }

/* Main */
.admin-main    { flex: 1; min-width: 0; padding: 28px 32px; overflow-x: auto; }
.admin-topbar  { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.admin-page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.admin-page-sub   { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 780px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
.stat-card {
    background: var(--card); border-radius: var(--radius); padding: 20px 22px;
    border-left: 4px solid var(--border); box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.stat-total    { border-color: var(--primary); }
.stat-open     { border-color: #f59e0b; }
.stat-progress { border-color: #3b82f6; }
.stat-done     { border-color: var(--accent); }
.stat-number { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-label  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Filter bar */
.filter-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--card); padding: 14px 16px; border-radius: var(--radius);
    border: 1px solid var(--border); margin-bottom: 20px;
}
.filter-search { flex: 1; min-width: 160px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 7px; font-family: inherit; font-size: 13px; }
.filter-search:focus { outline: none; border-color: var(--primary); }
.filter-select { padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 7px; font-family: inherit; font-size: 13px; background: #fff; }

/* Tickets table */
.tickets-table-wrap { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.tickets-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tickets-table thead tr { background: #f8fafc; border-bottom: 2px solid var(--border); }
.tickets-table th { padding: 12px 14px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); white-space: nowrap; }
.tickets-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.tickets-table tbody tr:last-child { border-bottom: none; }
.tickets-table tbody tr:hover { background: #f8fafc; }
.tickets-table td { padding: 12px 14px; vertical-align: middle; }
.row-done { opacity: .6; }

.td-ticket-num { font-family: monospace; font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.bank-tag { background: #eff6ff; color: var(--primary); padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.contact-name  { font-weight: 600; }
.contact-email { color: var(--muted); font-size: 12px; }
.td-subject    { max-width: 220px; }
.subject-text  { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.admin-note-preview { font-size: 11px; color: var(--muted); margin-top: 2px; }
.td-date { color: var(--muted); white-space: nowrap; font-size: 12px; }

/* Priority badges */
.priority-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.pri-urgent { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pri-high   { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.pri-medium { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pri-low    { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Status select */
.status-select {
    padding: 5px 8px; border: 1.5px solid var(--border); border-radius: 6px;
    font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    background: #fff;
}

/* Badge colors for nav dots */
.badge-open     { background: #f59e0b; }
.badge-progress { background: #3b82f6; }
.badge-done     { background: var(--accent); }
.badge-closed   { background: var(--muted); }

/* Action buttons */
.td-actions { white-space: nowrap; display: flex; gap: 4px; }
.btn-icon {
    width: 30px; height: 30px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center;
    background: #f1f5f9; transition: background .15s, transform .1s;
}
.btn-icon:hover  { background: #e2e8f0; transform: scale(1.1); }
.btn-done.is-done { background: #dcfce7; }

/* Empty state */
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-card {
    background: var(--card); border-radius: var(--radius); width: 100%; max-width: 620px;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card);
}
.modal-header h3 { font-size: 16px; font-weight: 700; font-family: monospace; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 24px; }

.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px;
    background: var(--bg); padding: 16px; border-radius: 8px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.detail-subject     { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.detail-description { color: var(--text); line-height: 1.7; margin-bottom: 20px; font-size: 13px; }
.detail-note-form label { font-weight: 600; display: block; margin-bottom: 8px; }
.detail-note-form textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; margin-bottom: 10px; resize: vertical; }
.detail-note-form textarea:focus { outline: none; border-color: var(--primary); }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 28px; right: 28px; padding: 13px 20px; border-radius: 10px;
    font-weight: 600; font-size: 14px; z-index: 2000; box-shadow: 0 4px 20px rgba(0,0,0,.2);
    animation: slideUp .3s ease;
}
.toast-success { background: #1a2540; color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
