/* style.css */
:root {
  --bg: #f4f6f8;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --active-bg: #334155;
  --accent: #3b82f6;
  --card: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Roboto", sans-serif;
  background: var(--bg);
  color: #111;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.sidebar h2 {
  margin: 0 0 16px;
  font-size: 20px;
  color: #fff;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar a {
  text-decoration: none;
  color: var(--sidebar-text);
  padding: 10px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar a:hover {
  background: var(--active-bg);
}

.sidebar a.active {
  background: var(--accent);
  color: #fff;
}

.main {
  flex: 1;
  padding: 24px;
}

h1 {
  color: var(--accent);
}

.card {
  background: var(--card);
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(20, 20, 30, 0.06);
  margin-bottom: 12px;
}

.row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 12px;
}

.row label {
  margin-bottom: 6px;
  font-weight: 500;
}

.row input,
.row select {
  width: 100%;
  max-width: 400px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  text-align: left;
}

input {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #e0e6ef;
  border-radius: 6px;
  font-size: 14px;
}

button {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

button:active {
  transform: translateY(1px);
}

.message {
  margin-top: 8px;
  padding: 10px;
  border-radius: 6px;
  display: none;
}

.message.show {
  display: block;
}

.message.ok {
  background: #e6fffa;
  color: #065f46;
}

.message.err {
  background: #fff5f5;
  color: #7f1d1d;
}

/* Định dạng bảng lịch sử nạp */
table {
  width: 100%;
  border-collapse: separate;
  /* Tách các ô */
  border-spacing: 0 8px;
  /* Khoảng cách dọc giữa các hàng */
  margin-top: 16px;
}

th,
td {
  padding: 12px 16px;
  /* Padding rộng rãi để tách ô */
  text-align: left;
  border: none;
  /* Không cần viền vì dùng card */
  background: var(--card);
  /* Nền trắng giống card */
  box-shadow: 0 2px 8px rgba(20, 20, 30, 0.06);
  /* Hiệu ứng bóng nhẹ */
}

th {
  background: var(--sidebar-bg);
  /* Nền giống sidebar cho header */
  color: var(--sidebar-text);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
}

tr {
  border-radius: 6px;
  /* Bo góc cho hàng */
  overflow: hidden;
  /* Đảm bảo bo góc hiển thị đúng */
}

tr td {
  background: var(--card);
  /* Nền trắng cho ô dữ liệu */
}

tr:hover td {
  background: #f1f5f9;
  /* Hiệu ứng hover nhẹ */
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar nav {
    flex-direction: row;
    gap: 4px;
  }

  table {
    border-spacing: 0 6px;
  }

  th,
  td {
    padding: 8px;
    /* Giảm padding trên mobile */
    font-size: 12px;
    /* Giảm cỡ chữ */
  }

  .notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 300px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  .notification button {
    background: #fff;
    color: #007bff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
  }

  .notification button:hover {
    background: #e0e0e0;
  }

  .sidebar a.dashboard-link {
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    display: block;
    text-decoration: none;
    color: var(--sidebar-text);
    /* #cbd5e1 */
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s;
  }

  .sidebar a.dashboard-link:hover {
    background: var(--accent);
    /* #3b82f6 */
    color: #fff;
  }
}

#pagination button {
  padding: 6px 12px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

#pagination button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#pagination span {
  font-weight: bold;
}

.message-box {
  font-size: 15px;
  font-weight: 500;
}
