/* ==============================================================
   TAMMY NAILS - ADMIN STYLESHEET
   Phong cách: Tối giản phẳng (Flat), Nền trắng, Font Arial,
   Không bóng đổ, Bo viền nhẹ 4px
   ============================================================== */

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

:root {
  --admin-bg: #f9fafb;
  --admin-card: #ffffff;
  --border: #d1d5db;
  --border-subtle: #e5e7eb;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --text: #111827;
  --text-muted: #4b5563;
  --radius-card: 6px;
  --radius-btn: 4px;
}

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

body, table, th, td, button, input, select, textarea, h1, h2, h3, h4, h5, h6, span, p, a, div {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

body {
  background-color: var(--admin-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
.admin-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #111827;
}

.nav-brand img {
  height: 34px;
  width: auto;
}

.nav-brand-title {
  font-size: 1.25rem;
  font-weight: bold;
}

.nav-brand-title span {
  color: #b91c1c;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-btn);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.nav-link svg {
  flex-shrink: 0;
  stroke-width: 1.8;
  opacity: 0.75;
}

.nav-link:hover, .nav-link.active {
  color: #111827;
  background: #f3f4f6;
}

.nav-link:hover svg, .nav-link.active svg {
  opacity: 1;
}

.nav-link.active {
  font-weight: bold;
  border-bottom: 2px solid #1d4ed8;
  border-radius: 0;
}

.btn-kiosk-back {
  background: #2563eb;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-kiosk-back:hover {
  background: #1d4ed8;
}

/* CONTAINER */
.admin-container {
  max-width: 1300px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  width: 100%;
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title h2 {
  font-size: 1.6rem;
  font-weight: bold;
  color: #111827;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

/* KPI STATS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--admin-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid var(--border);
}

.kpi-icon.working { background: #f0fdf4; color: #166534; }
.kpi-icon.checked-out { background: #fefce8; color: #854d0e; }
.kpi-icon.absent { background: #fef2f2; color: #991b1b; }
.kpi-icon.total { background: #eff6ff; color: #1e40af; }

.kpi-details h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: bold;
}

.kpi-details .kpi-num {
  font-size: 1.85rem;
  font-weight: bold;
  color: #111827;
  margin-top: 0.2rem;
}

/* CARDS & TABLES */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title-bar h3 {
  font-size: 1.2rem;
  font-weight: bold;
  color: #111827;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

table.admin-table th {
  padding: 0.75rem 1rem;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.85rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

table.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  vertical-align: middle;
}

table.admin-table tr:hover td {
  background: #f9fafb;
}

.emp-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emp-cell img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-btn);
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f3f4f6;
}

.emp-cell .emp-name {
  font-weight: bold;
  color: #111827;
  font-size: 0.95rem;
}

.emp-cell .emp-code {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* BADGES (VUÔNG VẮN, BỚT BO TRÒN) */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-btn);
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-in {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-out {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.badge-active {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-inactive {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* BUTTONS (PHẲNG, KHÔNG BÓNG ĐỔ, BO GÓC 4PX) */
.btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn-primary {
  background: #1d4ed8;
  border-color: #1e40af;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1e40af;
}

.btn-secondary {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid var(--border);
}

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

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

/* FORMS */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.35rem;
  color: #111827;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-btn);
  background: #ffffff;
  border: 1px solid var(--border);
  color: #111827;
  font-size: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
  outline: none;
}

.form-control:focus {
  border-color: #1d4ed8;
}

/* MODAL */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.admin-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-content {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  width: 90%;
  max-width: 480px;
  padding: 1.75rem;
  max-height: 90vh;
  overflow-y: auto;
}
