:root {
  --bg: #777;
  --panel: #c0c0c0;
  --soft-panel: #f5f5f5;
  --teal: dimgrey;
  --student-primary: #234569;
  --text: #2f2f2f;
  --white: #f5f5f5;
  --shadow: rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
  max-width: 100%;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 10px;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100%;
  max-width: 560px;
  min-height: calc(100vh - 20px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 8px 18px var(--shadow);
  padding: 18px;
  text-align: center;
}

.screen.active { display: block; }

h1, h2, h3 {
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  font-weight: normal;
  margin-top: 0;
  color: var(--teal);
}

.admin-theme h2, .admin-theme h3 { color: var(--teal); }
.student-theme h1, .student-theme h2, .student-theme h3 { color: var(--student-primary); }

.app-logo {
  width: 38vw;
  max-width: 200px;
  aspect-ratio: 1/1 ;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 15px;
  display: block;
  background-color: transparent;
}

.subtitle, .helper-text, .mini-text {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-box, .dashboard-section {
  background: var(--soft-panel);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  text-align: left;
  border: 1px solid rgba(0, 128, 128, 0.25);
}

.hidden { display: none !important; }

label {
  display: block;
  font-weight: bold;
  margin-top: 10px;
  color: #333;
}

input, select, textarea {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--teal);
  font-size: 1rem;
  color: #333;
  margin: 8px 0 12px;
  background: var(--white);
  font-family: Arial, sans-serif;
}

.student-theme input, .student-theme select, .student-theme textarea { border-color: var(--student-primary); }
textarea { resize: vertical; }

.prefilled-field {
  background: #e8e8e8 !important;
  color: #666 !important;
}

input[type="date"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  color: var(--white);
  background: var(--teal);
  box-shadow: 0 4px 8px rgba(0,0,0,0.16);
  width: 100%;
  min-height: 48px;
}

button:active { transform: scale(0.98); }
.student-theme button { background: var(--student-primary); }
.small-btn { width: auto; min-height: 38px; padding: 8px 12px; font-size: 0.85rem; }

.top-bar, .nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-bottom: 2px solid rgba(0, 0, 0, 0.18);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.home-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  text-align: left;
  padding: 20px;
  min-height: 86px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  color: white;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.filter-row input { margin: 0; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.summary-card {
  background: var(--soft-panel);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.summary-number {
  display: block;
  font-size: 1.45rem;
  font-weight: bold;
  color: var(--teal);
}

.student-theme .summary-number { color: var(--student-primary); }

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dhor-card {
  background: var(--soft-panel);
  border-left: 6px solid var(--teal);
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.student-theme .dhor-card { border-left-color: var(--student-primary); }

.dhor-card-title {
  font-weight: bold;
  color: #222;
  margin-bottom: 5px;
}

.dhor-meta {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.45;
}

.status-pill {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e5e4e2;
  color: #222;
  font-weight: bold;
}

.status-verified { background: #d7f7d7; color: #116611; }
.status-review { background: #fff1bd; color: #7a5200; }
.status-pending { background: #e5e4e2; color: #333; }

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.error-message {
  color: #8b0000;
  font-weight: bold;
  min-height: 20px;
}

@media (min-width: 600px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 440px) {
  .two-col, .summary-grid, .card-actions, .filter-row { grid-template-columns: 1fr; }
  .top-bar, .nav-header { align-items: flex-start; }
  .small-btn { min-width: 84px; }
}


.sync-status {
  min-height: 18px;
  margin: 8px 0 4px;
  color: #555;
  text-align: center;
}

@media (max-width: 520px) {
  body { padding: 6px; }
  .app-shell { min-height: calc(100vh - 12px); }
  .screen { padding: 10px; border-radius: 14px; }
  .dashboard-section { padding: 10px; border-radius: 14px; }
  label { margin: 6px 0 4px; }
  input, select, textarea { padding: 7px 9px; margin: 0 0 7px; font-size: 0.95rem; }
  input[type="date"] { width: 100%; max-width: 100%; }
  .two-col, .summary-grid, .card-actions, .filter-row { grid-template-columns: 1fr; }
}
