body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0b0b0b;
  color: #ffffff;
  direction: rtl;
}

.app-header {
  background: #000000;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid #ff2b2b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
}

.header-right {
  flex-direction: column;
  align-items: flex-end;
}

.logo {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.header-right h1 {
  margin: 0;
  color: #ff2b2b;
  font-size: 28px;
}

.subtitle {
  color: #d1d5db;
  font-size: 14px;
  margin-top: 6px;
}

.container {
  max-width: 1700px;
  margin: 12px auto;
  background: #121212;
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.toolbar label {
  color: #ffffff;
  font-weight: bold;
}

.toolbar input[type="date"],
.toolbar input[type="text"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
}

.toolbar button {
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #ff1f1f;
  color: #ffffff;
  cursor: pointer;
  font-weight: bold;
}

.toolbar button:hover {
  background: #d81616;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: #0f0f0f;
  border: 1px solid #232323;
  border-right: 4px solid #ff2b2b;
  border-radius: 14px;
  padding: 18px;
}

.stat-title {
  color: #d1d5db;
  margin-bottom: 8px;
  font-size: 14px;
}

.stat-value {
  font-size: 34px;
  font-weight: bold;
  color: #ff2b2b;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #151515;
  color: #ffffff;
}

th,
td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #2a2a2a;
}

th {
  background: #202020;
  color: #ffffff;
  font-weight: bold;
}

tbody tr:hover {
  background: #1f1f1f;
  transition: 0.2s;
}

.message {
  margin-top: 14px;
  color: #ffffff;
  font-weight: bold;
}

.details-btn {
  background: #ff2b2b;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-weight: bold;
}

.details-btn:hover {
  background: #d81616;
}

.status-present {
  color: #00e676;
  font-weight: bold;
}

.status-incomplete {
  color: #ffc107;
  font-weight: bold;
}

.status-needsreview {
  color: #ff9800;
  font-weight: bold;
}

.status-missingout {
  color: #ff5252;
  font-weight: bold;
}

/* ===== Modal ===== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.hidden {
  display: none !important;
}

.modal-content {
  width: min(1200px, 95%);
  max-height: 90vh;
  overflow-y: auto;
  background: #111111;
  border: 1px solid #2b2b2b;
  border-top: 4px solid #ff2b2b;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  color: #ffffff;
}

.close-btn {
  background: #ff2b2b;
  border: none;
  color: white;
  font-size: 18px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
}

.close-btn:hover {
  background: #d81f1f;
}

.details-summary {
  background: #181818;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
  line-height: 2;
  color: #f5f5f5;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.details-card {
  background: #181818;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  padding: 16px;
}

.details-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
  color: #ffffff;
}

/* ========================= */
/* 🔥 Manual Punch Section */
/* ========================= */

.manual-punch-box {
  margin-top: 30px;
  padding: 20px;
  background: #111;
  border: 1px solid #2b2b2b;
  border-radius: 16px;
}

.manual-punch-box h3 {
  margin-bottom: 15px;
  color: #fff;
}

.manual-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.manual-row input,
.manual-row select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
  outline: none;
  min-width: 160px;
}

.manual-row input::placeholder {
  color: #777;
}

.manual-row input:focus,
.manual-row select:focus {
  border-color: #ff2b2b;
}

.btn-save {
  background: linear-gradient(135deg, #ff2b2b, #d81f1f);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
  box-shadow: 0 4px 12px rgba(255, 43, 43, 0.3);
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 43, 43, 0.5);
}

.btn-save:active {
  transform: scale(0.95);
}

/* ===== Responsive ===== */

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .details-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 100%;
    max-height: 95vh;
    padding: 16px;
  }

  .app-header {
    flex-direction: column;
    text-align: center;
  }

  .header-right {
    align-items: center;
  }
}

@media (max-width: 700px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .container {
    margin: 8px;
    padding: 16px;
  }

  .logo {
    height: 60px;
  }

  .header-right h1 {
    font-size: 22px;
  }
}