/* =====================================================
   TRƯỜNG CAO ĐẲNG DU LỊCH HUẾ - ADMIN SYSTEM
   public/css/style.css - Copy từ style-chuan.css + extensions
   ===================================================== */

@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');

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
  --burgundy:        #7b2d3e;
  --burgundy-dark:   #5c1f2c;
  --burgundy-light:  #9e3d52;
  --burgundy-muted:  #f5eaec;
  --burgundy-hover:  #f0d9dd;
  --white:           #ffffff;
  --bg:              #f7f5f4;
  --sidebar-bg:      #ffffff;
  --header-bg:       #ffffff;
  --text-dark:       #1a1a1a;
  --text-mid:        #4a4a4a;
  --text-light:      #888888;
  --border:          #e2dada;
  --border-light:    #ede8e8;
  --shadow-sm:       0 1px 3px rgba(123,45,62,0.08);
  --shadow-md:       0 2px 8px rgba(123,45,62,0.12);
  --shadow-lg:       0 4px 20px rgba(123,45,62,0.15);
  --sidebar-width:   220px;
  --sidebar-collapsed: 52px;
  --header-height:   46px;
  --font-main:       'Be Vietnam Pro', sans-serif;
  --font-display:    'Playfair Display', serif;
  --radius:          4px;
  --radius-md:       6px;
  --radius-lg:       10px;
  --transition:      0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 12.5px; scroll-behavior: smooth; }
body { font-family: var(--font-main); font-size: 12.5px; color: var(--text-dark); background: var(--bg); line-height: 1.55; overflow-x: hidden; -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); font-size: 12.5px; }
input, select, textarea { font-family: var(--font-main); font-size: 12.5px; }
table { border-collapse: collapse; width: 100%; }

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

/* ===================================================== SIDEBAR ===== */
.sidebar { width: var(--sidebar-width); 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-collapsed); }
.sidebar-logo { display: flex; align-items: center; gap: 6px; padding: 10px 12px; height: var(--header-height); border-bottom: 1px solid var(--border-light); white-space: nowrap; overflow: hidden; }
.sidebar-logo-icon { width: 26px; height: 26px; min-width: 26px; background: var(--burgundy); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.5px; }
.sidebar-logo-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.sidebar-logo-text .school-name { font-size: 10px; font-weight: 700; color: var(--burgundy); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; letter-spacing: 0.2px; }
.sidebar-logo-text .school-sub { font-size: 9px; color: var(--text-light); white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.nav-section-label { font-size: 9px; font-weight: 700; color: var(--text-light); letter-spacing: 0.8px; text-transform: uppercase; padding: 10px 14px 3px; white-space: nowrap; overflow: hidden; transition: opacity var(--transition); }
.sidebar.collapsed .nav-section-label { opacity: 0; height: 0; padding: 0; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--text-mid); font-size: 12px; font-weight: 500; white-space: nowrap; transition: background var(--transition), color var(--transition); cursor: pointer; position: relative; border-left: 2px solid transparent; margin: 0 4px; border-radius: var(--radius); }
.nav-item:hover { background: var(--burgundy-hover); color: var(--burgundy); }
.nav-item.active { background: var(--burgundy-muted); color: var(--burgundy); border-left-color: var(--burgundy); font-weight: 600; }
.nav-item .nav-icon { width: 28px; min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.nav-item .nav-text { overflow: hidden; text-overflow: ellipsis; transition: opacity var(--transition), width var(--transition); }
.sidebar.collapsed .nav-text, .sidebar.collapsed .nav-badge { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 6px; margin: 1px 6px; }
.nav-badge { margin-left: auto; background: var(--burgundy); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center; transition: opacity var(--transition); }
.sidebar-footer { border-top: 1px solid var(--border-light); padding: 8px 0; }
.nav-item .nav-tooltip { display: none; position: absolute; left: calc(var(--sidebar-collapsed) + 4px); top: 50%; transform: translateY(-50%); background: var(--burgundy-dark); color: #fff; padding: 4px 8px; border-radius: var(--radius); font-size: 11px; white-space: nowrap; z-index: 300; pointer-events: none; box-shadow: var(--shadow-md); }
.sidebar.collapsed .nav-item:hover .nav-tooltip { display: block; }

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

/* ===================================================== HEADER ===== */
.header { height: var(--header-height); background: var(--header-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; padding: 0 14px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-toggle { width: 30px; height: 30px; 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: 14px; transition: background var(--transition), color var(--transition); flex-shrink: 0; }
.header-toggle:hover { background: var(--burgundy-muted); color: var(--burgundy); border-color: var(--burgundy); }
.header-search { flex: 1; max-width: 320px; position: relative; }
.header-search input { width: 100%; height: 28px; padding: 0 10px 0 30px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text-dark); font-size: 12px; outline: none; transition: border-color var(--transition); }
.header-search input:focus { border-color: var(--burgundy); background: #fff; }
.header-search input::placeholder { color: var(--text-light); }
.header-search .search-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 12px; pointer-events: none; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-notif { width: 30px; height: 30px; 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: 14px; position: relative; transition: background var(--transition); }
.header-notif:hover { background: var(--burgundy-muted); color: var(--burgundy); }
.notif-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; background: var(--burgundy); border-radius: 50%; border: 1px solid #fff; }
.header-user { display: flex; align-items: center; gap: 6px; cursor: pointer; position: relative; padding: 2px 6px 2px 2px; border-radius: var(--radius-md); border: 1px solid var(--border); transition: background var(--transition); }
.header-user:hover { background: var(--burgundy-muted); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 11.5px; font-weight: 600; color: var(--text-dark); white-space: nowrap; }
.user-role { font-size: 10px; color: var(--text-light); white-space: nowrap; }
.user-chevron { font-size: 10px; color: var(--text-light); transition: transform var(--transition); }
.header-user.open .user-chevron { transform: rotate(180deg); }
.user-dropdown { display: none; position: absolute; top: calc(100% + 4px); right: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 160px; z-index: 500; overflow: hidden; }
.header-user.open .user-dropdown { display: block; animation: dropIn 0.15s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-header { padding: 10px 12px; border-bottom: 1px solid var(--border-light); background: var(--burgundy-muted); }
.dropdown-header .dh-name { font-size: 12px; font-weight: 700; color: var(--burgundy-dark); }
.dropdown-header .dh-email { font-size: 10px; color: var(--text-light); }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 12px; color: var(--text-mid); transition: background var(--transition); cursor: pointer; }
.dropdown-item:hover { background: var(--burgundy-hover); color: var(--burgundy); }
.dropdown-item .di-icon { font-size: 13px; width: 16px; text-align: center; }
.dropdown-divider { border: none; border-top: 1px solid var(--border-light); margin: 2px 0; }
.dropdown-item.danger { color: #c0392b; }
.dropdown-item.danger:hover { background: #fdf0ee; }

/* ===================================================== CONTENT ===== */
.main-content { flex: 1; padding: 14px; overflow-x: hidden; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--burgundy-dark); line-height: 1.2; }
.page-subtitle { font-size: 11px; color: var(--text-light); margin-top: 1px; }
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-light); }
.breadcrumb-item { color: var(--text-light); }
.breadcrumb-item.active { color: var(--burgundy); font-weight: 500; }
.breadcrumb-sep { color: var(--border); font-size: 10px; }

/* ===================================================== STAT CARDS ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--burgundy); border-radius: var(--radius) 0 0 var(--radius); }
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--burgundy); }
.stat-icon { width: 38px; height: 38px; border-radius: var(--radius-md); background: var(--burgundy-muted); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 19px; font-weight: 700; color: var(--burgundy-dark); line-height: 1; font-family: var(--font-display); }
.stat-label { font-size: 10.5px; color: var(--text-light); margin-top: 2px; }
.stat-change { font-size: 10px; font-weight: 600; margin-top: 2px; }
.stat-change.up { color: #27ae60; }
.stat-change.down { color: #e74c3c; }

/* ===================================================== CHARTS ===== */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 8px; }
.charts-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.chart-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; box-shadow: var(--shadow-sm); }
.chart-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.chart-title { font-size: 12.5px; font-weight: 700; color: var(--text-dark); }
.chart-subtitle { font-size: 10px; color: var(--text-light); margin-top: 1px; }

/* ===================================================== TABLE ===== */
.table-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border-light); gap: 8px; flex-wrap: wrap; }
.table-card-title { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.filter-select { height: 26px; padding: 0 22px 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); font-size: 11.5px; color: var(--text-mid); outline: none; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; transition: border-color var(--transition); }
.filter-select:focus { border-color: var(--burgundy); }

/* ===================================================== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: var(--radius); font-size: 11.5px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.btn-primary:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); }
.btn-outline { background: transparent; color: var(--burgundy); border-color: var(--burgundy); }
.btn-outline:hover { background: var(--burgundy-muted); }
.btn-ghost { background: transparent; color: var(--text-mid); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text-dark); }
.btn-sm { height: 22px; padding: 0 7px; font-size: 10.5px; }
.btn-danger { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.btn-danger:hover { background: #c0392b; }

/* ===================================================== DATA TABLE ===== */
.data-table { width: 100%; }
.data-table thead tr { background: #fff; border-bottom: 2px solid var(--border-light); }
.data-table th { padding: 7px 10px; text-align: left; font-size: 10.5px; font-weight: 700; color: var(--burgundy); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.data-table td { padding: 6px 10px; font-size: 12px; color: var(--text-dark); border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--burgundy-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.col-actions { white-space: nowrap; display: flex; gap: 3px; }

/* ===================================================== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 12px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.badge-active   { background: #eafaf1; color: #27ae60; }
.badge-inactive { background: #fef9e7; color: #d68910; }
.badge-stopped  { background: #fdedec; color: #e74c3c; }
.badge-new      { background: var(--burgundy-muted); color: var(--burgundy); }
.badge-cd       { background: #eaf2ff; color: #2980b9; }
.badge-tc       { background: #f0eaff; color: #8e44ad; }
.badge-sc       { background: #eafff6; color: #1a9e6b; }

/* ===================================================== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 3px; padding: 8px 12px; border-top: 1px solid var(--border-light); justify-content: flex-end; }
.pagination-info { font-size: 11px; color: var(--text-light); margin-right: auto; }
.page-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font-size: 11.5px; color: var(--text-mid); cursor: pointer; transition: all var(--transition); text-decoration: none; }
.page-btn:hover, .page-btn.active { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }

/* ===================================================== PROFILE ===== */
.profile-sidebar-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 12px; box-shadow: var(--shadow-sm); text-align: center; }
.profile-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--burgundy-dark); margin-bottom: 2px; }
.profile-id-badge { display: inline-block; background: var(--burgundy-muted); color: var(--burgundy); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }
.profile-status { margin-bottom: 12px; }
.profile-sidebar-divider { border: none; border-top: 1px solid var(--border-light); margin: 10px 0; }
.profile-sidebar-info { text-align: left; }
.psi-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 11.5px; }
.psi-icon { color: var(--burgundy); font-size: 12px; width: 14px; text-align: center; }
.psi-label { color: var(--text-light); width: 60px; flex-shrink: 0; font-size: 10.5px; }
.psi-value { color: var(--text-dark); font-weight: 500; flex: 1; }

/* ===================================================== INFO CARD ===== */
.info-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.info-card-header { padding: 9px 12px; background: var(--burgundy-muted); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.info-card-title { font-size: 12.5px; font-weight: 700; color: var(--burgundy-dark); display: flex; align-items: center; gap: 6px; }
.info-card-body { padding: 12px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
.info-field { display: flex; flex-direction: column; gap: 2px; }
.info-field-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.info-field-value { font-size: 12.5px; color: var(--text-dark); font-weight: 500; }

/* ===================================================== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.3px; }
.form-control { height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text-dark); font-size: 12px; outline: none; transition: border-color var(--transition), box-shadow var(--transition); width: 100%; }
.form-control:focus { border-color: var(--burgundy); box-shadow: 0 0 0 2px rgba(123,45,62,0.1); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { height: auto; padding: 6px 8px; resize: vertical; min-height: 60px; }

/* ===================================================== TABS ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.tab-btn { padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--text-light); cursor: pointer; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--transition), border-color var(--transition); }
.tab-btn:hover { color: var(--burgundy); }
.tab-btn.active { color: var(--burgundy); border-bottom-color: var(--burgundy); font-weight: 600; }

/* ===================================================== PROGRESS ===== */
.progress-bar-wrap { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.progress-bar-fill { height: 100%; border-radius: 3px; background: var(--burgundy); transition: width 0.5s ease; }
.progress-bar-fill.green { background: #27ae60; }
.progress-bar-fill.orange { background: #e67e22; }

/* ===================================================== FLASH MESSAGE ===== */
.flash-msg {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; margin: 0 14px 0;
  border-radius: var(--radius); font-size: 12.5px;
  animation: fadeIn 0.2s ease;
}
.flash-success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }
.flash-error   { background: #fdedec; color: #c0392b; border: 1px solid #f5c6cb; }
.flash-warning { background: #fef9e7; color: #b7770d; border: 1px solid #fcefc7; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ===================================================== MODAL ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 90%; max-width: 500px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp 0.2s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { padding: 12px 14px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 13px; font-weight: 700; color: var(--burgundy-dark); }
.modal-body { padding: 14px; }
.modal-footer { padding: 10px 14px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 6px; }

/* ===================================================== MOBILE ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190; }

/* ===================================================== RESPONSIVE ===== */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .charts-grid-3 { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }
  .main-area { margin-left: 0 !important; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .charts-grid-3 { grid-template-columns: 1fr; }
  .main-content { padding: 8px; }
  .info-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
}

/* ===================================================== UTILITIES ===== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-burg   { color: var(--burgundy); }
.text-muted  { color: var(--text-light); }
.fw-bold     { font-weight: 700; }
.fw-600      { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mb-8  { margin-bottom: 8px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.w-full { width: 100%; }
.num-mono { font-variant-numeric: tabular-nums; }
.tag-list { display: flex; gap: 3px; flex-wrap: wrap; }
.tag { background: var(--burgundy-muted); color: var(--burgundy); border: 1px solid rgba(123,45,62,0.15); border-radius: 10px; padding: 1px 7px; font-size: 10px; font-weight: 600; }

/* ===== BADGE TRẠNG THÁI MỚI (v2) ===== */
.badge-good      { background:#d4edda; color:#155724; }
.badge-fixable   { background:#fff3cd; color:#856404; }
.badge-unfixable { background:#f8d7da; color:#721c24; }
.badge-repairing { background:#cce5ff; color:#004085; }

/* ===== INLINE EDIT ROW ===== */
.tl-list-wrap { background:#fff; border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:var(--shadow-sm); overflow:hidden; }
.tl-table { width:100%; border-collapse:collapse; }
.tl-table th { padding:7px 10px; font-size:10.5px; font-weight:700; color:var(--burgundy); text-transform:uppercase; letter-spacing:.3px; border-bottom:2px solid var(--border-light); background:#fff; white-space:nowrap; }
.tl-table td { padding:0; border-bottom:1px solid var(--border-light); vertical-align:middle; }
.tl-table tbody tr:hover { background:var(--burgundy-hover); }
.tl-table tbody tr:last-child td { border-bottom:none; }
.tl-cell { padding:5px 8px; font-size:12px; }

/* Inline edit input/select */
.ie-select, .ie-input {
  height:28px; padding:0 6px;
  border:1px solid var(--border); border-radius:var(--radius);
  background:#fff; font-size:12px; font-family:var(--font-main);
  color:var(--text-dark); outline:none; width:100%;
  transition:border-color .15s, box-shadow .15s;
}
.ie-select:focus, .ie-input:focus { border-color:var(--burgundy); box-shadow:0 0 0 2px rgba(123,45,62,.1); }

/* Row đang edit */
.tl-table tbody tr.editing { background:var(--burgundy-muted) !important; }
.tl-table tbody tr.editing td { border-bottom:1px solid var(--burgundy); }

/* Nút action nhỏ */
.ie-btn { height:24px; padding:0 8px; border-radius:var(--radius); font-size:11px; font-weight:600; border:1px solid transparent; cursor:pointer; transition:all .15s; white-space:nowrap; font-family:var(--font-main); }
.ie-btn-save   { background:var(--burgundy); color:#fff; border-color:var(--burgundy); }
.ie-btn-save:hover   { background:var(--burgundy-dark); }
.ie-btn-cancel { background:transparent; color:var(--text-light); border-color:var(--border); }
.ie-btn-cancel:hover { background:var(--bg); color:var(--text-dark); }
.ie-btn-edit   { background:transparent; color:var(--burgundy); border-color:var(--burgundy); }
.ie-btn-edit:hover   { background:var(--burgundy-muted); }
.ie-btn-hist   { background:transparent; color:#2980b9; border-color:#2980b9; }
.ie-btn-hist:hover   { background:#eaf2ff; }

/* Cột trạng thái có màu nền theo nhóm */
.status-cell-good      { border-left:3px solid #27ae60; }
.status-cell-broken    { border-left:3px solid #e74c3c; }
.status-cell-repairing { border-left:3px solid #2980b9; }
.status-cell-inactive  { border-left:3px solid #888; }
.status-cell-new       { border-left:3px solid var(--burgundy); }

/* Pending badge */
.badge-pending-approval { background:#EEEDFE; color:#3C3489; animation:pulse-pending 2s ease-in-out infinite; }
@keyframes pulse-pending { 0%,100%{opacity:1} 50%{opacity:.6} }

/* Drawer lịch sử (slide từ phải) */
.history-drawer {
  position:fixed; top:0; right:-420px; width:420px; height:100vh;
  background:#fff; box-shadow:-4px 0 20px rgba(0,0,0,.15);
  z-index:1500; transition:right .3s cubic-bezier(.4,0,.2,1);
  display:flex; flex-direction:column; overflow:hidden;
}
.history-drawer.open { right:0; }
.history-drawer-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:1499;
}
.history-drawer-overlay.open { display:block; }
.hd-header { padding:12px 14px; background:var(--burgundy); color:#fff; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.hd-title  { font-size:13px; font-weight:600; }
.hd-close  { background:rgba(255,255,255,.15); border:none; color:#fff; width:26px; height:26px; border-radius:4px; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; }
.hd-body   { flex:1; overflow-y:auto; padding:12px 14px; }
.hd-body::-webkit-scrollbar { width:4px; }
.hd-body::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }

/* Timeline trong drawer */
.htl { display:flex; flex-direction:column; gap:0; }
.htl-item { display:flex; gap:8px; }
.htl-left { width:18px; display:flex; flex-direction:column; align-items:center; flex-shrink:0; }
.htl-dot  { width:10px; height:10px; border-radius:50%; flex-shrink:0; margin-top:4px; border:2px solid; }
.htl-line { width:1.5px; flex:1; background:var(--border-light); margin:2px 0; }
.htl-body { flex:1; padding-bottom:12px; }
.htl-period { font-size:10px; color:var(--text-light); margin-bottom:3px; }
.htl-status { display:flex; align-items:center; gap:5px; margin-bottom:2px; }
.htl-meta   { font-size:10.5px; color:var(--text-mid); }
.htl-note   { font-size:10.5px; color:var(--text-light); font-style:italic; }
.htl-approved { font-size:9.5px; color:#27ae60; margin-top:1px; }
.htl-pending  { font-size:9.5px; color:#3C3489; margin-top:1px; }
.htl-rejected { font-size:9.5px; color:#e74c3c; margin-top:1px; }

/* Value log trong drawer */
.vl-item { display:flex; align-items:center; gap:6px; padding:5px 0; border-bottom:1px solid var(--border-light); font-size:11.5px; }
.vl-item:last-child { border-bottom:none; }
.vl-up   { color:#27ae60; font-weight:600; }
.vl-down { color:#e74c3c; font-weight:600; }

@media (max-width:640px) {
  .history-drawer { width:100%; right:-100%; }
}
