/* ── Synergy Timesheet — Mobile-first base styles ────────────────────────────
   Place this file at: backend/core/static/core/mobile.css
   Load it in templates with: {% load static %} and
   <link rel="stylesheet" href="{% static 'core/mobile.css' %}">
──────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;          /* prevents iOS auto-zoom on inputs */
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
}

.page {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  background: #fff;
  min-height: 100vh;
}

h2, h3 {
  margin: 0 0 20px;
  font-size: 1.4rem;
  font-weight: 700;
}

.site-logo-heading {
  margin: 0 0 24px;
  line-height: 1;
}

.site-logo {
  display: block;
  width: min(360px, 100%);
  height: auto;
}

/* ── Form elements ────────────────────────────────────────────────────────── */

.field {
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: #333;
}

label .hint {
  font-weight: 400;
  color: #888;
  font-size: 0.85rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  height: 48px;               /* large enough tap target on phones */
  padding: 0 12px;
  font-size: 16px;            /* prevents iOS auto-zoom */
  border: 1.5px solid #ccc;
  border-radius: 8px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  color: #1a1a1a;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #417690;
  box-shadow: 0 0 0 3px rgba(65, 118, 144, 0.15);
}

textarea {
  height: auto;
  padding: 12px;
  resize: vertical;
}

input[type="file"] {
  width: 100%;
  padding: 10px 0;
  font-size: 15px;
  border: none;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: block;
  width: 100%;
  height: 52px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 52px;
  margin-bottom: 12px;
}

.btn-primary {
  background: #417690;
  color: #fff;
}

.btn-primary:active {
  background: #2f5569;
}

.btn-secondary {
  background: #e8e8e8;
  color: #333;
}

.btn-secondary:active {
  background: #d0d0d0;
}

.btn-danger {
  background: #c0392b;
  color: #fff;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */

.alert-error {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 8px;
  padding: 12px 14px;
  color: #c0392b;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.alert-success {
  background: #eafaf1;
  border: 1px solid #a9dfbf;
  border-radius: 8px;
  padding: 12px 14px;
  color: #1e8449;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

/* ── Nav / links ──────────────────────────────────────────────────────────── */

.nav-links {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #417690;
  text-decoration: none;
  font-size: 0.95rem;
}

/* ── Success page ─────────────────────────────────────────────────────────── */

.success-page {
  text-align: center;
  padding: 60px 16px;
}

.success-page .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.success-page h2 {
  justify-content: center;
}

.success-page p {
  color: #555;
  font-size: 1rem;
  margin-bottom: 32px;
}

.success-page .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Home page menu ───────────────────────────────────────────────────────── */

.home-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #f9f9f9;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 1rem;
}

.menu-item:active {
  background: #efefef;
}

.menu-item .icon {
  font-size: 1.5rem;
  width: 36px;
  text-align: center;
}

/* ── Responsive table (timesheet grid) ────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px;
}

table {
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 8px 6px;
  border: 1px solid #ddd;
  white-space: nowrap;
}

th {
  background: #f0f0f0;
  font-weight: 600;
}

table input[type="number"] {
  width: 64px;
  height: 38px;
  font-size: 15px;
  padding: 0 4px;
  text-align: center;
}

table select {
  height: 38px;
  font-size: 14px;
  min-width: 140px;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */

.text-muted {
  color: #888;
  font-size: 0.875rem;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
