/* ================================================================
   士業向け顧客書類共有システム — Design System
   Modern Japanese SaaS UI Kit
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:        #2563EB;
  --primary-dark:   #1D4ED8;
  --primary-darker: #1E40AF;
  --primary-light:  #EFF6FF;
  --primary-muted:  #BFDBFE;

  --success:        #059669;
  --success-light:  #ECFDF5;
  --danger:         #DC2626;
  --danger-light:   #FEF2F2;
  --warning:        #D97706;
  --warning-light:  #FFFBEB;
  --info:           #0284C7;
  --info-light:     #F0F9FF;

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

  --bg:           #F1F5F9;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --border:       #E2E8F0;
  --border-strong:#CBD5E1;

  --text:   #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  /* Sidebar */
  --sb-bg:        #0F172A;
  --sb-border:    rgba(255,255,255,0.06);
  --sb-text:      #94A3B8;
  --sb-hover:     rgba(255,255,255,0.07);
  --sb-active-bg: rgba(37,99,235,0.18);
  --sb-active:    #60A5FA;
  --sb-width:     240px;

  --header-h: 58px;

  --r-xs:   3px;
  --r-sm:   5px;
  --r:      8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 6px rgba(0,0,0,.07),0 2px 4px rgba(0,0,0,.06);
  --shadow-md: 0 10px 15px rgba(0,0,0,.1),0 4px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 25px rgba(0,0,0,.1),0 10px 10px rgba(0,0,0,.04);
  --shadow-xl: 0 25px 50px rgba(0,0,0,.18);

  --t:      0.15s ease;
  --t-slow: 0.28s ease;
}

/* ================================================================
   RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
svg { display: block; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  outline: none;
  line-height: 1.4;
  text-decoration: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-muted); }
.btn-primary  { background: var(--primary); color:#fff; border-color:var(--primary); }
.btn-primary:hover  { background: var(--primary-dark); border-color:var(--primary-dark); }
.btn-secondary { background: var(--surface); color:var(--text-2); border-color:var(--border-strong); }
.btn-secondary:hover { background: var(--gray-50); border-color:var(--gray-400); }
.btn-danger { background: var(--danger); color:#fff; border-color:var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color:var(--text-2); border-color:transparent; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-success { background: var(--success); color:#fff; border-color:var(--success); }
.btn-success:hover { background: #047857; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-icon { padding: 7px; border-radius: var(--r-sm); }
.btn-icon.btn-sm { padding: 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-2); margin-bottom: 6px;
}
.form-label.req::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder { color: var(--text-3); }
.form-control.invalid { border-color: var(--danger); }
.form-control.invalid:focus { box-shadow: 0 0 0 3px var(--danger-light); }
select.form-control { cursor: pointer; 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%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint  { margin-top: 5px; font-size: 12px; color: var(--text-3); }
.form-error { margin-top: 5px; font-size: 12px; color: var(--danger); display: none; }
.form-control.invalid ~ .form-error { display: block; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ================================================================
   CARDS
   ================================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-xs); }
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body   { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}

/* Stat cards */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; display: flex; align-items: flex-start; gap: 16px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.amber  { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);  color: var(--danger); }
.stat-icon.purple { background: #F3E8FF; color: #7C3AED; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt thead tr { background: var(--gray-50); border-bottom: 1px solid var(--border); }
.dt thead th {
  padding: 10px 14px; text-align: left;
  font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.dt thead th.sortable { cursor: pointer; user-select: none; }
.dt thead th.sortable:hover { color: var(--primary); }
.dt tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t); }
.dt tbody tr:last-child { border-bottom: none; }
.dt tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.dt td { padding: 11px 14px; color: var(--text); vertical-align: middle; }
.dt td.muted { color: var(--text-3); }
.dt td.actions { white-space: nowrap; }
.dt-empty { text-align: center; padding: 40px; color: var(--text-3); }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; letter-spacing: .3px; white-space: nowrap;
}
.badge-blue   { background: var(--primary-light);   color: var(--primary-darker); }
.badge-green  { background: var(--success-light);   color: #047857; }
.badge-red    { background: var(--danger-light);    color: #991b1b; }
.badge-amber  { background: var(--warning-light);   color: #92400e; }
.badge-gray   { background: var(--gray-100);        color: var(--gray-600); }
.badge-purple { background: #F3E8FF;                color: #6D28D9; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.52);
  z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: all var(--t-slow);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(16px) scale(.97); transition: transform var(--t-slow);
}
.modal-backdrop.open .modal { transform: none; }
.modal-lg  { max-width: 720px; }
.modal-xl  { max-width: 940px; }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-sm); border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t);
}
.modal-close:hover { background: var(--gray-100); color: var(--text); }
.modal-body   { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-stack {
  position: fixed; top: 20px; right: 20px; z-index: 500;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--gray-900); color: #fff;
  padding: 12px 16px; border-radius: var(--r);
  font-size: 13px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-md); pointer-events: auto;
  max-width: 360px; animation: toastIn .3s ease forwards;
  border-left: 3px solid rgba(255,255,255,.3);
}
.toast.success { background: #065F46; border-left-color: #34D399; }
.toast.error   { background: #7F1D1D; border-left-color: #F87171; }
.toast.warning { background: #78350F; border-left-color: #FCD34D; }
.toast.info    { background: #0C4A6E; border-left-color: #38BDF8; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close { background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer; padding: 2px; line-height: 1; font-size: 16px; }
.toast-close:hover { color: #fff; }
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; max-height:80px; margin-bottom:0; } to { opacity:0; max-height:0; padding:0; margin:0; overflow:hidden; } }
.toast.out { animation: toastOut .3s ease forwards; }

/* ================================================================
   SIDEBAR LAYOUT
   ================================================================ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sb-width); background: var(--sb-bg);
  flex-shrink: 0; position: fixed; left:0; top:0; bottom:0;
  z-index: 200; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-logo {
  padding: 18px 16px; border-bottom: 1px solid var(--sb-border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.sidebar-logo-mark {
  width: 32px; height: 32px; background: var(--primary); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.sidebar-logo-text { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar-logo-text small { display: block; font-size: 10px; font-weight: 400; color: var(--sb-text); margin-top: 1px; }

.sidebar-nav { padding: 10px 0; flex: 1; }
.sidebar-section {
  padding: 8px 14px 4px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  color: rgba(148,163,184,.45); margin-top: 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; margin: 1px 8px;
  border-radius: var(--r-sm); color: var(--sb-text);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--t); user-select: none;
}
.sidebar-item:hover  { background: var(--sb-hover); color: #E2E8F0; }
.sidebar-item.active { background: var(--sb-active-bg); color: var(--sb-active); }
.sidebar-item svg    { flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  border-radius: var(--r-full); font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px;
}

.sidebar-footer { padding: 10px 8px; border-top: 1px solid var(--sb-border); flex-shrink: 0; }
.sidebar-user {
  display: flex; align-items: center; gap: 9px; padding: 8px;
  border-radius: var(--r-sm); cursor: pointer; transition: background var(--t);
}
.sidebar-user:hover { background: var(--sb-hover); }
.sidebar-avatar {
  width: 30px; height: 30px; border-radius: var(--r-full);
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.sidebar-user-info   { flex: 1; min-width: 0; }
.sidebar-user-name   { font-size: 12px; font-weight: 500; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role   { font-size: 10px; color: var(--sb-text); }

/* ================================================================
   MAIN AREA
   ================================================================ */
.main-area { margin-left: var(--sb-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.top-bar {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.top-bar-title { font-size: 15px; font-weight: 600; flex: 1; }
.top-bar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer; transition: all var(--t); position: relative;
}
.icon-btn:hover { background: var(--gray-100); border-color: var(--border-strong); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; background: var(--danger);
  border-radius: 50%; border: 1.5px solid var(--surface);
}

.main-content { padding: 24px; flex: 1; }

/* Page sections */
.section { display: none; }
.section.active { display: block; }

/* Page header */
.page-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.page-title    { font-size: 20px; font-weight: 700; }
.page-subtitle { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.page-actions  { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ================================================================
   TOOLBAR
   ================================================================ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-left  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Search bar */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 9px; color: var(--text-3); pointer-events: none; }
.search-wrap .form-control { padding-left: 32px; width: 240px; }

/* ================================================================
   FILE MANAGER (Folder tree + File list)
   ================================================================ */
.file-manager { display: flex; gap: 14px; }

.folder-pane {
  width: 210px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow-y: auto; padding: 8px;
  max-height: calc(100vh - 220px);
}
.folder-pane-hd {
  padding: 6px 6px 10px; font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .5px;
}
.folder-node { user-select: none; }
.folder-row {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 6px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13px; color: var(--text-2);
  transition: background var(--t);
}
.folder-row:hover { background: var(--gray-100); }
.folder-row.selected { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.folder-row.folder-row-download-root {
  background: #EEF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.folder-row.folder-row-download-root .folder-icon,
.folder-row.folder-row-download .folder-icon {
  color: #2563EB;
}
.folder-row.folder-row-download {
  color: #1E40AF;
}
.folder-toggle { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.folder-toggle svg { transition: transform var(--t); width: 10px; height: 10px; }
.folder-toggle.open svg { transform: rotate(90deg); }
.folder-icon { color: #F59E0B; flex-shrink: 0; }
.folder-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.folder-children { padding-left: 14px; }
.folder-children.hidden { display: none; }

.files-pane {
  flex: 1; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: 400px;
}
.files-pane-hd {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 13px; flex: 1; min-width: 0; flex-wrap: wrap; }
.bc-item { color: var(--text-3); cursor: pointer; transition: color var(--t); white-space: nowrap; }
.bc-item:hover { color: var(--primary); }
.bc-item.active { color: var(--text); font-weight: 500; cursor: default; }
.bc-sep { color: var(--text-3); font-size: 12px; }
.files-pane-body { flex: 1; overflow-y: auto; }

/* File rows */
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface-2); }
.file-row input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.file-thumb {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--gray-100); display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.file-actions { display: flex; gap: 4px; flex-shrink: 0; opacity: 0; transition: opacity var(--t); }
.file-row:hover .file-actions { opacity: 1; }

/* ================================================================
   UPLOAD ZONE
   ================================================================ */
.upload-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--r);
  padding: 36px 24px; text-align: center; cursor: pointer;
  transition: all var(--t-slow); background: var(--surface-2);
  margin: 16px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-zone-icon { color: var(--text-3); margin: 0 auto 12px; }
.upload-zone-text { font-size: 14px; color: var(--text-2); font-weight: 500; }
.upload-zone-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/* ================================================================
   NOTIFICATION LIST
   ================================================================ */
.notif-item {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background var(--t);
}
.notif-item:hover      { background: var(--surface-2); }
.notif-item.unread     { background: var(--primary-light); }
.notif-item.unread:hover { background: #DBEAFE; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }
.notif-dot.read { background: transparent; border: 1px solid var(--border-strong); }
.notif-body  { flex: 1; }
.notif-title { font-size: 13px; font-weight: 500; }
.notif-meta  { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ================================================================
   TABS
   ================================================================ */
.tab-bar {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 20px; overflow-x: auto;
}
.tab-btn {
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-3); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; transition: all var(--t); white-space: nowrap; outline: none;
}
.tab-btn:hover  { color: var(--text-2); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ================================================================
   DROPDOWN
   ================================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-md);
  min-width: 160px; z-index: 100; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all var(--t);
}
.dropdown-menu.open  { opacity: 1; visibility: visible; transform: none; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  font-size: 13px; color: var(--text-2); cursor: pointer; transition: background var(--t);
}
.dropdown-item:hover  { background: var(--gray-50); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-div { height: 1px; background: var(--border); margin: 4px 0; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; transition: all var(--t); color: var(--text-2);
}
.page-btn:hover   { background: var(--gray-100); border-color: var(--border-strong); }
.page-btn.active  { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center; padding: 56px 24px; color: var(--text-3);
}
.empty-state svg     { margin: 0 auto 14px; opacity: .35; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-desc  { font-size: 13px; }

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

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.gap-1        { gap: 4px; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.gap-4        { gap: 16px; }
.gap-6        { gap: 24px; }
.flex-1       { flex: 1; }
.flex-shrink-0{ flex-shrink: 0; }
.w-full       { width: 100%; }
.min-w-0      { min-width: 0; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.p-0   { padding: 0 !important; }
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; }
.text-muted   { color: var(--text-3); }
.text-secondary{ color: var(--text-2); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded  { border-radius: var(--r); }
.hidden   { display: none !important; }
.divider  { height: 1px; background: var(--border); margin: 16px 0; }

/* ================================================================
   SCROLLBAR (Webkit)
   ================================================================ */
::-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); }
