:root{
  --bg:#f7f7f8;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --primary:#2563eb;
  --primary-2:#1d4ed8;
  --danger:#b91c1c;
  --danger-2:#991b1b;
  --reserved:#4b5563;
  --past:#d1d5db;
  --selected:#93c5fd;
  --shadow: 0 10px 25px rgba(0,0,0,.08);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}
a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width: 1250px;
  margin: 0 auto;
  padding: 18px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.brand{
  font-weight:700;
  font-size:18px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  box-shadow: var(--shadow);
}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-end;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width: 240px;
}
.field label{
  font-size:13px;
  color:var(--muted);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field input[type="password"],
.field select,
.field textarea{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
  outline:none;
  background:#fff;
}
.field textarea{
  min-height:250px;
  resize:vertical;
}

.btn{
  border:0;
  border-radius:12px;
  padding:10px 14px;
  font-size:14px;
  cursor:pointer;
  background:var(--primary);
  color:#fff;
  box-shadow: 0 6px 18px rgba(37,99,235,.22);
}
.btn:hover{ background:var(--primary-2); }
.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
  box-shadow:none;
}
.btn.secondary{
  background:var(--primary);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.btn.secondary:hover{ background:var(--primary-2); }

.btn.danger{
  background:var(--danger);
  box-shadow: 0 6px 18px rgba(185,28,28,.18);
}
.btn.danger:hover{ background:var(--danger-2); }

.small{
  font-size: 12px;
  color: var(--muted);
}

.divider{
  height:1px;
  background:var(--border);
  margin: 14px 0;
}

.calendar-wrap{
  margin-top: 12px;
}

.cal-nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.cal-nav .left{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.icon-btn{
  width:38px;
  height:38px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
}
.icon-btn:hover{ background:#f3f4f6; }

.cal-label{
  font-weight:600;
}

.months{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 980px){
  .months{ grid-template-columns:1fr; }
}

.month{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
.month-header{
  padding:10px 12px;
  background:#f9fafb;
  border-bottom:1px solid var(--border);
  font-weight:700;
}
.month table{
  width:100%;
  table-layout: fixed;
  border-collapse:collapse;
}
.month th, .month td{
  text-align:center;
  padding:8px 2px;
  font-size:13px;
  border-bottom:1px solid #f3f4f6;
}
.month th{
  color:var(--muted);
  font-weight:600;
  background:#fff;
}

.day{
  cursor:pointer;
  border-radius:10px;
  display:inline-flex;
  width:34px;
  height:34px;
  align-items:center;
  justify-content:center;
  margin:2px 0;
}
.day:hover{
  outline:2px solid rgba(37,99,235,.25);
}
.day.disabled{
  cursor:not-allowed;
  color:#9ca3af;
}
.day.past{
  background: #f3f4f6;
  color:#9ca3af;
}
.day.reserved{
  background: var(--reserved);
  color: #fff;
}
.day.selected{
  background: var(--selected);
  color:#0b1220;
  font-weight:700;
  outline:2px solid rgba(37,99,235,.35);
}

.tooltip{
  position:relative;
}
.tooltip[data-tip]:hover::after{
  content: attr(data-tip);
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom: 40px;
  background:#111827;
  color:#fff;
  padding:6px 8px;
  border-radius:10px;
  font-size:12px;
  white-space:nowrap;
  z-index: 5;
}

.modal-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.5);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:1000;
}
.modal-overlay.show{ display:flex; }

.modal{
  background:#fff;
  border-radius:16px;
  max-width: 900px;
  width:100%;
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}
.modal .close{
  position:absolute;
  right:10px;
  top:10px;
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
}
.modal .close:hover{ background:#f3f4f6; }
.modal-body{
  padding:14px;
}
.modal-body img{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
  border:1px solid var(--border);
}
.modal-title{
  font-weight:800;
  margin:0 0 10px 0;
}

.summary{
  background:#f9fafb;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
}
.summary ul{
  margin:8px 0 0 18px;
}

.conditions{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:#fff;
  max-height: 300px;
  overflow:auto;
  white-space: pre-wrap;
}

.notice{
  border-left:4px solid var(--primary);
  background:#eff6ff;
  padding:10px 12px;
  border-radius:12px;
  margin: 10px 0;
}

.error{
  border-left:4px solid var(--danger);
  background:#fef2f2;
  padding:10px 12px;
  border-radius:12px;
  margin: 10px 0;
}

.admin-nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.admin-nav a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
}
.admin-nav a.active{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 6px 18px rgba(37,99,235,.12);
}
.badge{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
}
.day-label{
  display:block;
  margin-top:4px;
  font-size:10px;
  line-height:1.1;
  color:#fff;
  background: var(--reserved);
  padding:2px 4px;
  border-radius:8px;
}
