/* Kabakevi yönetim paneli stilleri */

:root {
  --brown-dark: #5C3A1E;
  --brown: #7A4B2A;
  --brown-medium: #9B6A3C;
  --brown-light: #C8956D;
  --orange: #E8934A;
  --orange-light: #F2B07A;
  --pumpkin: #F0A04B;
  --cream: #FFF8F0;
  --cream-dark: #F5E6D3;
  --green: #5A8A60;
  --green-light: #7DB882;
  --red: #C0524D;
  --red-light: #E8A4A0;
  --white: #FFFCF7;
  --text: #3D2415;
  --text-light: #7A6655;
  --border: rgba(92, 58, 30, 0.12);
  --shadow: 0 4px 24px rgba(92, 58, 30, 0.08);
  --shadow-lg: 0 12px 40px rgba(92, 58, 30, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--brown); text-decoration: none; }
a:hover { color: var(--orange); }

/* ======== AUTH (login) ======== */
.auth-body {
  background:
    radial-gradient(circle at 20% 0%, rgba(232, 147, 74, 0.18), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(154, 106, 60, 0.18), transparent 40%),
    var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.auth-card {
  width: 100%;
  background: var(--white);
  border-radius: 22px;
  padding: 2.4rem 2rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 110px;
  height: auto;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--brown-dark);
  text-align: center;
  margin-bottom: 0.4rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.6rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-footer {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

/* ======== FORM FIELDS ======== */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.field input[type=text],
.field input[type=email],
.field input[type=password],
.field select {
  padding: 0.75rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(232, 147, 74, 0.18);
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.field-checkbox input { width: 18px; height: 18px; accent-color: var(--orange); }
.field-checkbox span { font-size: 0.95rem; color: var(--text); font-weight: 400; }

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brown);
  color: var(--white);
  border-color: var(--brown);
}
.btn-primary:hover { background: var(--orange); border-color: var(--orange); color: var(--white); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--cream-dark); }

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: var(--red-light);
}
.btn-danger:hover { background: var(--red); color: var(--white); border-color: var(--red); }

.btn-block { width: 100%; padding: 0.85rem 1.2rem; font-size: 0.95rem; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }

/* ======== FLASH ======== */
.flash {
  padding: 0.85rem 1.1rem 0.85rem 2.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid transparent;
  position: relative;
  animation: flashSlide 0.35s ease;
}
.flash::before {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
}
.flash-error::before    { content: '✗'; color: #c0524d; }
.flash-success::before  { content: '✓'; color: #5a8a60; }
.flash-info::before     { content: 'ℹ'; color: var(--brown); }
.flash-warning::before  { content: '⚠'; color: #c89048; }

.flash-error    { background: rgba(192, 82, 77, 0.08); color: #8c322e; border-color: rgba(192, 82, 77, 0.25); }
.flash-success  { background: rgba(90, 138, 96, 0.08); color: #2f5a37; border-color: rgba(90, 138, 96, 0.25); }
.flash-info     { background: rgba(232, 147, 74, 0.10); color: var(--brown-dark); border-color: rgba(232, 147, 74, 0.3); }
.flash-warning  { background: rgba(232, 147, 74, 0.18); color: var(--brown-dark); border-color: rgba(232, 147, 74, 0.5); }

@keyframes flashSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======== EMPTY STATE ======== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
  gap: 0.45rem;
}
.empty-state-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.3rem;
  filter: grayscale(0.2);
}
.empty-state p { font-size: 0.95rem; margin: 0; }
.empty-state small { font-size: 0.8rem; }

/* ======== ERROR PAGE ======== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  gap: 0.5rem;
  min-height: 60vh;
}
.error-emoji { font-size: 4rem; }
.error-code {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--brown);
  margin: 0;
  letter-spacing: -0.04em;
  line-height: 1;
}
.error-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--brown-dark);
  margin: 0.3rem 0 0.2rem;
}
.error-message {
  color: var(--text-light);
  max-width: 460px;
  margin: 0;
}
.error-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.2rem;
}

/* ======== STAT CARD: ATTENTION ======== */
.stat-card.attention {
  border-color: var(--orange);
  background: linear-gradient(135deg, var(--white) 0%, rgba(232, 147, 74, 0.07) 100%);
}
.stat-card.attention .stat-value { color: var(--orange); }
.stat-card.attention .muted small { display: inline; }
.stat-card a { font-size: 0.78rem; color: var(--orange); text-decoration: none; }
.stat-card a:hover { text-decoration: underline; }

/* ======== TOPBAR AVATAR (MOBILE) ======== */
.topbar-avatar {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brown), var(--orange));
  color: var(--white);
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.topbar-avatar:hover { transform: scale(1.05); color: var(--white); }

/* ======== FORM INVALID ======== */
.field input:invalid:not(:placeholder-shown):not(:focus),
.field textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--red-light);
  background: rgba(192, 82, 77, 0.04);
}

/* ======== TODAY CELL VURGU ======== */
.cal-cell.today {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(232, 147, 74, 0.25), 0 4px 14px rgba(232, 147, 74, 0.18);
}
.cal-cell.today .cal-day {
  background: var(--orange);
  color: var(--white);
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0 5px;
}

/* ======== LOAD BAR (fairness/preview) ======== */
.load-bar {
  position: relative;
  width: 160px;
  height: 22px;
  background: var(--cream-dark);
  border-radius: 999px;
  overflow: hidden;
}
.load-bar::before {
  content: '';
  display: block;
  width: var(--w, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--green-light), var(--orange));
  transition: width 0.3s ease;
}
.load-bar > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  font-feature-settings: "tnum";
}

/* ======== BELL (topbar bildirim çanı) ======== */
.bell {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown-dark);
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}
.bell:hover { background: var(--cream-dark); transform: scale(1.06); color: var(--brown); }

.bell-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--red);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--white);
}

/* ======== NOTIF LIST ======== */
.notif-list { list-style: none; }
.notif-item {
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item a {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 0.5rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s;
}
.notif-item.unread a {
  background: rgba(232, 147, 74, 0.06);
}
.notif-item.unread a::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--orange);
  border-radius: 50%;
  margin-top: 0.55rem;
  flex-shrink: 0;
}
.notif-item.is-read a::before {
  content: '';
  width: 8px;
  flex-shrink: 0;
}
.notif-item a:hover { background: var(--cream); }
.notif-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.notif-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.notif-body strong { color: var(--brown-dark); }
.notif-body span { color: var(--text-light); font-size: 0.88rem; }
.notif-body small { color: var(--text-light); font-size: 0.72rem; }

/* ======== ADMIN LAYOUT ======== */
.admin-body {
  background: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brown-dark) 0%, var(--brown) 100%);
  color: var(--white);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 30;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.6rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.sidebar-brand img { width: 38px; height: auto; }
.sidebar-brand span {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}
.nav-item.is-active {
  background: rgba(232, 147, 74, 0.22);
  color: var(--white);
}

.nav-icon {
  width: 18px; height: 18px;
  display: inline-block;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.nav-icon[data-icon="home"]   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9.5L12 3l9 6.5V20a1 1 0 01-1 1h-5v-7H9v7H4a1 1 0 01-1-1V9.5z'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="users"]  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="logout"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233D2415' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="calendar"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="clock"]    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="grid"]     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="star"]     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="mail"]     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpolyline points='22,6 12,13 2,6'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="settings"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="ban"]      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="chart"]    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='20' x2='12' y2='10'/%3E%3Cline x1='18' y1='20' x2='18' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='16'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="bell"]     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="swap"]     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='17 1 21 5 17 9'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpolyline points='7 23 3 19 7 15'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="list"]     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }

.sidebar-logout button {
  background: rgba(255, 255, 255, 0.92);
  color: var(--brown-dark);
  border-color: transparent;
}
.sidebar-logout button:hover {
  background: var(--white);
}

.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar-admin {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.menu-toggle span {
  width: 22px; height: 2px;
  background: var(--brown-dark);
  border-radius: 1px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brown-dark);
  flex: 1;
}

.topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  transition: background 0.2s;
}
.topbar-user:hover { background: var(--cream); }
.user-name { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.user-role { font-size: 0.74rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em; }

.content {
  padding: 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ======== CARDS ======== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  color: var(--brown-dark);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stat-label { color: var(--text-light); font-size: 0.85rem; }
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--brown);
}

.form-card { max-width: 720px; }
.form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

/* ======== TABLES ======== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.85rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  background: var(--cream);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(232, 147, 74, 0.04); }

.actions { display: flex; justify-content: flex-end; gap: 0.4rem; flex-wrap: wrap; }
.t-right  { text-align: right; }
.t-center { text-align: center; }
.muted    { color: var(--text-light); }

/* ======== BADGES ======== */
.badge {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge-admin { background: rgba(232, 147, 74, 0.18); color: var(--brown-dark); }
.badge-staff { background: rgba(122, 75, 42, 0.10); color: var(--brown); }
.badge-on    { background: rgba(90, 138, 96, 0.15); color: #2f5a37; }
.badge-off   { background: rgba(125, 110, 90, 0.18); color: var(--text-light); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(60, 36, 21, 0.45);
  z-index: 25;
}

/* ======== RESPONSIVE ======== */
@media (max-width: 880px) {
  .form-grid { grid-template-columns: 1fr; }

  .sidebar {
    transform: translateX(-100%);
    width: min(280px, 80vw);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-overlay { display: block; }

  .admin-main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }

  .page-title { font-size: 1.05rem; }
  .content { padding: 1rem; gap: 1rem; }
  .topbar-admin { padding: 0.7rem 0.9rem; gap: 0.6rem; }

  .data-table { font-size: 0.85rem; }
  .data-table th, .data-table td { padding: 0.65rem 0.55rem; }

  .topbar-user { display: none; }
  .topbar-avatar { display: inline-flex; }
  .bell { width: 34px; height: 34px; }

  .cal-toolbar { gap: 0.6rem; }
  .cal-toolbar .cal-nav { flex-wrap: wrap; gap: 0.35rem; }
  .cal-toolbar .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.74rem; }

  .stat-value { font-size: 1.7rem; }
  .stat-card { padding: 1rem; }

  .toolbar { flex-wrap: wrap; }

  .quick-actions { gap: 0.4rem; }
  .quick-actions .btn { font-size: 0.8rem; padding: 0.5rem 0.85rem; }
}

@media (max-width: 520px) {
  /* Çok küçük ekranlarda gereksiz textler gizlensin */
  .page-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-user .user-role { display: none; }
  .topbar-user { padding: 0.2rem 0.4rem; }
  .user-name { max-width: 70px; }

  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}

@media (max-width: 520px) {
  .card { padding: 1rem; }
  /* Tablolar mobilde yatay kaydırılabilir */
  .card:has(> .data-table) { padding: 0.5rem; overflow-x: auto; }
  .data-table { min-width: 560px; }
}

/* PWA standalone (uygulama gibi açıldığında küçük ayarlamalar) */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .topbar-admin { padding-top: calc(1rem + env(safe-area-inset-top)); }
}

/* ======== TEXTAREA ======== */
.field textarea {
  padding: 0.75rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  resize: vertical;
}
.field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(232, 147, 74, 0.18);
}
.field input[type=date],
.field input[type=time],
.field input[type=number],
.field input[type=color] {
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: var(--white);
  width: 100%;
}
.field input[type=color] { padding: 0.2rem; height: 42px; cursor: pointer; }

.small { font-size: 0.78rem; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

/* ======== CHIPS / TAGS ======== */
.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}
.chip-tag small { font-weight: 400; opacity: 0.85; }

.color-dot {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--border);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.chip-check {
  cursor: pointer;
  display: block;
}
.chip-check input { display: none; }
.chip-check .chip-tag {
  width: 100%;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border: 2px solid transparent;
  opacity: 0.55;
  filter: grayscale(0.45);
  transition: all 0.2s;
}
.chip-check input:checked + .chip-tag {
  opacity: 1;
  filter: none;
  border-color: rgba(60, 36, 21, 0.25);
  box-shadow: 0 4px 14px rgba(92, 58, 30, 0.18);
}

.shifts-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--cream);
}
.shifts-fieldset legend {
  font-weight: 500;
  padding: 0 0.5rem;
  color: var(--brown-dark);
}

/* ======== TODAY / SHIFT LISTS (employee dashboard) ======== */
.today-card { border-left: 4px solid var(--orange); }

.shift-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.shift-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.85rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.shift-chip {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.shift-time {
  font-feature-settings: "tnum";
  font-weight: 500;
  color: var(--brown-dark);
}
.shift-date {
  min-width: 130px;
  font-weight: 500;
  color: var(--text);
}

/* ======== CALENDAR ======== */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cal-month {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--brown-dark);
  padding: 0 0.6rem;
}
.cal-legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-light);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.cal-grid-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  min-width: 760px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  padding: 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  min-width: 760px;
}
.cal-cell {
  background: var(--cream);
  border-radius: 8px;
  padding: 0.45rem 0.45rem 0.55rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid transparent;
}
.cal-cell.weekend { background: rgba(232, 147, 74, 0.06); }
.cal-cell.muted-cell { opacity: 0.42; }
.cal-cell.today { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(232, 147, 74, 0.18); }

.cal-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.15rem;
}
.cal-day {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brown-dark);
}
.cal-tags { display: flex; gap: 0.2rem; }
.cal-tag {
  font-size: 0.62rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.cal-tag.tag-holiday { background: var(--red); }
.cal-tag.tag-busy    { background: var(--brown-dark); }

.cal-shift-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cal-shift-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.cal-shift-link:hover { filter: brightness(1.08); }
.cal-shift-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-shift-count {
  background: rgba(255, 255, 255, 0.35);
  padding: 0 0.35rem;
  border-radius: 999px;
  font-feature-settings: "tnum";
  font-size: 0.66rem;
  white-space: nowrap;
}
.cal-shift-count.deficit {
  background: rgba(192, 82, 77, 0.85);
  color: var(--white);
}
.cal-people {
  list-style: none;
  margin: 0;
  padding-left: 0.2rem;
  font-size: 0.66rem;
  color: var(--text);
  line-height: 1.3;
}
.cal-people li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-people li small { color: var(--text-light); font-size: 0.6rem; }

/* ======== DRAG & DROP (Pointer Events — touch + mouse) ======== */
.cal-person {
  cursor: grab;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* Mobilde kısa dokunma scroll'a izin verir; long-press başlayınca JS preventDefault eder */
  touch-action: pan-y;
}
.cal-person:hover {
  background: rgba(122, 75, 42, 0.08);
}
.cal-person.dragging {
  opacity: 0.35;
  cursor: grabbing;
}
/* İç link — kısa tıklama detay sayfasına gider; uzun bas drag */
.cal-person-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.cal-person-link:hover {
  text-decoration: underline;
  text-decoration-color: rgba(122, 75, 42, 0.5);
  text-underline-offset: 2px;
}
.cal-person.drag-ghost {
  background: var(--orange);
  color: var(--white);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 9999;
  transform: translate(0, 0);
}
.cal-shift-row.drop-target {
  outline: 2px dashed var(--orange);
  outline-offset: -2px;
  background: rgba(232, 147, 74, 0.18);
  border-radius: 4px;
}
body.dragging-active {
  /* Drag sırasında metin seçilmesin, scroll engellensin */
  user-select: none;
  overflow: hidden;
}
body.dragging-active .cal-shift-row {
  transition: none;
}

/* ======== STANDBY PANEL (Yedek + Eksik vardiya paneli) ======== */
.standby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.standby-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.standby-list > li {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}
.standby-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.standby-name {
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}
a.standby-name:hover { color: var(--orange); }
.standby-stat {
  font-feature-settings: "tnum";
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-left: auto;
}
.standby-candidates {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.4;
}
.standby-candidates strong { color: var(--brown-dark); font-weight: 500; }

/* ======== ASSIGN PAGE ======== */
.assign-header { margin-bottom: 0.5rem; }
.assign-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.assign-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cream);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ======== REQ MATRIX ======== */
.req-matrix .num-input {
  width: 60px;
  text-align: center;
  font-feature-settings: "tnum";
}
.req-matrix th, .req-matrix td { vertical-align: middle; }

.card-scroll { overflow-x: auto; }

/* Calendar mobil ayarları */
@media (max-width: 760px) {
  .cal-grid, .cal-weekdays { min-width: 700px; }
  .cal-cell { min-height: 95px; padding: 0.3rem; }
  .cal-day { font-size: 0.8rem; }
  .cal-shift-link { font-size: 0.68rem; padding: 0.2rem 0.35rem; min-height: 24px; }
  .cal-shift-count { font-size: 0.62rem; }
  .cal-people { font-size: 0.65rem; line-height: 1.4; }
  /* Mobilde bir kişi rozeti dokunulabilir boyutta olsun (Apple HIG: 44px ama içeride 28px yeterli) */
  .cal-person { padding: 4px 5px; min-height: 22px; }

  /* Takvim alanı kendi içinde scroll edilebilir; sayfa scroll'unu engellemesin */
  .cal-grid-wrap { -webkit-overflow-scrolling: touch; }
}

/* Mobil mid-size telefon (≤480px): takvimi daha kompakt göster */
@media (max-width: 480px) {
  .cal-grid, .cal-weekdays { min-width: 600px; }
  .cal-cell { min-height: 85px; padding: 0.25rem; }
}

/* PWA push aç banner'ı — content'in en üstünde */
.push-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(232, 147, 74, 0.12), rgba(232, 147, 74, 0.05));
  border: 1px solid rgba(232, 147, 74, 0.35);
  border-radius: 10px;
  color: var(--brown-dark, #5C3A1E);
}
.push-banner .small { font-size: 0.78rem; }
@media (max-width: 480px) {
  .push-banner { flex-direction: column; align-items: stretch; text-align: left; }
}

/* Aynı vardiyadaki diğer çalışan(lar)ı küçük punto ile göster */
.shift-coworkers {
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
  margin-left: 0.5rem;
  white-space: normal;
}
.cal-shift-coworkers {
  font-size: 0.7rem;
  line-height: 1.15;
  color: var(--muted, #6b7280);
  padding: 0 0.15rem 0.2rem;
  word-break: break-word;
}
