:root {
  --bg: #1f2124;
  --panel: #fff;
  --muted: #9aa0a6;
  --pill-blue: #eaf4ff;
  --pill-blue-border: #d5ecff;
  --green: #25b24a;
  --red: #ef3b3b;
  --neutral: #ececec;
  --primary: #007bff;
  --primary-dark: #0056b3;
  --border-color: #eee;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial;
  overflow-x: hidden;
}

.frame {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  max-width: 100vw;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 200px;
}

.logo img {
  height: 50px;
  width: 50px;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text {
  line-height: 1.2;
}

.logo-title {
  font-weight: 700;
  font-size: 16px;
  color: #1f2a37;
}

.logo-subtitle {
  font-size: 12px;
  color: #8c9498;
}

.admin-btn {
  margin-left: auto;
  min-width: 150px;
  height: 40px;
  align-self: center;
  white-space: nowrap;
}

.datetime-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 28px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  white-space: nowrap;
  flex-wrap: wrap;
  justify-content: center;
}

.dt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--neutral);
}

.dt-item .bi {
  font-size: 18px;
  color: var(--muted);
}

.dt-time {
  font-weight: 600;
  font-size: 15px;
}

.dt-date {
  font-weight: 600;
  font-size: 14px;
  color: #4b4f54;
}

/* Table Header */
.table-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.8fr 1fr 1fr;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 2px solid #f0f2f4;
  background: #fafbfc;
  gap: 10px;
}

.head-col {
  text-align: center;
  color: #6b6f73;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.head-col.left {
  text-align: left;
}

/* Rows */
.row-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.8fr 1fr 1fr;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}

.row-item .cell {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-item .code {
  text-align: left;
  font-weight: 600;
  color: #0b3a66;
}

.row-item .name {
  text-align: left;
  font-weight: 600;
  color: #1f2a37;
}

.row-item .model {
  text-align: left;
  color: #02539a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-badge {
  background: #eaf4ff;
  border: 1px solid #d5ecff;
  border-radius: 6px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--green);
  color: white;
}

.btn-danger {
  background: var(--red);
  color: white;
}

.attendance-btn, .ot-btn {
  height: 80px;
  width: 80px;
  border-radius: 50%;
  font-weight: bold;
}

.rounded-pill {
  padding: 6px 16px;
  border-radius: 8px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(14, 30, 37, 0.06);
  min-width: 70px;
  font-size: 13px;
}

.btn-stop {
  background: var(--red);
  color: #fff;
}

.btn-neutral {
  background: var(--neutral);
  color: #4b4f54;
}

.spacer {
  height: 80px;
}

/* Details box */
.details-box {
  font-size: 14px;
  color: #333;
  grid-column: 1 / -1;
  padding: 10px 18px;
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
  display: none;
}

/* Popup container */
.popup {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.popup-header h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #007bff;
  cursor: pointer;
}

.popup-body h3 {
  font-size: 14px;
  margin: 8px 0 10px;
  font-weight: 600;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #333;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  background: #ddd;
}

/* ========== RESPONSIVE STYLES ========== */

/* Large screens (desktops) */
@media (min-width: 1201px) {
  .frame {
    max-width: 1400px;
    margin: 20px auto;
  }
}

/* Medium screens (tablets and small laptops) */
@media (max-width: 1200px) and (min-width: 768px) {
  .topbar {
    padding: 12px 15px;
  }
  
  .logo {
    flex: 1 1 60%;
  }
  
  .datetime-wrap {
    flex: 1 1 35%;
    justify-content: flex-end;
  }
  
  .table-head, .row-item {
    grid-template-columns: 1fr 1.2fr 1.2fr 0.8fr 1fr 1fr;
    padding: 10px 15px;
    gap: 8px;
  }
  
  .head-col, .row-item .cell {
    font-size: 13px;
  }
  
  .attendance-btn, .ot-btn {
    height: 70px;
    width: 70px;
    font-size: 13px;
  }
}

/* Small tablets and large phones */
@media (max-width: 767px) and (min-width: 576px) {
  .topbar {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
  }
  
  .logo {
    width: 100%;
    justify-content: space-between;
  }
  
  .admin-btn {
    margin-left: 0;
    min-width: 140px;
  }
  
  .datetime-wrap {
    width: 100%;
    justify-content: center;
  }
  
  .table-head, .row-item {
    grid-template-columns: 1fr 1.5fr 1.5fr 0.8fr 1fr 1fr;
    padding: 8px 10px;
    gap: 5px;
  }
  
  .head-col, .row-item .cell {
    font-size: 12px;
  }
  
  .attendance-btn, .ot-btn {
    height: 60px;
    width: 60px;
    font-size: 12px;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Mobile phones */
@media (max-width: 575px) {
  .frame {
    border-radius: 0;
    margin: 0;
  }
  
  .topbar {
    padding: 10px 15px;
    flex-direction: column;
    gap: 15px;
  }
  
  .logo {
    width: 100%;
    justify-content: space-between;
  }
  
  .logo img {
    height: 40px;
    width: 40px;
  }
  
  .logo-title {
    font-size: 14px;
  }
  
  .logo-subtitle {
    font-size: 10px;
  }
  
  .admin-btn {
    min-width: 130px;
    height: 36px;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .datetime-wrap {
    width: 100%;
    justify-content: space-between;
    padding: 5px 10px;
  }
  
  .dt-item {
    padding: 3px 8px;
  }
  
  .dt-time {
    font-size: 13px;
  }
  
  .dt-date {
    font-size: 12px;
  }
  
  .table-head {
    grid-template-columns: 0.8fr 1.2fr 1fr 0.6fr 0.8fr 0.8fr;
    padding: 8px 10px;
    gap: 5px;
  }
  
  .head-col {
    font-size: 11px;
  }
  
  .row-item {
    grid-template-columns: 0.8fr 1.2fr 1fr 0.6fr 0.8fr 0.8fr;
    padding: 10px;
    gap: 5px;
  }
  
  .row-item .cell {
    font-size: 11px;
  }
  
  .attendance-btn, .ot-btn {
    height: 50px;
    width: 50px;
    font-size: 10px;
    padding: 5px;
  }
  
  .btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .details-box {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .popup {
    padding: 15px;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .table-head, .row-item {
    grid-template-columns: 0.7fr 1.3fr 0.9fr 0.5fr 0.7fr 0.7fr;
    padding: 6px 8px;
    gap: 3px;
  }
  
  .head-col, .row-item .cell {
    font-size: 10px;
  }
  
  .attendance-btn, .ot-btn {
    height: 45px;
    width: 45px;
    font-size: 9px;
  }
  
  .logo img {
    height: 35px;
    width: 35px;
  }
  
  .admin-btn {
    min-width: 120px;
    height: 32px;
    font-size: 11px;
  }
}

/* Print styles */
@media print {
  .admin-btn, .model-badge {
    display: none;
  }
  
  .frame {
    box-shadow: none;
  }
  
  .attendance-btn, .ot-btn {
    border: 1px solid #000;
    color: #000;
    background: white;
  }
}