:root {
  --primary-blue: #0b5fa5;
  --header-dark-blue: #084980;
  --secondary-blue: #1976d2;
  --light-blue: #e3f2fd;
  --border-color: #d1dbe5;
  --table-header-bg: #1565c0;
  --day-header-bg: #eaf1fb;
  --text-dark: #222;
  --text-muted: #666;
  --danger: #d32f2f;
  --warning: #f57c00;
  --success: #2e7d32;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text-dark);
  background-color: #f4f6f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HEADER ================= */
.top-header {
  background: linear-gradient(90deg, #094a82 0%, #0d5ea0 100%);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 46px;
  width: auto;
  cursor: pointer;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.03);
}

.brand-text h1 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  opacity: 0.9;
}

.brand-text h2 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 800;
  color: #ffd54f;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  transition: background 0.2s;
}

.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.25);
}

.user-avatar-icon {
  width: 26px;
  height: 26px;
  background: #fff;
  color: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  color: var(--text-dark);
  min-width: 200px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  border-radius: 6px;
  z-index: 1000;
  overflow: visible;
}

/* Cầu nối vô hình giúp rê chuột không bao giờ bị mất menu dropdown */
.user-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

.user-profile-badge:hover .user-dropdown-menu,
.user-profile-badge:focus-within .user-dropdown-menu,
.user-dropdown-menu:hover,
.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-menu .user-info-head {
  padding: 10px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #eee;
}

.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 12px;
}

.user-dropdown-menu a:hover {
  background: var(--light-blue);
  color: var(--primary-blue);
}

/* ================= SUB-NAVBAR ================= */
.sub-navbar {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sub-nav-links {
  display: flex;
  list-style: none;
}

.sub-nav-links li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  text-decoration: none;
  color: #444;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.sub-nav-links li a:hover,
.sub-nav-links li.active a {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  background-color: #f9fbff;
}

.sub-nav-links .nav-dropdown {
  position: relative;
}

.sub-nav-links .nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  min-width: 240px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  border: 1px solid #d0d7de;
  border-radius: 6px;
  list-style: none;
  padding: 6px 0;
  z-index: 1000;
  margin: 0;
}

.sub-nav-links .nav-dropdown:hover .dropdown-menu,
.sub-nav-links .nav-dropdown.open .dropdown-menu {
  display: block;
}

.sub-nav-links .nav-dropdown .dropdown-menu li {
  width: 100%;
}

.sub-nav-links .nav-dropdown .dropdown-menu li a {
  padding: 9px 16px;
  border-bottom: none;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.sub-nav-links .nav-dropdown .dropdown-menu li a:hover {
  background: #eaf2fd;
  color: #0b5fa5;
}


.sub-nav-right-btn {
  background-color: var(--primary-blue);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-nav-right-btn:hover {
  background-color: var(--header-dark-blue);
}

/* ================= MAIN LAYOUT ================= */
.main-wrapper {
  display: flex;
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #ddd;
  flex-shrink: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
}

.menu-group-title {
  padding: 8px 14px;
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  font-weight: bold;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  text-decoration: none;
  color: #444;
  font-size: 13px;
  border-left: 3px solid transparent;
}

.sidebar-item a:hover {
  background: #f0f4f9;
  color: var(--primary-blue);
}

.sidebar-item.active a {
  background: #e8f0fe;
  color: var(--primary-blue);
  border-left-color: var(--primary-blue);
  font-weight: 600;
}

.sidebar-item .sub-count {
  margin-left: auto;
  background: #ff5252;
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: bold;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 16px 20px;
  overflow-x: auto;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  margin-bottom: 14px;
}

.breadcrumb-bar a {
  color: var(--primary-blue);
  text-decoration: none;
}

/* ================= FILTER CARD ================= */
.card-box {
  background: #fff;
  border: 1px solid #d2d6de;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tab-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.tab-btn {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #f8f9fa;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
}

.tab-btn.active {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #444;
}

.filter-group select,
.filter-group input {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 12px;
  background-color: #fff;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(11, 95, 165, 0.15);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px dashed #eee;
  padding-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--header-dark-blue);
}

.btn-success {
  background: #2e7d32;
  color: #fff;
}

.btn-success:hover {
  background: #1b5e20;
}

.btn-danger {
  background: #d32f2f;
  color: #fff;
}

.btn-danger:hover {
  background: #b71c1c;
}

.btn-secondary {
  background: #f1f3f4;
  color: #333;
  border-color: #ccc;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

/* ================= SCHEDULE TABLE ================= */
.schedule-table-wrapper {
  background: #fff;
  border: 1px solid #b0bec5;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.schedule-table thead tr th {
  background-color: var(--table-header-bg);
  color: #fff;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #0d47a1;
  text-align: center;
}

.schedule-table td {
  padding: 8px 10px;
  border: 1px solid #cfd8dc;
  vertical-align: top;
}

.day-header-row td {
  background-color: var(--day-header-bg);
  font-weight: bold;
  color: #0d47a1;
  font-size: 13px;
  padding: 7px 12px;
  border-top: 2px solid #90caf9;
}

.session-cell {
  background-color: #fafafa;
  font-weight: 600;
  color: #555;
  text-align: center;
  width: 70px;
  vertical-align: middle;
}

.meeting-item-card {
  border-left: 3px solid var(--primary-blue);
  background: #f8fbfe;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 0 4px 4px 0;
  position: relative;
}

.meeting-item-card:last-child {
  margin-bottom: 0;
}

.meeting-title-bold {
  font-weight: 700;
  color: #0b5fa5;
  font-size: 13px;
  margin-bottom: 3px;
}

.badge-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.badge-approved {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.badge-pending {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffe082;
}

/* Single-row empty day styling */
.empty-day-row td {
  background: #f8fafc !important;
  padding: 4px 12px !important;
  border-top: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  height: 28px !important;
}

.empty-day-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.empty-day-title {
  color: #475569;
  font-weight: 700;
  font-size: 12px;
}

.empty-day-text {
  color: #94a3b8;
  font-style: italic;
  font-size: 11px;
  font-weight: normal;
}

/* Compact empty session styling */
.empty-session-compact-row td {
  padding: 2px 8px !important;
  background: #fafafa !important;
  border-bottom: 1px dashed #e2e8f0 !important;
  height: 22px !important;
}

.empty-session-compact-text {
  color: #94a3b8 !important;
  font-style: italic !important;
  font-size: 11px !important;
}

/* Density: Gọn gàng (Fit TV) */
.density-compact .schedule-table td {
  padding: 3px 6px !important;
  line-height: 1.25 !important;
}
.density-compact .schedule-table th {
  padding: 5px 8px !important;
}
.density-compact .day-header-row td {
  padding: 3px 8px !important;
}
.density-compact .meeting-title-bold {
  margin-bottom: 1px !important;
}

/* Density: Tiêu chuẩn (Normal) */
.density-normal .schedule-table td {
  padding: 7px 10px;
  line-height: 1.4;
}

/* Density: Thoáng đãng (Comfortable) */
.density-comfortable .schedule-table td {
  padding: 11px 14px;
  line-height: 1.5;
}

/* ================= MODAL DIALOG ================= */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.show {
  display: flex;
}

.modal-window {
  background: #fff;
  border-radius: 6px;
  width: 90%;
  max-width: 750px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  background: var(--primary-blue);
  color: #fff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 18px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* CẢNH BÁO TRÙNG LỊCH */
.conflict-alert-box {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-left: 5px solid #d32f2f;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  display: none;
  animation: shake 0.3s ease-in-out;
}

.conflict-alert-box.show {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.conflict-alert-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.conflict-alert-desc {
  font-size: 12px;
  line-height: 1.5;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}

.form-group label span.req {
  color: #d32f2f;
}

.form-control {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(11, 95, 165, 0.2);
}

.form-control.is-invalid {
  border-color: #d32f2f;
  background-color: #fff8f8;
}

/* ================= FOOTER ================= */
.app-footer {
  background: #fff;
  border-top: 2px solid var(--primary-blue);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 11px;
  color: #555;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  height: 36px;
  width: auto;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.footer-info h4 {
  font-size: 12px;
  color: #0b5fa5;
  margin-bottom: 3px;
}

.footer-apps {
  display: flex;
  gap: 8px;
}

.footer-app-btn {
  background: #222;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ================= PRINT STYLES ================= */
@media print {
  .top-header, .sub-navbar, .sidebar, .filter-card, .filter-actions, .modal-backdrop, .app-footer, .btn {
    display: none !important;
  }
  body, .content-area {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .print-header-show {
    display: block !important;
    text-align: center;
    margin-bottom: 15px;
  }
  .schedule-table {
    border: 1px solid #000 !important;
  }
  .schedule-table td, .schedule-table th {
    border: 1px solid #000 !important;
    color: #000 !important;
  }
}

.print-header-show {
  display: none;
}




