@import url("fonts.css");

:root{
  --bg:#f3f1eb;
  --bg-2:#ece7df;
  --card:#fefcf8;
  --text:#1e1c18;
  --muted:#605a52;
  --primary:#b84a2b;
  --primary-600:#9c3b1f;
  --accent:#0f5a4f;
  --danger:#c5393f;
  --warning:#c07a1c;
  --border:#e1d7c8;
  --shadow:0 18px 40px rgba(28,23,18,0.14);
  --radius:18px;
  --page-width:80%;
  --font-body:"Space Grotesk", "Segoe UI", Arial, sans-serif;
  --font-display:"Fraunces", "Times New Roman", serif;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scrollbar-gutter:stable}
body{
  font-family:var(--font-body);
  color:var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(184,74,43,0.12), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(15,90,79,0.12), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  font-size:16px;
  overflow-y:scroll;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.container{width:var(--page-width);max-width:calc(100% - 48px);margin:0 auto;padding:0 24px}
.topbar .container{width:var(--page-width);max-width:calc(100% - 48px)}
main.container{flex:1}

.topbar{
  background:rgba(254,252,248,0.92);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(10px);
}
.topbar-inner{display:flex;align-items:center;gap:18px;padding:16px 0}
.brand{display:inline-flex;align-items:center;justify-content:center;color:var(--text);text-decoration:none}
.brand-logo{width:40px;height:40px}
.brand-logo{color:var(--primary)}
.nav{display:flex;gap:10px;flex:1;flex-wrap:wrap}
.nav a{color:var(--muted);text-decoration:none;font-weight:600;padding:8px 12px;border-radius:999px;transition:all 0.2s ease}
.nav a:hover{background:rgba(184,74,43,0.12);color:var(--primary)}
.actions{display:flex;gap:10px;align-items:center}
.top-action-link{
  color:var(--muted);
  text-decoration:none;
  font-weight:600;
  padding:8px 4px;
  border-radius:999px;
  transition:all 0.2s ease;
}
.top-action-link:hover{background:rgba(184,74,43,0.12);color:var(--primary)}
.mobile-actions{display:none;align-items:center;gap:8px;margin-left:auto}
.admin-mobile-shortcuts{display:flex;align-items:center;gap:8px}
.mobile-toggle{display:none;background:#fff;border:1px solid var(--border);border-radius:12px;padding:8px;gap:4px;flex-direction:column;justify-content:center;align-items:center;cursor:pointer;flex-shrink:0;margin-left:8px}
.mobile-toggle span{display:block;width:20px;height:2px;background:var(--text);border-radius:2px}
.mobile-nav{display:none}
.mobile-nav[hidden]{display:none}
.mobile-nav__inner{display:flex;flex-direction:column;gap:10px}
.mobile-nav__inner a{color:var(--text);text-decoration:none;font-weight:600;padding:10px 12px;border-radius:12px;background:#fff;border:1px solid var(--border)}
.mobile-nav__actions{display:flex;gap:10px;flex-wrap:wrap}

.btn{border:none;border-radius:999px;padding:10px 18px;font-weight:700;cursor:pointer;font-size:1rem;transition:all 0.2s ease; text-decoration: none; display: inline-block;}
.btn.primary{background:var(--primary);color:#fff;box-shadow:0 10px 20px rgba(184,74,43,0.28)}
.btn.primary:hover{background:var(--primary-600);transform:translateY(-1px)}
.btn.outline{background:transparent;border:1px solid var(--border);color:var(--text)}
.btn.ghost{background:transparent;color:var(--primary)}
.btn.danger{background:var(--danger);color:#fff}
.btn.small{padding:6px 12px;font-size:0.95rem}

.page-header{padding:40px 0 24px;animation:fadeInUp 0.6s ease both;width:100%}
.page-title{font-size:2.3rem;font-weight:700;margin-bottom:8px;font-family:var(--font-display)}
.page-subtitle{color:var(--muted);font-size:1rem}

.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}

.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  padding:22px;
  animation:fadeInUp 0.5s ease both;
  width:100%;
}
.card-title{font-weight:700;margin-bottom:12px;font-size:1.1rem}
.qty-control{display:inline-flex;align-items:center;gap:6px}
.order-table{table-layout:fixed}
.week-day .order-table th,.week-day .order-table td{padding:10px 6px}
.week-day .order-table th:nth-child(1), .week-day .order-table td:nth-child(1){width:32%}
.week-day .order-table th:nth-child(2), .week-day .order-table td:nth-child(2){width:14%}
.week-day .order-table th:nth-child(3), .week-day .order-table td:nth-child(3){width:8%}
.week-day .order-table th:nth-child(4), .week-day .order-table td:nth-child(4){width:22%}
.week-day .order-table th:nth-child(5), .week-day .order-table td:nth-child(5){width:24%}
.week-day .order-table th:nth-child(3), .week-day .order-table td:nth-child(3){text-align:right}
.week-day .order-table th:nth-child(4), .week-day .order-table td:nth-child(4){text-align:right}
.week-day .order-table th:nth-child(5), .week-day .order-table td:nth-child(5){text-align:right}
.week-day .order-table .qty-control{width:100%;justify-content:flex-end;gap:8px}
.week-day .order-table .qty-btn{width:36px;height:36px;border-radius:8px}
.week-day .order-table .qty-input{width:58px;padding:6px 6px;font-size:0.95rem}
.day-total{margin-top:10px;text-align:right;font-weight:700;color:#3b322a}
.week-summary{margin:8px 0 16px;text-align:right;font-weight:700;font-size:1.05rem}
.qty-btn{width:30px;height:30px;border-radius:10px;border:1px solid var(--border);background:#fff;font-weight:800;cursor:pointer;font-size:1rem;line-height:1;transition:all 0.2s ease}
.qty-btn:hover{border-color:var(--primary);color:var(--primary)}
.qty-input{width:64px;padding:6px 8px;border:1px solid var(--border);border-radius:10px;text-align:center;font-size:0.95rem}

.form{display:grid;gap:14px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-weight:600}
.field .req{color:var(--danger);font-weight:800;margin-left:4px}
.field input,.field select,.field textarea{
  padding:10px 12px;border:1px solid var(--border);border-radius:12px;font-size:0.95rem;background:#fff
}
.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid rgba(184,74,43,0.2);border-color:var(--primary)}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button{
  -webkit-appearance:none;
  margin:0;
}
input[type="number"]{
  appearance:textfield;
  -moz-appearance:textfield;
}

.class-row{display:grid;grid-template-columns:80px 1fr;gap:10px}

.profile-name{font-size:1.5rem;font-weight:700;margin-bottom:8px;font-family:var(--font-display)}

.table{width:100%;border-collapse:collapse}
.table-wrap{overflow-x:auto}
.table-input{width:100%;min-width:90px}
.table th,.table td{padding:12px 10px;border-bottom:1px solid var(--border);text-align:left}
.table td{white-space:normal;word-break:normal;overflow-wrap:break-word}
.table th{background:#f6f1e8;font-size:0.9rem;color:var(--muted)}
.table-right{table-layout:fixed}
.table-right th,.table-right td{text-align:right}
.table-right th:first-child,.table-right td:first-child{text-align:left}
.table-right td{overflow:hidden;text-overflow:ellipsis}

.badge{display:inline-block;padding:4px 10px;border-radius:999px;font-size:0.85rem;font-weight:700;text-decoration:none;border:1px solid var(--border)}
.badge.ok{background:#e6f4f1;color:#0f5a4f}
.badge.warn{background:#fff1db;color:#9b5d00}
.badge.fail{background:#fde7e7;color:#b42318}

.admin-status{display:inline-flex;align-items:center;gap:6px}
.admin-panel-link{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid rgba(184,74,43,0.18);
  background:linear-gradient(180deg, rgba(255,247,239,0.98) 0%, rgba(255,240,229,0.98) 100%);
  color:var(--primary-600);
  text-decoration:none;
  font-weight:700;
  box-shadow:0 8px 18px rgba(184,74,43,0.12);
  transition:all 0.2s ease;
}
.admin-panel-link:hover{transform:translateY(-1px);box-shadow:0 12px 24px rgba(184,74,43,0.18);background:linear-gradient(180deg, #fffaf4 0%, #fff1e5 100%)}
.admin-panel-link__label{line-height:1.1}
.admin-panel-link--mobile{padding:6px 12px;font-size:0.92rem}

.admin-dashboard-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:20px 0 24px;
  align-items:center;
}

.admin-dashboard-tab{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:46px;
  padding:11px 18px;
  border-radius:16px;
  border:1px solid rgba(184,74,43,0.16);
  background:linear-gradient(180deg, rgba(255,251,247,0.96) 0%, rgba(255,242,232,0.96) 100%);
  color:#7c4129;
  text-decoration:none;
  font-weight:700;
  line-height:1.1;
  letter-spacing:0.01em;
  box-shadow:0 10px 24px rgba(184,74,43,0.10);
  transition:transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.admin-dashboard-tab:hover{
  transform:translateY(-2px);
  background:linear-gradient(180deg, #fffdf9 0%, #ffeede 100%);
  box-shadow:0 14px 28px rgba(184,74,43,0.16);
  border-color:rgba(184,74,43,0.24);
  color:#6d3822;
}

.admin-dashboard-tab:focus-visible{
  outline:none;
  box-shadow:0 0 0 4px rgba(184,74,43,0.16), 0 12px 26px rgba(184,74,43,0.18);
}

.admin-dashboard-tab.is-active{
  background:linear-gradient(135deg, #b84a2b 0%, #d96a43 100%);
  border-color:rgba(184,74,43,0.36);
  color:#fff;
  box-shadow:0 16px 34px rgba(184,74,43,0.24);
}

.admin-dashboard-tab__badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  height:28px;
  padding:0 8px;
  border-radius:999px;
  background:#fff;
  color:#b84a2b;
  font-size:0.8rem;
  font-weight:800;
  line-height:1;
  box-shadow:0 8px 18px rgba(123,58,36,0.14);
}

.admin-dashboard-tab.is-active .admin-dashboard-tab__badge{
  background:rgba(255,255,255,0.18);
  color:#fff;
  box-shadow:none;
  border:1px solid rgba(255,255,255,0.18);
}

@media (max-width: 720px){
  .admin-dashboard-tabs{
    gap:10px;
  }

  .admin-dashboard-tab{
    flex:1 1 calc(50% - 10px);
    padding:10px 14px;
  }
}

@media (max-width: 520px){
  .admin-dashboard-tab{
    flex-basis:100%;
    justify-content:space-between;
  }
}

.notify-dot{
  background:#c5393f;
  color:#fff;
  border-radius:999px;
  font-size:0.75rem;
  font-weight:800;
  padding:2px 0px;
  min-width:18px;
  text-align:center;
  line-height:1.1;
  box-shadow:0 6px 14px rgba(197,57,63,0.24);
}
.notify-dot[hidden]{display:none;visibility:hidden}
.notify-dot--inline{position:static;padding:3px 8px;min-width:24px}

.notice{padding:12px 16px;border-radius:14px;background:#fff4e9;border:1px solid #f0d6be;margin-bottom:16px;color:#7b4b15}
.notice.error{background:#fdeaea;border-color:#f7c9cc;color:#9e1f25}

.section{margin:24px 0;width:100%}

.footer{padding:32px 0;color:var(--muted);margin-top:auto}
.footer-inner{display:grid;gap:16px;grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));align-items:start}
.footer-title{font-weight:700;color:var(--text);margin-bottom:6px}
.footer-subtitle{color:var(--muted)}
.footer-list{list-style:none;padding-left:0;margin:0;display:grid;gap:6px;font-size:0.95rem}

.hero{
  display:grid;
  grid-template-columns:1.2fr 0.8fr;
  gap:24px;
  background:linear-gradient(120deg,#fff7ed 0%, #fdf2e2 100%);
  border:1px solid var(--border);
  border-radius:24px;
  padding:26px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
  margin-top:12px;
}

.hero__content h1{font-size:2.35rem;margin:10px 0 8px;font-family:var(--font-display)}
.hero__content p{color:var(--muted);font-size:1rem}
.hero__badge{display:inline-flex;align-items:center;gap:8px;background:#fff0dd;color:var(--primary);padding:6px 12px;border-radius:999px;font-weight:700}
.hero__actions{display:flex;gap:10px;margin-top:16px}
.hero__card{background:#ffffff;border:1px dashed #e6d8c4;border-radius:18px;padding:16px}
.hero__card-title{font-weight:700;margin-bottom:8px}
.hero__card ul{color:var(--muted);line-height:1.55;padding-left:16px}

.menu-grid{display:grid;gap:20px;width:100%}
.menu-period-heading{display:flex;align-items:center;gap:15px;margin:40px 0 20px}
.menu-period-heading__line{flex:1;height:1px;background:var(--border)}
.menu-period-heading__title{margin:0;color:var(--primary-600);font-family:var(--font-display);font-size:1.6rem;background:rgba(184,74,43,0.08);padding:8px 24px;border-radius:999px;text-align:center}
.menu-card{background:#fff;border-radius:18px;border:1px solid var(--border);box-shadow:var(--shadow);padding:18px}
.menu-card__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.menu-card__count{background:#efe3d2;color:#8b4b2f;padding:4px 10px;border-radius:999px;font-weight:700}
.menu-table-scroll{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
.menu-table-scroll--desktop{display:block}
.menu-table--tablet-fluid{width:100%}
.menu-table{width:100%;border-collapse:collapse;table-layout:fixed}
.menu-table th,.menu-table td{padding:12px 10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
.menu-table td{white-space:normal;word-break:normal;overflow-wrap:break-word}
.menu-table th:last-child,.menu-table td:last-child{text-align:right}
.menu-table th:nth-child(1), .menu-table td:nth-child(1){width:24%}
.menu-table th:nth-child(2), .menu-table td:nth-child(2){width:40%}
.menu-table th:nth-child(3), .menu-table td:nth-child(3){width:10%}
.menu-table th:nth-child(4), .menu-table td:nth-child(4){width:10%}
.menu-table th:nth-child(5), .menu-table td:nth-child(5){width:16%}
.menu-table th{background:#fbf6ee;color:var(--muted);font-size:0.9rem}
.menu-title{font-weight:700;word-break:normal;overflow-wrap:break-word}
.menu-sub{color:var(--muted);font-size:0.85rem}
.menu-muted{color:var(--muted)}
.menu-mobile-list{display:none}
.menu-mobile-period{display:grid;gap:12px}
.menu-mobile-period__items{display:grid;gap:10px}
.menu-mobile-period__title{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(184,74,43,0.08);
  color:var(--primary-600);
  font-weight:800;
  letter-spacing:0.04em;
  text-transform:uppercase;
  font-size:0.82rem;
}
.menu-mobile-item{
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,252,247,0.96) 0%, rgba(255,247,239,0.96) 100%);
  box-shadow:0 8px 22px rgba(30,28,24,0.06);
}
.menu-mobile-item__main{display:grid;gap:4px}
.menu-mobile-item__composition{margin-top:10px;color:var(--muted);font-size:0.92rem;line-height:1.45}
.menu-mobile-item__meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}
.menu-mobile-pill{
  display:grid;
  gap:4px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
}
.menu-mobile-pill__label{font-size:0.76rem;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:var(--muted)}
.menu-mobile-pill--price{background:#fff7ef}

.reports-stack{display:grid;gap:24px}
.reports-card{display:grid;gap:16px}
.reports-card__text{color:var(--muted)}
.reports-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;align-items:end}
.reports-form__field{min-width:0}
.reports-form__field--compact{max-width:220px}
.reports-form__action{justify-self:start;white-space:nowrap}
.reports-form--stats{grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) minmax(180px,220px) auto;justify-content:start}

.menu-highlight{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.menu-highlight h3{margin-bottom:6px}
.menu-highlight p{color:var(--muted)}
.feature-card{position:relative;padding-left:0}
.feature-card__icon{
  width:42px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:10px;
  border-radius:14px;
  background:linear-gradient(180deg, #fff3e8 0%, #fbe7d7 100%);
  border:1px solid rgba(184,74,43,0.14);
  font-size:20px;
  box-shadow:0 10px 18px rgba(184,74,43,0.1);
}
.hero__actions--compact{margin-top:0;gap:10px;justify-content:flex-end;flex-wrap:wrap}

.week-grid{display:grid;gap:16px;width:100%}
.week-day--collapsible{padding:0;overflow:hidden}
.week-day--collapsible[open]{padding:0}
.week-day__summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;cursor:pointer;list-style:none}
.week-day__summary::-webkit-details-marker{display:none}
.week-day__summary:hover{background:rgba(184,74,43,0.05)}
.week-day__content{padding:0 16px 16px}
.week-day__toggle{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--border);border-radius:999px;background:#fffaf2;flex-shrink:0}
.week-day__toggle::before,.week-day__toggle::after{content:"";position:absolute;width:12px;height:2px;background:var(--primary);border-radius:999px;transition:transform 0.2s ease, opacity 0.2s ease}
.week-day__toggle::after{transform:rotate(90deg)}
.week-day--collapsible[open] .week-day__toggle::after{transform:rotate(180deg);opacity:0}
.week-day{background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.week-day__head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:12px}
.week-day__header{font-weight:700;font-size:1.2rem}
.week-day__meta{display:flex;flex-direction:row;align-items:center;gap:6px;font-weight:700;color:#3b322a;white-space:nowrap}
.week-day__count{font-size:1.1rem}
.week-day__label{font-size:0.95rem;color:var(--muted)}
.week-row{display:grid;grid-template-columns:180px 1fr;gap:12px;align-items:center;padding:10px 0;border-bottom:1px dashed #e6d8c4}
.module-menu-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:4px 0 2px}
.week-row:last-child{border-bottom:none}
.week-row__label{font-weight:600;color:#3b322a}
.week-row__selects{display:grid;grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));gap:10px}
.menu-select{padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:#fffaf2;font-size:0.95rem}

.meal-toggle{display:inline-flex;gap:8px;background:#fff;border:1px solid var(--border);border-radius:999px;padding:8px;box-shadow:var(--shadow)}
.meal-toggle__btn,.meal-toggle__link{background:transparent;border:none;border-radius:999px;padding:8px 18px;font-weight:700;font-size:1rem;color:var(--muted);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;min-height:36px}
.meal-toggle__btn.is-active,.meal-toggle__link.is-active{background:var(--accent);color:#fff}
.meal-panel[hidden]{display:none}

.global-toggles{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.global-toggles .btn{
  padding:10px 16px;
  font-weight:800;
  border-width:1.5px;
  background:linear-gradient(180deg, rgba(255,251,247,0.98) 0%, rgba(255,244,235,0.98) 100%);
  box-shadow:0 8px 18px rgba(30,28,24,0.08);
}
.global-toggles .btn:hover{
  border-color:rgba(184,74,43,0.32);
  color:var(--primary-600);
  box-shadow:0 12px 24px rgba(184,74,43,0.14);
}

.table-wrap--wide .table{
  min-width:1400px;
}
.table-wrap--wide .table th,
.table-wrap--wide .table td{
  white-space:nowrap;
}

.menu-global-table th,
.menu-global-table td{
  padding:7px 5px;
}

.menu-global-table th:nth-child(2),
.menu-global-table td:nth-child(2),
.menu-global-table th:nth-child(3),
.menu-global-table td:nth-child(3),
.menu-global-table th:nth-child(6),
.menu-global-table td:nth-child(6){
  width:72px;
}

.menu-global-table th:nth-child(4),
.menu-global-table td:nth-child(4),
.menu-global-table th:nth-child(5),
.menu-global-table td:nth-child(5){
  width:92px;
}

.menu-global-table th:nth-last-child(2),
.menu-global-table td:nth-last-child(2){
  max-width:240px;
}

.menu-global-layout{
  align-items:start;
}

.menu-global-table{
  position:relative;
}

.menu-global-table__actions-head,
.menu-global-table__actions-cell{
  position:sticky;
  right:0;
  z-index:2;
  background:var(--card);
  width:1%;
}

.menu-global-table__actions-head{
  z-index:4;
  box-shadow:-10px 0 16px -14px rgba(30,28,24,0.35);
}

.menu-global-table__actions-cell{
  min-width:1px;
  box-shadow:-10px 0 16px -14px rgba(30,28,24,0.28);
  padding-left:2px;
  padding-right:2px;
}

.menu-global-table__actions-head::before,
.menu-global-table__actions-cell::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:1px;
  background:var(--border);
}

.menu-global-table__actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:4px;
  min-height:32px;
  width:max-content;
  margin-left:auto;
  padding-left:0;
}

.menu-global-table__actions .btn{
  white-space:nowrap;
  padding:4px 8px;
  font-size:0.88rem;
}

.menu-global-table__actions form{
  display:inline-flex !important;
}

.menu-global-table__actions .icon-btn{
  padding:4px;
}

.meal-section{margin:16px 0 8px}
.meal-section--accent{padding-top:12px}
.meal-section--accent .meal-section__title{background:rgba(15,90,79,0.12);padding:4px 12px;border-radius:999px;display:inline-flex}
.meal-section__title{font-weight:700;color:#3b322a;margin-bottom:6px;font-size:1.1rem}

@media (max-width: 720px){
  .week-day__summary{padding:14px}
  .week-day__content{padding:0 14px 14px}
  .week-row{grid-template-columns:1fr;gap:8px}
}

.week-order{display:grid;gap:16px;width:100%}
.week-actions{display:flex;justify-content:flex-end}
.order-range-summary{font-weight:600;color:var(--muted);text-align:right;margin-top:4px}
.order-table--interactive .qty-control{min-width:max-content;flex-wrap:nowrap}
.order-table--interactive .qty-btn{flex:0 0 36px}
.order-table--interactive .qty-input{flex:0 0 58px}
.order-table--interactive th:nth-child(3),
.order-table--interactive td:nth-child(3){min-width:88px}
.order-table--interactive th:nth-child(4),
.order-table--interactive td:nth-child(4){min-width:168px}
.order-table--interactive th:nth-child(5),
.order-table--interactive td:nth-child(5){min-width:110px}

.active-menu-actions{margin-top:12px}

.login-choice .card{
  min-height:170px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:18px;
}

.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}

.list-compact{list-style:none;padding-left:0;margin:8px 0 0;display:grid;gap:6px;color:var(--muted);font-size:0.92rem}

.payments-actions{white-space:nowrap}
.payments-actions .btn{padding:6px 10px;font-size:0.9rem}
.procurements-actions{white-space:nowrap}
.procurements-actions .btn{padding:6px 10px;font-size:0.9rem}
.period-cell{white-space:nowrap}
.table th,.table td{padding:10px 8px}

.admin-table-scroll{max-height:500px;overflow-y:auto}
.section.card{overflow:visible}
.admin-table th,.admin-table td{text-align:left;vertical-align:top}
.admin-table td:last-child,.admin-table th:last-child{text-align:left}
.admin-table .cell-money{text-align:right}
.admin-table .cell-money .menu-sub{text-align:right}

.admin-table .col-id{width:40px}
.admin-table .col-cook{width:120px}
.admin-table .col-name{width:140px}
.admin-table .col-email{width:140px}
.admin-table .col-role{width:80px}
.admin-table .col-action{width:140px}
.admin-table .col-period{width:160px}
.admin-table .col-sum{width:140px}
.admin-table .col-stock{width:90px}
.admin-table .col-status{width:120px}
.admin-table .col-file{width:100px}
.admin-table .col-date{width:120px}
.admin-table td .menu-sub{white-space:normal;word-break:normal}
.admin-table .payments-actions{gap:8px;align-items:center;flex-wrap:wrap}

.table-history{table-layout:auto;width:100%}
.table-history td,.table-history th{vertical-align:middle}
.table-history .order-actions{white-space:normal;flex-wrap:wrap;align-items:flex-start}
.table-wrap--history{width:100%}

.profile-balance-card,.profile-card{overflow:hidden}
.profile-balance-grid,.profile-main-grid{align-items:start;gap:24px}
.profile-balance-main,.profile-summary-block,.profile-contacts-block{min-width:0}
.profile-balance-actions{display:flex;justify-content:flex-end;align-items:center}
.profile-contacts-block .form{max-width:360px}
.profile-balance-main{display:grid;gap:8px}
.profile-summary-block,.profile-contacts-block{display:grid;gap:12px;align-content:start}
.profile-card .section{margin-bottom:0}

.menu-global-layout{align-items:start}
.menu-global-card{height:100%}
.menu-global-card--form{max-width:100%}
.menu-global-card .card-title{line-height:1.3}
.menu-global-layout .card{padding:24px}

.order-status{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:0.9rem;
  font-weight:700;
  line-height:1.2;
  border:1px solid transparent;
}
.order-status--draft,.order-status--confirmed{background:#fff4db;color:#8a5a00;border-color:#f2cf7a}
.order-status--paid{background:#e6f4ff;color:#0b5cab;border-color:#a8d0ff}
.order-status--approved{background:#e9f9ee;color:#1f7a38;border-color:#9ed8ad}
.order-status--problem{background:#ffe9e7;color:#b23b2f;border-color:#f1b0aa}
.order-status--cancelled{background:#f1f3f5;color:#66707a;border-color:#d6dbe1}
.order-status--confirmed{background:#fff7df;color:#8b5e00;border-color:#efd48a}
.order-status--paid{background:#e7f2ff;color:#1f5ea8;border-color:#b9d4fb}
.order-status--approved{background:#e8f7ec;color:#207245;border-color:#b1dec0}
.order-status--problem{background:#fff0ea;color:#b74a28;border-color:#f3c1b4}
.order-status--cancelled{background:#f3f4f6;color:#5f6b76;border-color:#d7dce2}

.admin-order-cancel-form{display:inline-flex}
.admin-order-cancel-btn{
  min-width:142px;
  justify-content:center;
  text-align:center;
  min-height:34px;
  font-size:0.95rem;
  font-weight:700;
}
.admin-order-cancel-btn--state{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 12px;
  font-size:0.95rem;
  font-weight:700;
  min-width:142px;
  min-height:34px;
}

.admin-table--users td:last-child form{
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.admin-table--users td:last-child select{
  min-width:90px;
}

.icon-btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:10px;
  padding:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:all 0.2s ease;
  text-decoration:none;
}
.icon-btn:hover{border-color:var(--primary);color:var(--primary)}
.icon-btn svg{width:18px;height:18px;fill:currentColor}
.icon-btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.icon-btn.danger:hover{background:#b22f34;border-color:#b22f34;color:#fff}

.order-actions{display:flex;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:wrap}
.order-actions .btn{max-width:100%}
.order-actions--details .btn{white-space:normal;text-align:center}
.action-delete{display:inline-flex}
.action-placeholder{display:inline-block;min-width:10px;height:1.2em}

.order-details-table{table-layout:fixed}
.order-details-table th:nth-child(1), .order-details-table td:nth-child(1){width:44%}
.order-details-table th:nth-child(2), .order-details-table td:nth-child(2){width:22%}
.order-details-table th:nth-child(3), .order-details-table td:nth-child(3){width:18%;text-align:right}
.order-details-table th:nth-child(4), .order-details-table td:nth-child(4){width:16%;text-align:right}
.order-details-qty{text-align:right;white-space:nowrap}
.order-details-qty .badge{min-width:32px;text-align:right;display:inline-block}
.order-details-qty-badge--multi{background:#fde8dd;color:var(--primary-600);border-color:#efbea5}
.order-day-card{margin-bottom:16px}
.order-day-card:last-child{margin-bottom:0}
.order-day-total{margin-top:10px;text-align:right}

.flatpickr-calendar{background:#fff;border:1px solid var(--border);box-shadow:var(--shadow)}
.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange{background:var(--primary);border-color:var(--primary)}

@keyframes fadeInUp{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

@media (max-width:1180px){
  .container,.topbar .container{width:100%;max-width:100%;padding-left:16px;padding-right:16px}
  .grid-2,.grid-3{grid-template-columns:1fr}
  .nav{display:none}
  .actions{display:none}
  .topbar-inner{gap:12px;padding:12px 0}
  .brand-logo{width:34px;height:34px}
  .mobile-actions{display:flex;min-width:0;flex:1;justify-content:flex-end}
  .mobile-actions .badge,.mobile-actions .admin-panel-link{max-width:100%}
  .admin-mobile-shortcuts{min-width:0;max-width:100%;justify-content:flex-end}
  .admin-mobile-shortcuts > *{min-width:0}
  .mobile-toggle{display:flex}
  .mobile-nav{display:block;position:fixed;inset:66px 12px auto 12px;background:rgba(254,252,248,0.98);border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow);z-index:30;max-height:calc(100vh - 88px);overflow:auto}
  body.nav-open{overflow:hidden}
  .page-header{padding:28px 0 20px}
  .page-title{font-size:1.9rem;line-height:1.05}
  .card{padding:18px}
  .hero{grid-template-columns:1fr}
  .hero__actions{flex-wrap:wrap}
  .hero__actions .btn{width:100%;text-align:center}
  .menu-highlight{grid-template-columns:1fr}
  .section-head{flex-direction:column;align-items:flex-start;gap:10px}
  .menu-table:not(.menu-table--tablet-fluid):not(.order-table--interactive),
  .order-table:not(.menu-table--tablet-fluid):not(.order-table--interactive),
  .table{display:block;width:100%;overflow-x:auto;white-space:nowrap}
  .menu-table:not(.menu-table--tablet-fluid):not(.order-table--interactive) thead,
  .menu-table:not(.menu-table--tablet-fluid):not(.order-table--interactive) tbody,
  .order-table:not(.menu-table--tablet-fluid):not(.order-table--interactive) thead,
  .order-table:not(.menu-table--tablet-fluid):not(.order-table--interactive) tbody,
  .table thead,
  .table tbody{display:table;min-width:640px;width:max-content}
  .week-row{grid-template-columns:1fr}
  .week-row__selects{grid-template-columns:1fr}
  .date-range-buttons{display:grid;grid-template-columns:1fr;gap:8px}
  .date-range-btn{width:100%}
  .global-toggles{display:grid;grid-template-columns:1fr;gap:8px}
  .global-toggles .btn{width:100%}
  .week-actions .btn{width:100%;text-align:center}
  .profile-balance-actions{justify-content:flex-start}
  .profile-contacts-block .form{max-width:none}
  .profile-balance-card,.profile-card{padding:18px}
  .menu-global-layout .card{padding:18px}
  .hero__actions--compact{justify-content:flex-start}
}

@media (min-width:721px) and (max-width:1180px){
  .table-history{
    display:table;
    width:100%;
    white-space:normal;
    table-layout:auto;
  }

  .table-history thead{display:table-header-group}
  .table-history tbody{display:table-row-group;width:100%;min-width:0}

  .menu-table--tablet-fluid{
    display:table;
    width:100%;
    overflow:visible;
    white-space:normal;
    table-layout:fixed;
  }

  .menu-table--tablet-fluid thead{display:table-header-group}
  .menu-table--tablet-fluid tbody{display:table-row-group}

  .order-table--interactive{
    display:block;
    width:100%;
    overflow-x:auto;
    white-space:nowrap;
  }

  .order-table--interactive thead,
  .order-table--interactive tbody{
    display:table;
    width:100%;
    min-width:780px;
  }
}

@media (max-width:900px){
  .footer-inner{grid-template-columns:1fr}
  .reports-form__field--compact{max-width:none}
}

@media (max-width:720px){
  .mobile-actions{display:flex;min-width:0;flex:1;justify-content:flex-end}
  .mobile-actions .badge,
  .mobile-actions .admin-panel-link{
    max-width:100%;
    white-space:nowrap;
  }
  .topbar-inner{gap:10px}
  .page-title{font-size:1.7rem}
  .page-subtitle{font-size:0.95rem}
  .btn{padding:10px 16px}
  .btn.small{padding:8px 12px;font-size:0.92rem}
  .container,.topbar .container{padding-left:12px;padding-right:12px}
  .menu-period-heading{gap:10px;margin:28px 0 16px}
  .menu-period-heading__title{font-size:1.1rem;padding:8px 14px;max-width:100%}

  .table-history,
  .table-history thead,
  .table-history tbody,
  .table-history tr,
  .table-history th,
  .table-history td{
    display:block;
    width:100%;
  }

  .table-history colgroup,
  .table-history thead{
    display:none;
  }

  .table-history tbody{
    min-width:0;
  }

  .table-history tr{
    padding:14px;
    border:1px solid var(--border);
    border-radius:16px;
    background:#fff;
    box-shadow:0 10px 24px rgba(28,23,18,0.08);
    margin-bottom:14px;
  }

  .table-history tr:last-child{
    margin-bottom:0;
  }

  .table-history td{
    border-bottom:1px solid rgba(225,215,200,0.75);
    padding:10px 0;
    white-space:normal;
    overflow:visible;
  }

  .table-history td:last-child{
    border-bottom:none;
    padding-bottom:0;
  }

  .table-history td::before{
    content:attr(data-label);
    display:block;
    margin-bottom:6px;
    font-size:0.8rem;
    font-weight:700;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:0.04em;
  }

  .table-history .order-actions{
    gap:8px;
    white-space:normal;
  }

  .table-history .order-actions .btn,
  .table-history .order-actions .badge,
  .table-history .order-actions .action-delete{
    width:100%;
    justify-content:center;
  }

  .table-history .order-actions .action-delete .icon-btn{
    width:100%;
    min-height:40px;
    border-radius:999px;
  }

  .table-history .order-status{
    width:max-content;
    max-width:100%;
  }

  .menu-table-scroll{
    margin:0 -4px;
    padding:0 4px 4px;
  }

  .menu-card .menu-table-scroll--desktop,
  .week-day .menu-table-scroll--desktop{
    display:none;
  }

  .menu-card .menu-mobile-list,
  .week-day .menu-mobile-list{
    display:grid;
    gap:12px;
  }

  .menu-card__header{
    align-items:flex-start;
    gap:10px;
  }

  .menu-card__count{
    flex-shrink:0;
  }

  .week-day__summary{
    align-items:flex-start;
    gap:12px;
  }

  .week-day__meta{
    margin-left:auto;
  }

  .week-day__header{
    font-size:1.05rem;
    line-height:1.2;
  }

  .menu-mobile-item{
    padding:12px;
  }

  .menu-mobile-item__composition{
    font-size:0.88rem;
  }

  .menu-mobile-item__meta{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .menu-mobile-pill--price{
    grid-column:1 / -1;
  }

  .reports-form{
    grid-template-columns:1fr;
  }

  .reports-form__action{
    width:100%;
    text-align:center;
  }

  .order-table--interactive{
    display:block;
    width:100%;
    overflow:visible;
    white-space:normal;
  }

  .order-table--interactive thead{
    display:none;
  }

  .order-table--interactive tbody{
    display:block;
    width:100%;
    min-width:0;
  }

  .order-table--interactive .order-table__period-row{
    display:block;
    margin:14px 0 8px;
  }

  .order-table--interactive .order-table__period-row td{
    display:block;
    width:100% !important;
    border:none;
    padding:0;
    background:transparent !important;
    text-align:left !important;
  }

  .order-table--interactive .order-table__period-label{
    color:var(--primary-600);
    font-weight:800;
    letter-spacing:0.04em;
    text-transform:uppercase;
  }

  .order-table--interactive .order-table__item-row{
    display:block;
    margin-bottom:12px;
    padding:14px;
    border:1px solid var(--border);
    border-radius:16px;
    background:#fff;
    box-shadow:0 10px 24px rgba(28,23,18,0.08);
  }

  .order-table--interactive .order-table__item-row td{
    display:block;
    width:100% !important;
    border-bottom:none;
    padding:0;
    text-align:left !important;
    white-space:normal;
  }

  .order-table--interactive .order-table__item-row td + td{
    margin-top:10px;
    padding-top:10px;
    border-top:1px solid rgba(225,215,200,0.75);
  }

  .order-table--interactive .order-table__item-row td::before{
    content:attr(data-label);
    display:block;
    margin-bottom:6px;
    font-size:0.8rem;
    font-weight:700;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:0.04em;
  }

  .order-table--interactive .order-table__item-row .qty-control{
    display:grid;
    grid-template-columns:40px 72px 40px;
    gap:8px;
    width:max-content;
    max-width:100%;
    justify-content:flex-start;
    align-items:center;
  }

  .order-table--interactive .order-table__item-row .qty-btn{
    width:40px;
    height:40px;
    min-width:40px;
  }

  .order-table--interactive .order-table__item-row .qty-input{
    width:100%;
    min-width:0;
    text-align:center;
  }

  .order-table--interactive .row-total{
    font-weight:700;
  }

  .table,
  .order-table:not(.order-table--interactive){
    overflow-x:visible;
    white-space:normal;
  }

  .table thead,
  .table tbody,
  .order-table:not(.order-table--interactive) thead,
  .order-table:not(.order-table--interactive) tbody{
    min-width:0;
    width:100%;
  }

  .week-day .order-table .qty-control{
    justify-content:flex-start;
  }

  .week-day .order-table .qty-input{
    width:72px;
  }

  .day-total,
  .week-summary,
  .order-range-summary{
    text-align:left;
  }
}
