:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F2EBE0;
  --border: #E7DECF;
  --text: #2A1F17;
  --muted: #6B5B4C;
  --primary: #5D3A1A;
  --primary-hover: #4A2D14;
  --accent: #C68642;
  --accent-hover: #A56F35;
  --shift-acilis: #1F8A4C;
  --shift-ara: #D97706;
  --shift-kapanis: #374E8F;
  --shift-izinli: #B91C1C;
  --shift-off: #6B7280;
  --warn-bg: #FFF7ED;
  --warn-border: #FDBA74;
  --warn-text: #9A3412;
  --ok: #1F8A4C;
  --danger: #B91C1C;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 6px rgba(42,31,23,.08);
  --shadow-lg: 0 8px 24px rgba(42,31,23,.12);
  --max-w: 1100px;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 80px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
.app-header .brand-mark {
  display: inline-flex;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.app-header .user-area {
  font-size: .9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.app-header .user-area .username {
  color: var(--text);
  font-weight: 600;
}

/* Bottom navigation (mobile-friendly tap targets) */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: .25rem 0;
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(42,31,23,.06);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: .55rem .25rem;
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav a .nav-icon { font-size: 1.25rem; line-height: 1; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .card-meta { color: var(--muted); font-size: .9rem; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.dash-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-decoration: none;
  color: inherit;
  transition: transform .1s ease, box-shadow .1s ease;
}
.dash-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.dash-card .ic {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: .65rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.btn.secondary {
  background: var(--surface);
  color: var(--primary);
}
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #8b1414; }
.btn-sm { padding: .35rem .75rem; font-size: .875rem; }

/* Forms */
form .form-row {
  margin-bottom: 1rem;
}
form label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--text);
}
form input[type=text], form input[type=password], form input[type=email],
form input[type=date], form input[type=time], form select, form textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198,134,66,.2);
}
form .help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
form .errors {
  color: var(--danger);
  font-size: .85rem;
  margin-top: .25rem;
}

/* Tables */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.data-table th, table.data-table td {
  padding: .65rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
table.data-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text);
}
table.data-table tr:last-child td { border-bottom: 0; }

/* Badges / shift pills */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
}
.badge.muted { background: var(--surface-2); color: var(--muted); }
.badge.danger { background: #FEE2E2; color: var(--danger); }
.badge.ok { background: #DCFCE7; color: var(--ok); }

.shift-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.shift-pill.empty {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px dashed var(--border);
}

/* Alerts */
.alert {
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.alert.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
}
.alert.error {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: var(--danger);
}
.alert.ok {
  background: #DCFCE7;
  border-color: #86EFAC;
  color: var(--ok);
}

/* Login layout */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(160deg, var(--bg) 60%, var(--surface-2) 100%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.login-card .brand-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.2rem;
}
.login-card .brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.login-card .brand-title { font-weight: 700; font-size: 1.15rem; color: var(--primary); }

.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Utility */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.flex { display: flex; gap: .5rem; align-items: center; }
.between { justify-content: space-between; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }

@media (max-width: 540px) {
  .container { padding: .75rem; }
  h1 { font-size: 1.25rem; }
}
