/* ====================== 
   Global 
====================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ====================== 
   Header 
====================== */
header {
  background: #0073aa;
  color: #fff;
  padding: 10px 0;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Chia đều không gian giữa các phần tử */
}

.site-title a {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
}

/* ====================== 
   Menu chính 
====================== */
.main-nav {
  flex: 1;
  margin-left: 20px;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.main-nav li {
  margin-left: 15px;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ====================== 
   Nút hamburger (mobile) 
====================== */
#hamburgerBtn {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* ====================== 
   Auth links (Đăng nhập/Đăng xuất)
====================== */
.auth-buttons {
  display: flex;
  justify-content: flex-start; /* Căn chỉnh các nút về phía trái */
  align-items: center; /* Căn giữa các nút với nhau */
  width: auto; /* Đảm bảo kích thước bao quanh các nút */
}

.auth-buttons .btn {
  background: #fff;
  color: #0073aa;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.auth-buttons .btn:hover {
  background: #e6e6e6;
}

/* ====================== 
   Responsive (cho màn hình nhỏ)
====================== */
@media (max-width: 768px) {
  header .container {
    flex-wrap: wrap;
  }

  #hamburgerBtn {
    display: block;
  }

  .main-nav {
    width: 100%;
    display: none;
  }

  .main-nav.active {
    display: block;
    margin-top: 10px;
  }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav li {
    margin: 10px 0;
  }

  .auth-buttons {
    margin-top: 10px;
    width: 100%;
    justify-content: flex-end;
    display: flex;
  }
}

/* ====================== 
   Modal login (Đăng nhập)
====================== */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 6px;
  max-width: 400px;
  position: relative;
}

.modal-content h3 {
  margin-top: 0;
}

.modal-content label {
  display: block;
  margin-bottom: 10px;
}

.modal-content input {
  width: 100%;
  padding: 6px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.modal-content button {
  background: #28a745;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.modal-content button:hover {
  background: #1e7e34;
}

.close {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 20px;
  cursor: pointer;
}

.modal {
  display: none;  /* Mặc định modal bị ẩn */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}
.modal-content {
  background: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  position: relative;
}


/* ===== Moved from front-page.php on 2025-09-22 05:06 ===== */
/* Tùy chỉnh giao diện và bảng */
.toolbar { margin-bottom:15px; }
.btn { padding:6px 12px; margin-right:5px; background:#0073aa; color:white; border:none; border-radius:4px; cursor:pointer; text-decoration:none; }
.btn:hover { background:#005177; }
.login-btn { background:#17a2b8; }
.logout-btn { background:#dc3545; }
.login-btn:hover { background:#117a8b; }
.logout-btn:hover { background:#a71d2a; }
.modal { display:none; position:fixed; z-index:9999; left:0; top:0; width:100%; height:100%; background:rgba(0,0,0,0.4); overflow-y:auto; }
.modal-content { background:white; margin:5% auto; padding:20px; border-radius:8px; max-width:800px; width:90%; box-sizing:border-box; }
.close { float:right; font-size:24px; cursor:pointer; }
.modal-content form { display:grid; grid-template-columns:repeat(auto-fit, minmax(250px,1fr)); gap:15px; }
.modal-content label { display:block; font-weight:600; }
.modal-content input { width:100%; padding:6px; margin-top:3px; border:1px solid #ccc; border-radius:4px; }
.modal-content button { grid-column:1/-1; padding:10px; background:#0073aa; color:white; border:none; border-radius:4px; cursor:pointer; font-size:16px; }
.modal-content button:hover { background:#005177; }
#hanghoaTable { border-collapse: collapse; width: 100%; font-size: 14px; background: white; }
#hanghoaTable th, #hanghoaTable td { border: 1px solid #ccc; padding: 8px; text-align: left; }
#hanghoaTable th { background: #f2f2f2; font-weight: bold; }
#hanghoaTable tr:nth-child(even) { background: #fafafa; }
#hanghoaTable tr:hover { background: #e6f7ff; }
#duanTable { border-collapse: collapse; width: 100%; font-size: 14px; background: white; }
#duanTable th, #duanTable td { border: 1px solid #ccc; padding: 8px; text-align: left; }
#duanTable th { background: #f2f2f2; font-weight: bold; }
#duanTable tr:nth-child(even) { background: #fafafa; }
#duanTable tr:hover { background: #e6f7ff; }
.dt-buttons { margin-bottom: 10px; }
.dt-button.btn { background: #28a745 !important; color: white !important; border: none !important; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.dt-button.btn:hover { background: #1e7e34 !important; }
.hh-toolbar{border:1px solid #e5e7eb;border-radius:10px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.04);margin:12px 0 16px}
.hh-summary{cursor:pointer;list-style:none;user-select:none;padding:10px 14px;display:flex;align-items:center;gap:8px;font-weight:600}
.hh-summary::-webkit-details-marker{display:none}
.hh-caret{margin-left:6px;transition:transform .2s}
.hh-toolbar[open] .hh-caret{transform:rotate(180deg)}
.hh-dropdown{padding:12px 14px 14px;border-top:1px solid #e5e7eb;display:grid;gap:10px}
.hh-row{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
@media(max-width:640px){.hh-row>*{flex:1 1 auto}.hh-row label{flex:0 0 100%;margin-top:4px}.hh-row select{width:100%}}

/* modal */
#hhDialog { border:none; border-radius:12px; padding:16px 18px; width:min(720px, 96vw); }
#hhDialog::backdrop { background: rgba(0,0,0,.35); }
#hhDialog h3 { margin: 0 0 12px; }
#hhDialog .grid2 { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px 14px; }
#hhDialog label { display:flex; flex-direction:column; font-size:14px; gap:6px; }
#hhDialog input { padding:8px; border:1px solid #e5e7eb; border-radius:8px; }
#hhDialog .actions { margin-top:14px; display:flex; gap:8px; justify-content:flex-end; }

/* nút cơ bản (nếu chưa có) */
.btn { padding:8px 10px; border-radius:8px; border:1px solid #1e88e5; background:#1e88e5; color:#fff; cursor:pointer; }
.btn-danger { border-color:#e53935; background:#e53935; }

/* ====================== 
   Sidebar 
====================== */
/* Bố cục cho container chính */
.main-content {
  display: flex;
  justify-content: space-between;
}

/* Sidebar Menu */
.sidebar-menu {
  width: 550px;
  background-color: #f4f4f4;
  padding: 15px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-menu h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.sidebar-menu ul {
  width: 70px;
  list-style-type: none;
  padding: 0;
}

.sidebar-menu ul li {
  margin: 10px 0;
}

.sidebar-menu ul li a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}
.sidebar-menu ul li a:hover {
  background-color: #0073aa;
  color: white;
}

/* Bộ lọc và bảng dữ liệu */
.filter-actions {
  flex: 1;
  padding: 15px;
  background-color: #fff;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-actions select,
.filter-actions button {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  font-size: 1rem;
}

.filter-actions button {
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
}

.filter-actions button:hover {
  background-color: #45a049;
}

/* Table */
.sheet {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.sheet th, .sheet td {
  padding: 8px;
  text-align: center;
  border: 1px solid #ddd;
}

.sheet th {
  background-color: #f4f4f4;
}
/* Tối ưu responsive */
@media (max-width: 768px) {
  .hh-row {
    flex-direction: column;
  }
  .hh-row label, .hh-row select {
    width: 100%;
    margin-top: 10px;
  }
  .sidebar-menu {
    width: 100%;
    padding: 15px;
  }
}

/* Cắt văn bản nếu nó dài quá, dùng dấu "..." */
table td {
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px; /* Đặt độ rộng tối đa cho các cột */
}

table {
  table-layout: auto; /* Tự động điều chỉnh độ rộng các cột */
}
