* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px; color: #303030; background: #f1f1f1;
}
h1 { font-size: 18px; margin: 0 8px; min-width: 170px; text-align: center; text-transform: capitalize; }
h2 { font-size: 15px; margin: 0 0 6px; }
.muted { color: #707070; }
.small { font-size: 12px; margin: 0 0 8px; }
.hidden { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 1px solid #e3e3e3; position: sticky; top: 0; z-index: 5; }
.nav { display: flex; align-items: center; gap: 6px; }
.btn { border: 1px solid #c9c9c9; background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #f6f6f6; }
.btn.icon { padding: 4px 10px; font-size: 16px; line-height: 1; }
.btn.primary { background: #303030; color: #fff; border-color: #303030; }
.btn.danger { color: #8e1f0b; }
.input { width: 100%; border: 1px solid #c9c9c9; border-radius: 8px; padding: 7px 10px; font-size: 13px; margin-bottom: 10px; }

.layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 16px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.calendar-wrap { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.07); }
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays div { font-weight: 600; color: #616161; padding: 4px 6px; }
.day { min-height: 96px; border: 1px solid #ebebeb; border-radius: 8px; padding: 4px; cursor: pointer; background: #fff; display: flex; flex-direction: column; gap: 3px; }
.day.other { background: #fafafa; color: #b5b5b5; }
.day.today { border-color: #303030; }
.day.selected { outline: 2px solid #005bd3; }
.day.over { background: #eaf4ff; border-color: #005bd3; }
.day-head { display: flex; justify-content: space-between; font-weight: 600; }
.count { background: #303030; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.chip { background: #e8f2e6; border-left: 3px solid #29845a; border-radius: 4px; padding: 2px 5px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.chip.done { background: #f1f1f1; border-left-color: #8a8a8a; color: #707070; text-decoration: line-through; }
.more { font-size: 11px; color: #616161; }

.sidebar { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.07); align-self: start; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.badge { background: #ffd6a4; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.card { border: 1px solid #e3e3e3; border-radius: 8px; padding: 8px; margin-bottom: 8px; background: #fff; cursor: grab; }
.card:active { cursor: grabbing; }
.card-head { display: flex; justify-content: space-between; font-weight: 600; }
.card-actions { display: flex; gap: 6px; margin-top: 6px; }
.card-actions input { flex: 1; border: 1px solid #c9c9c9; border-radius: 6px; padding: 4px 6px; font-size: 12px; }
.dropzone-list.over { background: #fff4e5; border-radius: 8px; }
a.order-link { color: #005bd3; text-decoration: none; }
a.order-link:hover { text-decoration: underline; }

.day-panel { margin-top: 14px; border-top: 1px solid #e3e3e3; padding-top: 12px; }
.day-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; align-items: start; }
.row .items { color: #616161; font-size: 12px; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions input { border: 1px solid #c9c9c9; border-radius: 6px; padding: 4px 6px; font-size: 12px; }

.print-only { display: none; }
@media print {
  body { background: #fff; }
  .topbar, .layout { display: none !important; }
  .print-only { display: block; padding: 10px; font-size: 12px; }
  .print-only table { width: 100%; border-collapse: collapse; }
  .print-only th, .print-only td { border: 1px solid #999; padding: 6px; text-align: left; vertical-align: top; }
}
