:root {
  --ui-primary: #2f61d8;
  --ui-primary-dark: #1f4dbd;
  --ui-sidebar: #3366de;
  --ui-sidebar-dark: #264fb4;
  --ui-bg: #f4f7fc;
  --ui-border: #e6ebf5;
  --ui-text: #1f2937;
  --ui-muted: #6b7280;
  --ui-card: #ffffff;
  --ui-radius: 1rem;
  --ui-shadow: 0 18px 50px rgba(30, 64, 175, .08);
}

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

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef3ff 0%, #f8fbff 100%);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-shell.single-panel { grid-template-columns: 1fr; }
.auth-branding {
  background: linear-gradient(180deg, var(--ui-sidebar) 0%, var(--ui-sidebar-dark) 100%);
  color: #fff;
  padding: 4rem;
  align-items: center;
}
.auth-branding h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.08; max-width: 12ch; margin: 0 0 1rem; }
.auth-branding p { max-width: 40rem; color: rgba(255,255,255,.84); font-size: 1.05rem; }
.auth-feature-list { display: grid; gap: 1rem; margin-top: 2rem; }
.auth-feature-list div { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.95); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-panel.full-width { min-height: 100vh; }
.auth-card { width: 100%; max-width: 520px; border-radius: 1.5rem; background: rgba(255,255,255,.96); }
.brand-badge {
  display: inline-flex; align-items: center; gap: .6rem; background: rgba(47,97,216,.1); color: var(--ui-primary);
  border-radius: 999px; padding: .55rem .95rem; font-weight: 700;
}
.brand-badge-white { background: rgba(255,255,255,.12); color: #fff; }
.brand-badge-white i { color: #fff; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px; background: linear-gradient(180deg, var(--ui-sidebar) 0%, var(--ui-sidebar-dark) 100%);
  color: #fff; padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between;
  position: fixed; inset: 0 auto 0 0; z-index: 1040; box-shadow: 8px 0 40px rgba(37, 71, 169, .18);
}
.sidebar-brand { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: 1rem; background: rgba(255,255,255,.08); }
.sidebar-brand-icon { width: 2.5rem; height: 2.5rem; border-radius: .8rem; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 1.2rem; }
.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { color: rgba(255,255,255,.75); }
.sidebar-label { color: rgba(255,255,255,.6); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 0 .9rem .75rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .85rem; color: rgba(255,255,255,.88);
  padding: .9rem 1rem; border-radius: .95rem; margin-bottom: .35rem; transition: .2s ease;
}
.sidebar-nav a i { font-size: 1.1rem; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-footer { padding: 1rem; border-radius: 1rem; background: rgba(255,255,255,.08); }

.main-content { flex: 1; margin-left: 280px; width: calc(100% - 280px); }
.topbar {
  height: 88px; padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ui-border); position: sticky; top: 0; z-index: 1030;
}
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--ui-muted); font-size: .92rem; }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.topbar-user { display: flex; align-items: center; gap: .8rem; padding: .6rem .85rem; border: 1px solid var(--ui-border); border-radius: 999px; background: #fff; }
.topbar-user strong { display: block; font-size: .92rem; }
.topbar-user small { display: block; color: var(--ui-muted); text-transform: capitalize; }
.avatar-circle { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: #edf3ff; color: var(--ui-primary); }
.content-area { padding: 1.5rem; }

.stat-card, .panel-card {
  background: var(--ui-card); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow);
}
.stat-card { padding: 1.25rem; height: 100%; }
.stat-icon { width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 1rem; background: #eef4ff; color: var(--ui-primary); font-size: 1.2rem; margin-bottom: 1rem; }
.stat-label { color: var(--ui-muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; margin-top: .4rem; }
.stat-note { color: var(--ui-muted); font-size: .9rem; margin-top: .35rem; }
.panel-card-header { padding: 1.25rem 1.25rem 0; }
.panel-card-header h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.panel-card-header p { margin: .35rem 0 0; color: var(--ui-muted); }
.panel-card-body { padding: 1.25rem; }
.welcome-box { background: linear-gradient(135deg, #f7faff 0%, #eef4ff 100%); border-radius: 1.25rem; padding: 1.25rem; border: 1px solid #dbe7ff; }
.welcome-box h3 { font-size: 1.05rem; margin: 0; }
.feature-chip { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; background: #fff; border: 1px solid var(--ui-border); border-radius: 1rem; }
.feature-chip i { color: var(--ui-primary); }
.timeline-list { display: grid; gap: 1rem; }
.timeline-list > div { display: flex; gap: .9rem; align-items: flex-start; }
.timeline-list span { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: #edf3ff; color: var(--ui-primary); font-weight: 700; flex-shrink: 0; }
.info-list { display: grid; gap: 1rem; }
.info-list > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .9rem; border-bottom: 1px dashed var(--ui-border); }
.info-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list span { color: var(--ui-muted); }
.security-list { padding-left: 1.1rem; }
.security-list li { margin-bottom: .65rem; }

.table-modern thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ui-muted); border-bottom-width: 1px; background: #f9fbff; }
.table-modern td, .table-modern th { padding: .95rem 1rem; }
.form-control, .form-select, .input-group-text { border-color: var(--ui-border); min-height: 48px; }
.form-control:focus, .form-select:focus { border-color: #b2c8ff; box-shadow: 0 0 0 .2rem rgba(47,97,216,.15); }
.btn-primary { background: var(--ui-primary); border-color: var(--ui-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--ui-primary-dark); border-color: var(--ui-primary-dark); }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { padding: 1rem; }
  .main-content { width: 100%; margin-left: 0; }
  .sidebar {
    transform: translateX(-100%); transition: transform .25s ease; width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); opacity: 0; visibility: hidden;
    transition: .25s ease; z-index: 1035;
  }
  .sidebar-backdrop.show { opacity: 1; visibility: visible; }
  .topbar { padding: 1rem; height: auto; min-height: 78px; }
  .content-area { padding: 1rem; }
  .topbar-user { display: none; }
}

@media (max-width: 575.98px) {
  .page-title { font-size: 1.25rem; }
  .panel-card-body, .panel-card-header, .stat-card { padding: 1rem; }
  .auth-card .card-body { padding: 1.5rem !important; }
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem;
  background: linear-gradient(135deg, #3c6df0 0%, #274cb4 100%);
  color: #fff;
}
.hero-panel h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.08; margin: .9rem 0 .75rem; }
.hero-panel p { margin: 0; color: rgba(255,255,255,.88); max-width: 52rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .55rem; background: rgba(255,255,255,.16);
  color: #fff; padding: .55rem .95rem; border-radius: 999px; font-weight: 700;
}
.hero-chart-card {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 1.25rem; padding: 1rem;
}
.mini-chart { height: 170px; display: flex; align-items: end; gap: .6rem; }
.mini-chart span {
  display: block; flex: 1; border-radius: 999px 999px .45rem .45rem; background: rgba(255,255,255,.95);
  min-height: 20%;
}
.hero-chart-card small { display: block; margin-top: .75rem; color: rgba(255,255,255,.8); }
.text-bg-success-subtle { background: #e8fff1; }
.text-bg-danger-subtle { background: #ffecef; }
.text-success-emphasis { color: #0f8a49; }
.text-danger-emphasis { color: #b42318; }
@media (max-width: 767.98px) {
  .hero-panel { grid-template-columns: 1fr; padding: 1.25rem; }
}


.module-tabs-wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.module-tabs, .module-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.module-tab {
  display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1rem; border-radius: 1rem;
  background: #fff; border: 1px solid var(--ui-border); color: var(--ui-text); font-weight: 600;
  box-shadow: 0 10px 30px rgba(30,64,175,.05);
}
.module-tab:hover { border-color: #c8d8ff; color: var(--ui-primary); }
.module-tab:hover i { color: inherit; }
.module-tab.active,
.module-tab.active:hover,
.module-tab.active:focus,
.module-tab.active:visited {
  background: linear-gradient(135deg, #3c6df0 0%, #274cb4 100%); border-color: transparent; color: #fff !important;
}
.module-tab.active i,
.module-tab.active:hover i,
.module-tab.active:focus i {
  color: #fff !important;
}
.module-tab.soft { background: #f9fbff; }
.employee-card {
  border: 1px solid var(--ui-border); border-radius: 1rem; overflow: hidden; background: #fff;
  box-shadow: 0 12px 30px rgba(30,64,175,.05);
}
.employee-card + .employee-card { margin-top: 1rem; }
.employee-card.inactive { background: #f8fafc; border-color: #dbe4f0; }
.employee-card .accordion-button {
  background: transparent; box-shadow: none; padding: 1.1rem 1.25rem;
}
.employee-card .accordion-button:not(.collapsed) {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6ff 100%); color: var(--ui-text);
}
.employee-card.inactive .accordion-button:not(.collapsed), .employee-card.inactive .accordion-button {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.employee-card .accordion-button::after { background-size: 1rem; }
.employee-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding-right: 1rem; }
.employee-name { font-weight: 700; font-size: 1rem; color: var(--ui-text); }
.employee-phone { color: var(--ui-muted); font-size: .92rem; }
.employee-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem 1.25rem; }
.employee-field { padding: .85rem 1rem; border: 1px solid var(--ui-border); border-radius: .9rem; background: #f9fbff; }
.employee-field span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ui-muted); margin-bottom: .35rem; }
.employee-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.empty-state { text-align: center; padding: 2.5rem 1.25rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-state i { font-size: 2rem; color: var(--ui-primary); }
.empty-state .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 220px; margin: 0 auto; }
.placeholder-box { border: 1px dashed #c9d7f2; border-radius: 1rem; padding: 1.25rem; background: #fbfcff; }
@media (max-width: 767.98px) {
  .module-tabs-wrap { gap: .85rem; }
  .module-tabs, .module-actions { width: 100%; }
  .module-tab { flex: 1 1 calc(50% - .75rem); justify-content: center; }
  .employee-grid { grid-template-columns: 1fr; }
  .employee-summary { flex-direction: column; align-items: flex-start; padding-right: 0; }
}


.settings-tabs-spacer { margin-bottom: 1.25rem; }
.module-actions .module-tab.active,
.module-actions .module-tab.active:hover,
.module-actions .module-tab.active:focus,
.module-actions .module-tab.active:visited {
  background: linear-gradient(135deg, #3c6df0 0%, #274cb4 100%);
  border-color: transparent;
  color: #fff !important;
}
.module-actions .module-tab.active i,
.module-actions .module-tab.active:hover i,
.module-actions .module-tab.active:focus i,
.module-actions .module-tab.active:visited i {
  color: #fff !important;
  opacity: 1;
}
.empty-state .btn-add-first-employee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
}
.empty-state .btn-add-first-employee i {
  color: #fff;
  font-size: 1rem;
  filter: brightness(1.25);
}


.attendance-tools .form-select { min-width: 92px; }
.attendance-filter-form { margin: 0; }
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .75rem;
}
.attendance-weekdays div {
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ui-muted);
}
.attendance-calendar-days { margin-top: .75rem; }
.attendance-day {
  min-height: 88px;
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
  background: #f9fbff;
  padding: .85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ui-text);
  transition: .2s ease;
}
.attendance-day:hover { border-color: #b9cfff; transform: translateY(-1px); color: var(--ui-primary); }
.attendance-day.active {
  background: linear-gradient(135deg, #3c6df0 0%, #274cb4 100%);
  border-color: transparent;
  color: #fff;
}
.attendance-day.active small { color: rgba(255,255,255,.86); }
.attendance-day.muted { background: transparent; border: 1px dashed #e5eaf4; min-height: 88px; }
.attendance-day-number { font-size: 1.15rem; font-weight: 800; }
.attendance-day small { color: var(--ui-muted); font-size: .78rem; }
.attendance-legend { display: flex; gap: .75rem; flex-wrap: wrap; color: var(--ui-muted); font-size: .92rem; }
.attendance-legend span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  background: #f8fbff;
  border: 1px solid var(--ui-border);
}
.attendance-table-wrap { overflow-x: auto; }
.attendance-table td, .attendance-table th { vertical-align: middle; }
.shift-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  padding: .45rem .8rem;
  background: #fff;
  min-width: 126px;
}
.shift-check input { width: 1rem; height: 1rem; }
.shift-check.lunch { background: #fffaf0; }
.shift-check.dinner { background: #f8f7ff; }
.attendance-total-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border-radius: 999px;
  padding: .42rem .7rem;
  font-size: .84rem;
  font-weight: 700;
}
.attendance-total-badge.worked { background: #e8fff1; color: #0f8a49; }
.attendance-total-badge.off { background: #eef2f7; color: #64748b; }
.empty-state.compact { padding: 1.5rem 1rem; }

@media (max-width: 991.98px) {
  .attendance-calendar-grid { gap: .5rem; }
  .attendance-day { min-height: 78px; padding: .7rem; }
}

@media (max-width: 767.98px) {
  .attendance-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attendance-weekdays { display: none; }
  .attendance-day { min-height: 86px; }
  .shift-check { min-width: 110px; padding: .4rem .6rem; }
}


.employee-toggle-box {
  min-height: 72px;
  padding: .9rem 1rem;
  border: 1px solid var(--ui-border);
  border-radius: .9rem;
  background: #f9fbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.employee-toggle-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.employee-toggle-title {
  display: block;
  margin: 0;
  color: var(--ui-text);
  font-weight: 700;
  cursor: pointer;
}
.employee-toggle-copy small {
  color: var(--ui-muted);
  line-height: 1.35;
}
.employee-inline-switch {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.employee-inline-switch .form-check-input {
  width: 2.9rem;
  height: 1.55rem;
  margin: 0;
  float: none;
  cursor: pointer;
}
.employee-inline-switch .form-check-label {
  display: none;
}


@media (max-width: 767.98px) {
  .employee-toggle-box {
    align-items: flex-start;
    flex-direction: column;
  }
}


.supplier-products-wrap { margin-top: 1.5rem; }
.supplier-products-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.85rem; flex-wrap:wrap; }
.supplier-products-table-wrap { overflow-x:auto; }
.supplier-products-table td, .supplier-products-table th { vertical-align: middle; }
.supplier-summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; width:100%; padding-right:1rem; }
.supplier-meta { color: var(--ui-muted); font-size:.92rem; }
.supplier-item-inline-form { border:1px solid var(--ui-border); border-radius:1rem; background:#fbfcff; padding:1rem; margin-top:1rem; }
.supplier-card { border:1px solid var(--ui-border); border-radius:1rem; overflow:hidden; background:#fff; box-shadow: 0 12px 30px rgba(30,64,175,.05); }
.supplier-card + .supplier-card { margin-top:1rem; }
.supplier-card.inactive { background:#f8fafc; border-color:#dbe4f0; }
.supplier-card .accordion-button { background: transparent; box-shadow:none; padding:1.1rem 1.25rem; }
.supplier-card .accordion-button:not(.collapsed) { background: linear-gradient(180deg, #f8fbff 0%, #f2f6ff 100%); color: var(--ui-text); }
.supplier-card.inactive .accordion-button:not(.collapsed), .supplier-card.inactive .accordion-button { background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%); }
.supplier-card .accordion-button::after { background-size:1rem; }
@media (max-width: 767.98px) { .supplier-summary { flex-direction:column; align-items:flex-start; padding-right:0; } }

.menu-summary-badges { display:flex; gap:.6rem; flex-wrap:wrap; }
.recipe-lines-box { border:1px solid #e5ebf7; border-radius:1rem; padding:1rem; background:#fcfdff; }
.menu-lines-table td, .menu-lines-table th { vertical-align: middle; }
.recipe-footer-summary { display:flex; justify-content:flex-end; }
.summary-chip {
  display:inline-flex;
  align-items:center;
  gap:.8rem;
  padding:.75rem 1rem;
  border-radius:999px;
  background:#edf4ff;
  border:1px solid #d4e2ff;
}
.recipe-summary-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:1rem; }
@media (max-width: 991.98px) {
  .recipe-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .recipe-summary-grid { grid-template-columns: 1fr; }
  .summary-chip { width:100%; justify-content:space-between; border-radius:1rem; }
}


.menu-lines-table { table-layout: fixed; width: 100%; }
.menu-lines-table th, .menu-lines-table td { vertical-align: middle; }
.menu-lines-table .menu-col-group { width: 26%; min-width: 0 !important; }
.menu-lines-table .menu-col-item { width: 34%; min-width: 0 !important; }
.menu-lines-table .menu-col-qty { width: 10%; min-width: 0 !important; }
.menu-lines-table .menu-col-money { width: 12%; min-width: 0 !important; }
.menu-lines-table .menu-col-actions { width: 6%; min-width: 0 !important; text-align: right; }
.menu-lines-table .menu-cell-group,
.menu-lines-table .menu-cell-item,
.menu-lines-table .menu-cell-qty { min-width: 0; }
.menu-lines-table .recipe-line-group,
.menu-lines-table .recipe-line-item,
.menu-lines-table .recipe-line-quantity { width: 100%; min-width: 0; }
.menu-lines-table .recipe-line-item option,
.menu-lines-table .recipe-line-group option { white-space: normal; }
.menu-lines-table .menu-cell-money { white-space: nowrap; }
.menu-lines-table .menu-cell-actions { text-align: right; white-space: nowrap; }
.menu-lines-table .remove-recipe-line { padding-inline: .55rem; }

@media (max-width: 991.98px) {
  .menu-lines-table { table-layout: auto; min-width: 760px; }
}
