/* ═══════════════════════════════════════════════════════════
   Client Upload System — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg:        #0d0f14;
    --bg2:       #13161e;
    --bg3:       #1a1e29;
    --border:    #252a38;
    --border2:   #2e3447;
    --text:      #e8eaf0;
    --text2:     #8b92a8;
    --text3:     #5a6178;
    --accent:    #5b7cfa;
    --accent2:   #3d5ce8;
    --accent-g:  linear-gradient(135deg, #5b7cfa 0%, #8b5cf6 100%);
    --success:   #22c55e;
    --warning:   #f59e0b;
    --danger:    #ef4444;
    --info:      #06b6d4;
    --radius:    10px;
    --radius-sm: 6px;
    --shadow:    0 4px 24px rgba(0,0,0,.4);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
    --trans:     .18s ease;
    --font:      'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7c99fd; }

/* ─── Typography ──────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }
h4 { font-size: .95rem;  font-weight: 600; }

/* ─── Layout ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: .75rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--trans);
}
.card:hover { border-color: var(--border2); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans);
    white-space: nowrap;
    line-height: 1.4;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary    { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent2); }
.btn-gradient   { background: var(--accent-g); color: #fff; }
.btn-gradient:hover:not(:disabled) { opacity: .9; }
.btn-success    { background: rgba(34,197,94,.15); color: var(--success); border: 1px solid rgba(34,197,94,.2); }
.btn-success:hover:not(:disabled) { background: rgba(34,197,94,.25); }
.btn-danger     { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.25); }
.btn-ghost      { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.btn-icon       { padding: .4rem; width: 32px; height: 32px; justify-content: center; }
.btn-sm         { padding: .3rem .65rem; font-size: .8rem; }
.btn-lg         { padding: .65rem 1.5rem; font-size: 1rem; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 500; color: var(--text2); margin-bottom: .4rem; }
.form-control {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    padding: .55rem .8rem;
    transition: border-color var(--trans);
    outline: none;
    font-family: var(--font);
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text3); }
textarea.form-control { resize: vertical; min-height: 80px; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; color: var(--text2); }
.checkbox-label input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-success  { background: rgba(34,197,94,.15); color: var(--success); }
.badge-danger   { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-warning  { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-info     { background: rgba(6,182,212,.15); color: var(--info); }
.badge-neutral  { background: var(--bg3); color: var(--text3); }

/* ─── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { font-size: .8rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: .65rem 1rem; text-align: left; background: var(--bg3); border-bottom: 1px solid var(--border); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    opacity: 0; pointer-events: none;
    transition: opacity var(--trans);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--trans);
    box-shadow: var(--shadow);
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 1.1rem; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: color var(--trans); }
.modal-close:hover { color: var(--text); }

/* ─── Toast Notifications ─────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 9999;
    display: flex; flex-direction: column-reverse; gap: .6rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.1rem;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 260px;
    max-width: 380px;
    font-size: .875rem;
    animation: slideIn .22s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--info); }
.toast-msg { flex: 1; line-height: 1.4; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* ─── Progress Bars ───────────────────────────────────────── */
.progress-bar-wrap {
    background: var(--bg3);
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 20px;
    background: var(--accent-g);
    transition: width .3s ease;
}
.progress-bar.success { background: var(--success); }
.progress-bar.danger  { background: var(--danger); }

/* ─── Empty / Error States ────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 3rem 1rem; color: var(--text3); text-align: center; gap: 1rem;
}
.empty-state i { font-size: 3rem; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ─── Loading ─────────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 50%, var(--bg3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ─── Utilities ───────────────────────────────────────────── */
.text-muted  { color: var(--text2); }
.text-small  { font-size: .8rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: .75rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: .75rem; }
.mb-3 { margin-bottom: 1rem; }
.d-none { display: none !important; }

/* ─── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .35rem; font-size: .875rem; flex-wrap: wrap; }
.breadcrumb-item { color: var(--text3); }
.breadcrumb-item.active { color: var(--text); }
.breadcrumb-sep { color: var(--text3); }
.breadcrumb a { color: var(--accent); }

/* ─── Search Input ────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: .85rem; }
.search-input { padding-left: 2.2rem; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 1.4rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .modal { max-width: 100%; margin: 0 .5rem; }
    td, th { padding: .6rem .75rem; }
}
