/* ══════════════════════════════════════════
   AgroFile – Style Sheet
   Color Palette:
   #13293D  Prussian Blue
   #006494  Sapphire Blue
   #247BA0  Celadon Blue
   #1B98E0  Carolina Blue
   #E8F1F2  Azure X11
   ══════════════════════════════════════════ */

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

:root {
  --prussian:   #13293D;
  --sapphire:   #006494;
  --celadon:    #247BA0;
  --carolina:   #1B98E0;
  --azure:      #E8F1F2;
  --white:      #FFFFFF;

  --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;

  --danger:   #EF4444;
  --success:  #22C55E;
  --warning:  #F59E0B;
  --info:     #1B98E0;

  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow:     0 4px 12px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 28px rgba(0,0,0,.16);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.22);

  --header-h:   60px;
  --sidebar-w:  260px;
  --toolbar-h:  54px;
  --transition: .18s ease;
}

html, body { height: 100%; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--gray-800); background: var(--gray-50); }

/* ══════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ══════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════ */
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--gray-500); }
.text-sm      { font-size: .8125rem; }
.mb-2         { margin-bottom: .5rem; }

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.1rem; border: none; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap; outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(27,152,224,.35); }
.btn-primary  { background: var(--sapphire); color: var(--white); }
.btn-primary:hover  { background: #00557E; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger   { background: var(--danger); color: var(--white); }
.btn-danger:hover   { background: #DC2626; }
.btn-sm       { padding: .35rem .8rem; font-size: .8125rem; }
.btn-full     { width: 100%; justify-content: center; }

/* ══════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════ */
.alert {
  padding: .6rem .9rem; border-radius: var(--radius-sm);
  font-size: .875rem; line-height: 1.4;
}
.alert-error  { background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; }
.alert-success { background: #F0FDF4; color: #15803D; border: 1px solid #86EFAC; }

/* ══════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════ */
.form-group   { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .8125rem; font-weight: 600; color: var(--gray-700); }
.form-input {
  padding: .55rem .75rem; border: 1.5px solid var(--gray-300);
  border-radius: var(--radius); font-size: .9rem; color: var(--gray-800);
  background: var(--white); transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--carolina); box-shadow: 0 0 0 3px rgba(27,152,224,.15); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }

/* ══════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner, .spinner-lg {
  display: inline-block; animation: spin .7s linear infinite;
}
.spinner     { width: 18px; height: 18px; }
.spinner-lg  { width: 44px; height: 44px; }


/* ══════════════════════════════════════════
   ─────────── LOGIN PAGE ───────────
   ══════════════════════════════════════════ */
.login-page { display: flex; min-height: 100vh; background: linear-gradient(135deg, var(--prussian) 0%, #0a4a6e 50%, var(--sapphire) 100%); }

.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 1.5rem;
}

.login-card {
  background: var(--white); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 420px;
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, var(--prussian) 0%, var(--sapphire) 100%);
  padding: 2.2rem 2rem 2rem; text-align: center; color: var(--white);
}
.login-logo-wrap { margin-bottom: 1rem; display: flex; justify-content: center; }
.login-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -.5px; }
.login-subtitle { font-size: .875rem; opacity: .8; margin-top: .3rem; }

.login-form { padding: 1.75rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; }

.input-wrap { position: relative; }
.input-wrap .form-input,
.input-wrap input {
  width: 100%; padding: .6rem .75rem .6rem 2.5rem;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  font-size: .9rem; outline: none; transition: var(--transition);
}
.input-wrap input:focus { border-color: var(--carolina); box-shadow: 0 0 0 3px rgba(27,152,224,.15); }

.input-icon {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--gray-400); pointer-events: none;
}
.toggle-pass {
  position: absolute; right: .65rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  padding: .2rem; display: flex; align-items: center;
  transition: color var(--transition);
}
.toggle-pass:hover { color: var(--sapphire); }
.toggle-pass svg { width: 20px; height: 20px; }

.btn-login { margin-top: .25rem; padding: .75rem; font-size: .95rem; gap: .6rem; }

.login-footer {
  padding: .75rem 2rem 1.25rem; text-align: center;
  font-size: .75rem; color: var(--gray-400);
}


/* ══════════════════════════════════════════
   ─────────── APP LAYOUT ───────────
   ══════════════════════════════════════════ */
body:not(.login-page) {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: 1fr;
  height: 100vh; overflow: hidden;
}

/* HEADER */
#appHeader {
  grid-row: 1;
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(90deg, var(--prussian) 0%, #004f78 100%);
  color: var(--white); padding: 0 1rem; height: var(--header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 100; position: relative;
}

.header-left { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }

.sidebar-toggle {
  background: rgba(255,255,255,.12); border: none; border-radius: var(--radius-sm);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: var(--white); cursor: pointer; transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,.22); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.header-logo { display: flex; align-items: center; gap: .55rem; }
.header-logo-text { font-size: 1.15rem; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; }

.header-center { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 .5rem; overflow: hidden; }

.header-right { display: flex; align-items: center; flex-shrink: 0; }

/* BREADCRUMB */
.breadcrumb {
  display: flex; align-items: center; gap: 0;
  font-size: .875rem; min-width: 0; flex-wrap: nowrap; overflow: hidden;
}
.breadcrumb-item {
  display: inline-flex; align-items: center; gap: .25rem;
  color: rgba(255,255,255,.75); cursor: pointer; padding: .3rem .4rem;
  border-radius: var(--radius-sm); white-space: nowrap; transition: var(--transition);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}
.breadcrumb-item:hover { color: var(--white); background: rgba(255,255,255,.12); }
.breadcrumb-item.active { color: var(--white); font-weight: 600; cursor: default; }
.breadcrumb-item.active:hover { background: none; }
.breadcrumb-sep { color: rgba(255,255,255,.4); font-size: 1rem; margin: 0 .1rem; user-select: none; }

/* USER AREA */
.user-area { position: relative; }

.avatar-btn {
  background: none; border: none; cursor: pointer; padding: .3rem;
  border-radius: var(--radius-full); transition: var(--transition);
}
.avatar-btn:hover .avatar-circle { box-shadow: 0 0 0 3px rgba(255,255,255,.3); }

.avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--carolina), var(--celadon));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; color: var(--white);
  border: 2.5px solid rgba(255,255,255,.4);
  transition: var(--transition); user-select: none;
}

.user-dropdown {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); min-width: 220px; z-index: 200;
  border: 1px solid var(--gray-100); overflow: hidden;
  animation: fadeDown .15s ease;
}
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-user-info {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1rem .9rem;
}
.dropdown-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--carolina), var(--celadon));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: var(--white);
}
.dropdown-username { font-weight: 700; font-size: .9rem; color: var(--gray-900); }
.dropdown-role {
  font-size: .75rem; color: var(--gray-500); margin-top: .1rem;
  text-transform: capitalize;
}

.dropdown-divider { height: 1px; background: var(--gray-100); margin: .15rem 0; }

.dropdown-item {
  display: flex; align-items: center; gap: .65rem;
  width: 100%; padding: .65rem 1rem; background: none; border: none;
  font-size: .875rem; color: var(--gray-700); cursor: pointer; text-align: left;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--gray-50); color: var(--sapphire); }
.dropdown-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.dropdown-item-danger { color: var(--danger) !important; }
.dropdown-item-danger:hover { background: #FEF2F2 !important; color: var(--danger) !important; }

/* APP LAYOUT */
#appLayout {
  grid-row: 2;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden; transition: grid-template-columns var(--transition);
}
#appLayout.sidebar-hidden { grid-template-columns: 0 1fr; }

/* SIDEBAR */
#sidebar {
  background: var(--white); border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; overflow: hidden;
  transition: var(--transition);
}
#appLayout.sidebar-hidden #sidebar { width: 0; overflow: hidden; opacity: 0; }

.sidebar-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem 1rem; font-weight: 700; font-size: .8125rem;
  color: var(--gray-600); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--gray-100);
  background: var(--azure); flex-shrink: 0;
}
.sidebar-header svg { width: 16px; height: 16px; color: var(--sapphire); }

.folder-tree { flex: 1; overflow-y: auto; padding: .4rem 0; }

.tree-node {
  display: flex; flex-direction: column;
}
.tree-node-row {
  display: flex; align-items: center; gap: 0;
  padding: .3rem 0; cursor: pointer; user-select: none;
  border-radius: 0; transition: background var(--transition); position: relative;
}
.tree-node-row:hover { background: var(--azure); }
.tree-node-row.active { background: rgba(0,100,148,.1); }
.tree-node-row.active .tree-label { color: var(--sapphire); font-weight: 600; }

.tree-toggle {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--gray-400); font-size: .7rem;
  transition: transform var(--transition); cursor: pointer; border-radius: 3px;
  z-index: 1; position: relative;
}
.tree-toggle:hover { color: var(--sapphire); background: rgba(0,100,148,.1); }
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.leaf { pointer-events: none; color: transparent; }

.tree-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--warning); margin-right: .4rem; }

.tree-label {
  font-size: .875rem; color: var(--gray-700); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex: 1;
}

.tree-children { padding-left: 1.25rem; }

.tree-root-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem 1rem .4rem .75rem; cursor: pointer; user-select: none;
  font-weight: 700; font-size: .875rem; color: var(--sapphire);
  transition: background var(--transition);
}
.tree-root-row:hover { background: var(--azure); }
.tree-root-row.active { background: rgba(0,100,148,.1); }
.tree-root-row svg { width: 17px; height: 17px; color: var(--sapphire); flex-shrink: 0; }

/* MAIN CONTENT */
#mainContent {
  display: flex; flex-direction: column; overflow: hidden; background: var(--gray-50);
}

/* TOOLBAR */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1.25rem; background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0; gap: .75rem;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: .5rem; }

.btn-toolbar {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .85rem; border: 1.5px solid transparent;
  border-radius: var(--radius); font-size: .8125rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-toolbar svg { width: 17px; height: 17px; }
.btn-new-folder { background: var(--azure); color: var(--sapphire); border-color: rgba(0,100,148,.2); }
.btn-new-folder:hover { background: rgba(0,100,148,.12); }
.btn-upload { background: var(--carolina); color: var(--white); border-color: var(--carolina); }
.btn-upload:hover { background: #0f87cd; border-color: #0f87cd; }

.view-toggle { display: flex; border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.btn-view {
  width: 34px; height: 32px; background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); cursor: pointer; transition: var(--transition);
}
.btn-view:hover { background: var(--gray-50); color: var(--sapphire); }
.btn-view.active { background: var(--sapphire); color: var(--white); }
.btn-view svg { width: 16px; height: 16px; }

/* DROP ZONE */
.drop-zone { flex: 1; overflow-y: auto; position: relative; padding: .5rem; }
.drop-zone.drag-over .drop-overlay { display: flex !important; }

.drop-overlay {
  position: absolute; inset: 0; background: rgba(0,100,148,.08);
  border: 3px dashed var(--carolina); border-radius: var(--radius-lg);
  z-index: 10; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.drop-overlay-inner {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  color: var(--sapphire); font-size: 1.1rem; font-weight: 700;
}
.drop-overlay-inner svg { width: 56px; height: 56px; opacity: .7; }

/* FILE GRID */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem; padding: .5rem;
}

.file-card {
  display: flex; flex-direction: column; align-items: center;
  background: var(--white); border: 2px solid transparent;
  border-radius: var(--radius-lg); padding: 1rem .75rem .8rem;
  cursor: pointer; transition: var(--transition); position: relative;
  user-select: none;
}
.file-card:hover { border-color: var(--carolina); box-shadow: var(--shadow-sm); background: var(--azure); }
.file-card.selected { border-color: var(--carolina); background: rgba(27,152,224,.08); }

.file-card-icon { width: 56px; height: 56px; margin-bottom: .65rem; flex-shrink: 0; }
.file-card-name {
  font-size: .75rem; color: var(--gray-800); text-align: center;
  word-break: break-word; line-height: 1.35; max-height: 2.7em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.file-card-size { font-size: .7rem; color: var(--gray-400); margin-top: .25rem; }

/* FILE LIST */
.file-list { padding: .5rem; }
.file-list table { width: 100%; border-collapse: collapse; }
.file-list th {
  padding: .6rem .9rem; text-align: left; font-size: .75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray-500); background: var(--white);
  border-bottom: 2px solid var(--gray-200); white-space: nowrap; position: sticky; top: 0;
}
.file-list th.sortable { cursor: pointer; }
.file-list th.sortable:hover { color: var(--sapphire); }
.sort-icon::after { content: '↕'; opacity: .4; margin-left: .3rem; }
.col-name { width: 45%; }
.col-size { width: 15%; }
.col-date { width: 25%; }
.col-actions { width: 15%; text-align: right; }

.file-list tr.file-row:hover { background: var(--azure); }
.file-list tr.file-row { cursor: pointer; transition: background var(--transition); }
.file-list td { padding: .55rem .9rem; border-bottom: 1px solid var(--gray-100); font-size: .875rem; }

.row-name { display: flex; align-items: center; gap: .65rem; }
.row-icon { width: 28px; height: 28px; flex-shrink: 0; }
.row-filename { font-weight: 500; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.row-size, .row-date { color: var(--gray-500); white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: .3rem; }

.btn-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: var(--transition);
}
.btn-icon:hover { background: var(--gray-100); color: var(--sapphire); }
.btn-icon.danger:hover { color: var(--danger); background: #FEF2F2; }
.btn-icon svg { width: 16px; height: 16px; }

/* EMPTY / LOADING STATE */
.empty-state, .loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 4rem 2rem; color: var(--gray-400); text-align: center;
}
.empty-state svg { width: 64px; height: 64px; opacity: .4; }
.empty-state h3 { font-size: 1rem; color: var(--gray-600); }
.empty-state p { font-size: .875rem; }
.empty-state strong { color: var(--sapphire); }


/* ══════════════════════════════════════════
   FILE ICONS (SVG-based, colored)
   ══════════════════════════════════════════ */
.icon-folder    { color: #F59E0B; }
.icon-image     { color: #8B5CF6; }
.icon-pdf       { color: #EF4444; }
.icon-doc       { color: #2563EB; }
.icon-xls       { color: #16A34A; }
.icon-ppt       { color: #EA580C; }
.icon-video     { color: #EC4899; }
.icon-audio     { color: #10B981; }
.icon-archive   { color: #F97316; }
.icon-code      { color: #06B6D4; }
.icon-txt       { color: #6B7280; }
.icon-file      { color: #94A3B8; }


/* ══════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 300; backdrop-filter: blur(2px);
}

.modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

.modal-box {
  background: var(--white); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 460px;
  pointer-events: all; animation: modalIn .18s ease;
}
.modal-box-sm { max-width: 380px; }
.modal-box-lg { max-width: 680px; }

@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--gray-100);
  font-size: 1.1rem; cursor: pointer; color: var(--gray-500); display: flex;
  align-items: center; justify-content: center; transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

.modal-body { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .85rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .9rem 1.25rem 1.1rem; border-top: 1px solid var(--gray-100);
}


/* ══════════════════════════════════════════
   CONTEXT MENU
   ══════════════════════════════════════════ */
.context-menu {
  position: fixed; background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 500; min-width: 185px;
  border: 1px solid var(--gray-200); overflow: hidden;
  animation: fadeDown .12s ease;
}
.ctx-item {
  display: flex; align-items: center; gap: .65rem;
  width: 100%; padding: .6rem 1rem; background: none; border: none;
  font-size: .875rem; color: var(--gray-700); cursor: pointer; text-align: left;
  transition: background var(--transition);
}
.ctx-item:hover { background: var(--azure); color: var(--sapphire); }
.ctx-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.ctx-item-danger { color: var(--danger); }
.ctx-item-danger:hover { background: #FEF2F2 !important; color: var(--danger) !important; }
.ctx-divider { height: 1px; background: var(--gray-100); margin: .2rem 0; }


/* ══════════════════════════════════════════
   UPLOAD PROGRESS
   ══════════════════════════════════════════ */
.upload-progress {
  position: fixed; bottom: 1.25rem; right: 1.25rem; width: 320px;
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200);
  z-index: 250; overflow: hidden; animation: slideUp .2s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.upload-progress-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem; background: var(--sapphire); color: var(--white);
  font-size: .875rem; font-weight: 600;
}
.upload-progress-header svg { width: 18px; height: 18px; flex-shrink: 0; }
.upload-progress-header span { flex: 1; }
.upload-close {
  background: rgba(255,255,255,.2); border: none; color: var(--white);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.upload-close:hover { background: rgba(255,255,255,.35); }

.upload-bar-wrap { height: 6px; background: var(--gray-200); }
.upload-bar { height: 100%; background: var(--carolina); transition: width .3s ease; width: 0; }

.upload-details { padding: .6rem 1rem .8rem; font-size: .8125rem; color: var(--gray-600); }
.upload-file-item { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; }
.upload-file-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.upload-file-ok   { color: var(--success); }
.upload-file-err  { color: var(--danger); }
.upload-file-pending { color: var(--gray-400); }


/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════ */
.toast-container {
  position: fixed; top: calc(var(--header-h) + .75rem); right: 1rem;
  z-index: 600; display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: .65rem;
  padding: .7rem 1rem; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); font-size: .875rem; font-weight: 500;
  min-width: 240px; max-width: 360px; pointer-events: all;
  animation: toastIn .2s ease; color: var(--white);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success { background: #15803D; }
.toast-error   { background: #DC2626; }
.toast-info    { background: var(--sapphire); }
.toast-warning { background: #B45309; }


/* ══════════════════════════════════════════
   USERS TABLE (admin)
   ══════════════════════════════════════════ */
.users-toolbar { margin-bottom: .75rem; }
.users-table-wrap { overflow-x: auto; }
.users-table-wrap table { width: 100%; border-collapse: collapse; }
.users-table-wrap th {
  padding: .5rem .75rem; text-align: left; font-size: .75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray-500); background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}
.users-table-wrap td {
  padding: .6rem .75rem; border-bottom: 1px solid var(--gray-100);
  font-size: .875rem; color: var(--gray-700);
}
.users-table-wrap tr:hover td { background: var(--azure); }

.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: var(--radius-full);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-admin { background: rgba(0,100,148,.12); color: var(--sapphire); }
.badge-user  { background: var(--gray-100); color: var(--gray-600); }

.add-user-form {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}
.add-user-form h4 { font-size: .9rem; font-weight: 700; color: var(--gray-800); margin-bottom: .85rem; }
