/* =====================================================
   THPT BẾN HẢI - HỆ THỐNG QUẢN LÝ VĂN BẢN
   assets/css/main.css
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --primary:      #1565C0;
  --primary-dark: #0D47A1;
  --primary-light:#1976D2;
  --primary-muted:#E3F2FD;
  --primary-hover:#BBDEFB;
  --accent:       #29B6F6;
  --white:        #ffffff;
  --bg:           #F5F7FA;
  --sidebar-bg:   #ffffff;
  --text-dark:    #1a1a2e;
  --text-mid:     #4a5568;
  --text-light:   #718096;
  --border:       #E2E8F0;
  --border-light: #EDF2F7;
  --success:      #27ae60;
  --warning:      #e67e22;
  --danger:       #e74c3c;
  --shadow-sm:    0 1px 3px rgba(21,101,192,0.08);
  --shadow-md:    0 2px 12px rgba(21,101,192,0.12);
  --shadow-lg:    0 8px 30px rgba(21,101,192,0.15);
  --radius:       6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --sidebar-w:    240px;
  --sidebar-col:  56px;
  --header-h:     56px;
  --font-main:    'Be Vietnam Pro', sans-serif;
  --font-display: 'Playfair Display', serif;
  --transition:   0.22s cubic-bezier(0.4,0,0.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--text-dark); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
ul,ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-main); }
input,select,textarea { font-family: var(--font-main); }
table { border-collapse: collapse; width: 100%; }

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

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  z-index: 200;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar.collapsed { width: var(--sidebar-col); }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap; overflow: hidden;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 34px; height: 34px; min-width: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: var(--font-display); flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}

.sidebar-logo-text { display: flex; flex-direction: column; overflow: hidden; }
.logo-school { font-size: 11.5px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.logo-sub { font-size: 10px; color: var(--text-light); white-space: nowrap; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section {
  font-size: 10px; font-weight: 700; color: var(--text-light);
  letter-spacing: 1px; text-transform: uppercase;
  padding: 12px 16px 4px; white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; color: var(--text-mid);
  font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  border-left: 3px solid transparent;
  margin: 1px 6px; border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { background: var(--primary-hover); color: var(--primary); }
.nav-item.active { background: var(--primary-muted); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

.nav-icon { width: 32px; min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--transition); }
.nav-badge { background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center; transition: opacity var(--transition); }

.sidebar.collapsed .nav-text, .sidebar.collapsed .nav-badge { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; margin: 1px 8px; }

.nav-tooltip {
  display: none; position: absolute; left: calc(var(--sidebar-col) + 6px); top: 50%; transform: translateY(-50%);
  background: var(--primary-dark); color: #fff; padding: 5px 10px; border-radius: var(--radius);
  font-size: 12px; white-space: nowrap; z-index: 300; pointer-events: none; box-shadow: var(--shadow-md);
}
.sidebar.collapsed .nav-item:hover .nav-tooltip { display: block; }

.sidebar-footer { border-top: 1px solid var(--border-light); padding: 8px 0; }

/* =====================================================
   MAIN
   ===================================================== */
.main-area { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left var(--transition); }
.main-area.sidebar-collapsed { margin-left: var(--sidebar-col); }

/* =====================================================
   HEADER
   ===================================================== */
.header {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}

.header-toggle {
  width: 36px; height: 36px; background: none; border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  color: var(--text-mid); font-size: 18px; transition: all var(--transition); flex-shrink: 0;
}
.header-toggle:hover { background: var(--primary-muted); color: var(--primary); border-color: var(--primary); }

.header-title { font-size: 16px; font-weight: 700; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.header-notif-btn {
  width: 36px; height: 36px; background: none; border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  color: var(--text-mid); font-size: 18px; position: relative; transition: all var(--transition);
}
.header-notif-btn:hover { background: var(--primary-muted); color: var(--primary); }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 8px; min-width: 16px; text-align: center; border: 1.5px solid #fff; }

.header-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 10px 4px 4px; border-radius: var(--radius-md);
  border: 1px solid var(--border); transition: all var(--transition);
  position: relative;
}
.header-user:hover { background: var(--primary-muted); border-color: var(--primary); }

.user-ava {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-name-sm { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.user-role-sm { font-size: 11px; color: var(--text-light); }

.user-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 180px; z-index: 500; overflow: hidden;
}
.header-user.open .user-dropdown { display: block; animation: dropFade 0.15s ease; }
@keyframes dropFade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-hd { padding: 12px; border-bottom: 1px solid var(--border-light); background: var(--primary-muted); }
.dropdown-hd .dh-name { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.dropdown-hd .dh-role { font-size: 11px; color: var(--text-light); }

.dd-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13px; color: var(--text-mid); transition: all var(--transition); cursor: pointer; }
.dd-item:hover { background: var(--primary-hover); color: var(--primary); }
.dd-item.danger { color: var(--danger); }
.dd-item.danger:hover { background: #fdf0ee; }
.dd-sep { border: none; border-top: 1px solid var(--border-light); margin: 2px 0; }

/* =====================================================
   CONTENT
   ===================================================== */
.content { flex: 1; padding: 20px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.page-head-left {}
.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.page-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.page-head-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 38px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; border: 1.5px solid transparent;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(21,101,192,0.3); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-muted); }
.btn-ghost { background: transparent; color: var(--text-mid); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text-dark); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }

/* =====================================================
   STAT CARDS
   ===================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }

.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary); border-radius: var(--radius) 0 0 var(--radius); }
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-1px); }

.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--primary-muted); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-val { font-size: 26px; font-weight: 700; color: var(--primary-dark); font-family: var(--font-display); line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--text-light); margin-top: 3px; }

/* =====================================================
   CARDS
   ===================================================== */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.card-body { padding: 16px; }

/* =====================================================
   DOC CARDS (mobile-first)
   ===================================================== */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

.doc-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); transition: all var(--transition); overflow: hidden;
  display: flex; flex-direction: column;
}
.doc-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); }

.doc-card-top { padding: 14px 14px 10px; flex: 1; }
.doc-card-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.doc-card-title { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-card-summary { font-size: 12px; color: var(--text-mid); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
.doc-card-info { display: flex; gap: 12px; font-size: 11px; color: var(--text-light); flex-wrap: wrap; }
.doc-card-info span { display: flex; align-items: center; gap: 3px; }

.doc-card-bottom { padding: 10px 14px; border-top: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg); }
.doc-card-actions { display: flex; gap: 6px; }

/* =====================================================
   BADGES
   ===================================================== */
.doc-type-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }

.badge-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.badge-status-new { background: #f0f0f0; color: #666; }
.badge-status-new::before { background: #aaa; }
.badge-status-inprogress { background: #FFF3E0; color: #E65100; }
.badge-status-inprogress::before { background: #FF9800; }
.badge-status-done { background: #E8F5E9; color: #2E7D32; }
.badge-status-done::before { background: #4CAF50; }
.badge-status-reject { background: #FFEBEE; color: #C62828; }
.badge-status-reject::before { background: #EF5350; }

.urgency-khan { background: #FFF3E0; color: #E65100; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.urgency-hotoc { background: #FFEBEE; color: #C62828; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; animation: blink 1.5s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* =====================================================
   TABLE
   ===================================================== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; }
.data-table thead tr { border-bottom: 2px solid var(--border-light); }
.data-table th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.data-table td { padding: 10px 12px; font-size: 13px; color: var(--text-dark); border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--primary-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* =====================================================
   FORM
   ===================================================== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-mid); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-control {
  width: 100%; padding: 0 12px; height: 40px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text-dark); font-size: 14px;
  outline: none; transition: all var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,0.1); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* =====================================================
   FILTERS
   ===================================================== */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-select { height: 38px; padding: 0 32px 0 12px; border: 1.5px solid var(--border); border-radius: var(--radius); background: #fff; font-size: 13px; color: var(--text-mid); outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23718096'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; transition: border-color var(--transition); }
.filter-select:focus { border-color: var(--primary); }

.search-input-wrap { position: relative; }
.search-input-wrap input { height: 38px; padding: 0 12px 0 38px; border: 1.5px solid var(--border); border-radius: var(--radius); background: #fff; font-size: 13px; outline: none; width: 240px; transition: all var(--transition); }
.search-input-wrap input:focus { border-color: var(--primary); width: 280px; }
.search-input-wrap .si-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 16px; pointer-events: none; }

/* =====================================================
   FLASH MESSAGES
   ===================================================== */
.flash-msg { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.flash-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.flash-error { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.flash-info { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination-wrap { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border-light); flex-wrap: wrap; gap: 8px; }
.pagi-info { font-size: 12px; color: var(--text-light); }
.pagi-btns { display: flex; gap: 4px; }
.pagi-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font-size: 13px; color: var(--text-mid); text-decoration: none; transition: all var(--transition); }
.pagi-btn:hover, .pagi-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagi-ellipsis { padding: 0 4px; line-height: 32px; color: var(--text-light); }

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.progress-wrap { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s ease; }

/* =====================================================
   COMMENTS (Chat style)
   ===================================================== */
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; }
.comment-item.mine { flex-direction: row-reverse; }
.comment-ava { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.comment-body { flex: 1; max-width: 75%; }
.comment-name { font-size: 11px; font-weight: 600; color: var(--text-light); margin-bottom: 4px; }
.comment-item.mine .comment-name { text-align: right; }
.comment-bubble { background: var(--primary-muted); border: 1px solid var(--primary-hover); border-radius: 14px 14px 14px 2px; padding: 10px 14px; font-size: 13px; line-height: 1.5; }
.comment-item.mine .comment-bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 14px 14px 2px 14px; }
.comment-time { font-size: 10px; color: var(--text-light); margin-top: 4px; }
.comment-item.mine .comment-time { text-align: right; }

.comment-input-wrap { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.comment-input-wrap textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 22px; font-size: 13px; resize: none; outline: none; transition: border-color var(--transition); }
.comment-input-wrap textarea:focus { border-color: var(--primary); }
.comment-send-btn { width: 44px; height: 44px; background: var(--primary); color: #fff; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; transition: all var(--transition); }
.comment-send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }

/* =====================================================
   FILE UPLOAD
   ===================================================== */
.file-upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-md); padding: 24px; text-align: center; cursor: pointer; transition: all var(--transition); }
.file-upload-zone:hover, .file-upload-zone.drag-over { border-color: var(--primary); background: var(--primary-muted); }
.file-upload-icon { font-size: 32px; margin-bottom: 8px; }
.file-upload-text { font-size: 14px; color: var(--text-mid); }
.file-upload-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--primary-muted); border: 1px solid var(--primary-hover); border-radius: var(--radius); font-size: 12px; }
.file-item-icon { font-size: 18px; }
.file-item-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-light); flex-shrink: 0; }
.file-item-del { background: none; border: none; color: var(--text-light); font-size: 16px; cursor: pointer; padding: 0; flex-shrink: 0; }
.file-item-del:hover { color: var(--danger); }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 16px 18px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.modal-close { width: 28px; height: 28px; background: none; border: none; font-size: 20px; color: var(--text-light); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.modal-close:hover { background: var(--bg); color: var(--text-dark); }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 8px; }

/* =====================================================
   DETAIL VIEW
   ===================================================== */
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.detail-field { }
.detail-label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 3px; }
.detail-value { font-size: 14px; color: var(--text-dark); font-weight: 500; }

/* =====================================================
   ASSIGNMENT CARD
   ===================================================== */
.assign-card { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.assign-card:last-child { margin-bottom: 0; }
.assign-person { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.assign-ava { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }

/* =====================================================
   MOBILE MENU
   ===================================================== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190; }
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: #fff; border-top: 1px solid var(--border); z-index: 150; }
.bottom-nav-inner { display: flex; height: 100%; }
.bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--text-light); cursor: pointer; transition: color var(--transition); border: none; background: none; }
.bnav-item.active, .bnav-item:hover { color: var(--primary); }
.bnav-icon { font-size: 22px; }
.bnav-badge-wrap { position: relative; }
.bnav-notif { position: absolute; top: -4px; right: -8px; background: var(--danger); color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 8px; }

/* =====================================================
   STATS
   ===================================================== */
.stat-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-bar-label { width: 140px; font-size: 12px; color: var(--text-mid); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar-track { flex: 1; height: 10px; background: var(--border-light); border-radius: 5px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.8s ease; }
.stat-bar-val { width: 40px; font-size: 12px; font-weight: 600; color: var(--text-dark); text-align: right; flex-shrink: 0; }

.chart-placeholder { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 0 8px; }
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--primary); transition: height 0.5s ease; min-height: 2px; }
.chart-bar-lbl { font-size: 9px; color: var(--text-light); text-align: center; }

/* =====================================================
   RESPONSIVE - TABLET
   ===================================================== */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .doc-cards { grid-template-columns: 1fr; }
}

/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.show { display: block; }
  .main-area { margin-left: 0 !important; padding-bottom: 60px; }
  .mobile-bottom-nav { display: block; }
  .stat-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .content { padding: 12px; }
  .page-title { font-size: 18px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .header-title { display: none; }
  .user-name-sm, .user-role-sm { display: none; }
  .search-input-wrap input { width: 140px; }
  .search-input-wrap input:focus { width: 180px; }
  .detail-info-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   UTILITY
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
