/* DoliServe 0.7.1 — native Dolibarr sidebar, white phone-first workspace */
:root{
  --ds-bg:#ffffff;
  --ds-soft:#f7f7f5;
  --ds-soft2:#f0efec;
  --ds-text:#252522;
  --ds-muted:#77736c;
  --ds-faint:#9d9890;
  --ds-line:#e4e1db;
  --ds-line2:#d8d4cc;
  --ds-accent:#c96f4f;
  --ds-accent-soft:#f8eee9;
  --ds-green:#6f9278;
  --ds-green-soft:#edf4ef;
  --ds-red:#b95f5a;
  --ds-red-soft:#faefee;
}

.ds-native-page{max-width:1500px;background:#fff;color:var(--ds-text);padding-bottom:26px}
.ds-native-page *{box-sizing:border-box}

.ds-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:6px 0 18px}
.ds-page-head-copy{min-width:0}
.ds-kicker{font-size:9px;color:var(--ds-accent);text-transform:uppercase;letter-spacing:.12em;font-weight:800;margin-bottom:5px}
.ds-page-head h1{font-size:28px!important;line-height:1.05!important;letter-spacing:-.03em;margin:0!important;color:var(--ds-text)!important}
.ds-page-head p{margin:7px 0 0;color:var(--ds-muted);font-size:11px;line-height:1.5;max-width:720px}
.ds-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}

.ds-btn,.ds-native-page .button.ds-btn{min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:8px!important;border:1px solid var(--ds-line2)!important;background:#fff!important;color:var(--ds-text)!important;text-decoration:none!important;box-shadow:none!important;font-size:11px;font-weight:700;cursor:pointer;margin:0!important}
.ds-btn:hover{background:var(--ds-soft)!important}
.ds-btn.primary{background:var(--ds-text)!important;color:#fff!important;border-color:var(--ds-text)!important}
.ds-btn.accent{background:var(--ds-accent)!important;color:#fff!important;border-color:var(--ds-accent)!important}
.ds-btn.danger{background:var(--ds-red-soft)!important;color:#9f4b47!important;border-color:#ecd2d0!important}

.ds-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:15px}
.ds-stat{background:#fff;border:1px solid var(--ds-line);border-radius:10px;padding:12px 13px}
.ds-stat span{display:block;color:var(--ds-muted);font-size:9px;margin-bottom:6px}
.ds-stat strong{display:block;font-size:20px;line-height:1;font-weight:750;color:var(--ds-text)}
.ds-stat small{display:block;color:var(--ds-faint);font-size:8px;margin-top:4px}

.ds-chip-row{display:flex;gap:6px;overflow:auto;scrollbar-width:none;margin-bottom:12px}
.ds-chip-row::-webkit-scrollbar{display:none}
.ds-chip{flex:0 0 auto;min-height:34px;display:inline-flex;align-items:center;padding:0 11px;border:1px solid var(--ds-line);border-radius:999px;background:#fff;color:#625e57!important;text-decoration:none!important;font-size:10px;font-weight:700}
.ds-chip.active{background:var(--ds-text);color:#fff!important;border-color:var(--ds-text)}

.ds-table-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.ds-table-card{background:#fff;border:1px solid var(--ds-line);border-radius:11px;padding:13px;min-height:160px;display:flex;flex-direction:column}
.ds-table-card.busy{border-color:#e1c4b8}
.ds-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ds-status{display:flex;align-items:center;gap:6px;font-size:9px;font-weight:750;color:var(--ds-muted)}
.ds-status-dot{width:7px;height:7px;border-radius:50%;background:var(--ds-green)}
.ds-table-card.busy .ds-status-dot{background:var(--ds-accent)}
.ds-card-id{font:700 8px ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ds-faint)}
.ds-table-name{font-size:24px;font-weight:780;letter-spacing:-.03em;margin:16px 0 10px;color:var(--ds-text)}
.ds-card-info{display:flex;gap:18px;min-height:34px;margin-bottom:11px}
.ds-card-info div{display:flex;flex-direction:column;gap:2px}
.ds-card-info strong{font-size:13px}
.ds-card-info span{font-size:8px;color:var(--ds-muted);text-transform:uppercase}
.ds-card-empty{font-size:10px;color:var(--ds-muted)}
.ds-card-actions{display:flex;gap:7px;margin-top:auto}
.ds-card-actions .ds-btn{flex:1}

.ds-searchbar{display:flex;gap:7px;margin-bottom:11px}
.ds-searchbar input{flex:1;min-width:0;min-height:40px!important;border:1px solid var(--ds-line2)!important;border-radius:8px!important;background:#fff!important;color:var(--ds-text)!important;padding:0 11px!important;font-size:13px!important;box-shadow:none!important}

.ds-product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.ds-product-card{position:relative;text-align:left;min-height:126px;padding:12px;border:1px solid var(--ds-line);border-radius:10px;background:#fff;color:var(--ds-text);cursor:pointer;display:flex;flex-direction:column}
.ds-product-card:hover{background:#fdfdfc;border-color:#d4d0c8}
.ds-product-ref{font:700 8px ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--ds-faint);margin-bottom:6px}
.ds-product-card strong{font-size:12px;line-height:1.25}
.ds-product-card small{font-size:8px;color:var(--ds-muted);margin-top:4px}
.ds-product-price{margin-top:auto;font-size:11px;font-weight:750}
.ds-product-add{position:absolute;right:9px;bottom:9px;width:26px;height:26px;border-radius:7px;background:var(--ds-soft);display:grid;place-items:center;font-size:16px}

.ds-product-list{border:1px solid var(--ds-line);border-radius:10px;overflow:hidden;background:#fff}
.ds-product-row{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(120px,.6fr) 100px auto;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--ds-line)}
.ds-product-row:last-child{border-bottom:0}
.ds-product-row strong{font-size:12px}
.ds-product-row small{display:block;color:var(--ds-muted);font-size:8px;margin-top:3px}
.ds-product-category{font-size:9px;color:var(--ds-muted)}
.ds-product-money{font-size:10px;font-weight:750}

.ds-form-card{background:#fff;border:1px solid var(--ds-line);border-radius:10px;padding:15px;max-width:820px}
.ds-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.ds-field{display:flex;flex-direction:column;gap:5px}
.ds-field.full{grid-column:1/-1}
.ds-field label{font-size:9px;color:var(--ds-muted);font-weight:750;text-transform:uppercase}
.ds-field input,.ds-field select,.ds-field textarea{width:100%;min-height:42px!important;border:1px solid var(--ds-line2)!important;border-radius:8px!important;background:#fff!important;color:var(--ds-text)!important;padding:8px 10px!important;font-size:13px!important;box-shadow:none!important}
.ds-field textarea{min-height:90px!important}
.ds-form-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:13px}

.ds-order-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:11px}
.ds-order-catalog{min-width:0}
.ds-cart{position:sticky;top:10px;align-self:start;background:#fff;border:1px solid var(--ds-line);border-radius:10px;overflow:hidden;max-height:calc(100vh - 160px);display:flex;flex-direction:column}
.ds-cart-head{display:flex;justify-content:space-between;align-items:center;padding:12px;border-bottom:1px solid var(--ds-line)}
.ds-cart-head span{display:block;color:var(--ds-muted);font-size:8px;text-transform:uppercase}
.ds-cart-head strong{display:block;margin-top:2px;font-size:13px}
.ds-cart-close{display:none}
.ds-cart-lines{overflow:auto;padding:2px 11px}
.ds-cart-line{display:grid;grid-template-columns:minmax(0,1fr) auto auto 22px;gap:7px;align-items:center;padding:9px 0;border-bottom:1px solid var(--ds-line)}
.ds-cart-line-main strong{display:block;font-size:10px}
.ds-cart-qty{display:flex;align-items:center;border:1px solid var(--ds-line);border-radius:7px;overflow:hidden}
.ds-cart-qty button{width:27px;height:28px;border:0;background:#fff;font-size:15px}
.ds-cart-qty span{min-width:24px;text-align:center;font-size:10px;font-weight:700}
.ds-cart-price{font-size:9px;font-weight:750;white-space:nowrap}
.ds-cart-remove{width:22px;height:22px;border:0;background:transparent;color:var(--ds-muted);font-size:17px}
.ds-cart-empty{text-align:center;padding:36px 16px}
.ds-cart-empty strong{display:block;font-size:12px}
.ds-cart-empty span{display:block;color:var(--ds-muted);font-size:8px;margin-top:4px}
.ds-cart-total{display:flex;align-items:center;justify-content:space-between;padding:11px 12px;border-top:1px solid var(--ds-line);margin-top:auto}
.ds-cart-total span{font-size:9px;color:var(--ds-muted)}
.ds-cart-total strong{font-size:15px}
.ds-cart-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:0 12px 12px}
.ds-cart-fab{display:none}

.ds-kitchen-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ds-kitchen-card{border:1px solid var(--ds-line);border-radius:10px;overflow:hidden;background:#fff}
.ds-kitchen-head{display:flex;justify-content:space-between;gap:8px;padding:11px;border-bottom:1px solid var(--ds-line)}
.ds-kitchen-head span{font-size:8px;color:var(--ds-muted)}
.ds-kitchen-head strong{font-size:15px}
.ds-kitchen-lines{padding:3px 11px}
.ds-kitchen-line{display:grid;grid-template-columns:32px 1fr;gap:6px;padding:8px 0;border-bottom:1px solid var(--ds-line);font-size:10px}
.ds-kitchen-line .qty{font-weight:800;color:var(--ds-accent)}
.ds-kitchen-actions{display:flex;gap:7px;padding:10px 11px;border-top:1px solid var(--ds-line)}
.ds-kitchen-actions .ds-btn{flex:1}

.ds-table-admin-list{background:#fff;border:1px solid var(--ds-line);border-radius:10px;overflow:hidden}
.ds-table-admin-row{display:grid;grid-template-columns:55px minmax(150px,1fr) 75px 110px auto;gap:10px;align-items:center;padding:9px 11px;border-bottom:1px solid var(--ds-line)}
.ds-table-admin-row.header{background:#fafaf9;color:var(--ds-muted);font-size:8px;text-transform:uppercase;font-weight:750}
.ds-table-admin-row input{min-height:36px!important;border:1px solid var(--ds-line2)!important;border-radius:7px!important;background:#fff!important;color:var(--ds-text)!important;padding:0 8px!important}
.ds-badge{display:inline-flex;align-items:center;min-height:23px;padding:0 7px;border-radius:999px;font-size:8px;font-weight:750}
.ds-badge.free{background:var(--ds-green-soft);color:#56725d}
.ds-badge.busy{background:var(--ds-accent-soft);color:#a25b42}

.ds-empty{background:#fff;border:1px dashed var(--ds-line2);border-radius:10px;padding:36px 16px;text-align:center}
.ds-empty h3{margin:0 0 5px!important;font-size:14px!important}
.ds-empty p{margin:0 0 13px;color:var(--ds-muted);font-size:9px}

.ds-toast{position:fixed;left:50%;bottom:24px;z-index:300;transform:translate(-50%,20px);opacity:0;background:#252522;color:#fff;padding:8px 11px;border-radius:8px;font-size:9px;transition:.18s ease}
.ds-toast.show{opacity:1;transform:translate(-50%,0)}
.ds-mobile-nav{display:none}
body.ds-order-busy:after{content:"";position:fixed;inset:0;z-index:220;background:rgba(255,255,255,.35);cursor:progress}

/* Force DoliServe content white even under dark Dolibarr theme */
.ds-native-page,
.ds-native-page input,
.ds-native-page select,
.ds-native-page textarea{color-scheme:light}
.ds-native-page{background:#fff!important;color:var(--ds-text)!important}

@media(max-width:1100px){
  .ds-table-grid,.ds-product-grid{grid-template-columns:repeat(3,1fr)}
  .ds-kitchen-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:760px){
  .ds-native-page{padding-bottom:78px}
  .ds-page-head{flex-direction:column;align-items:stretch;gap:10px}
  .ds-page-head h1{font-size:23px!important}
  .ds-actions{display:grid;grid-template-columns:1fr 1fr;justify-content:stretch}
  .ds-actions .ds-btn{min-height:44px}
  .ds-stat-grid{grid-template-columns:1fr 1fr;gap:7px}
  .ds-stat{padding:10px}
  .ds-stat strong{font-size:17px}
  .ds-chip-row{position:sticky;top:0;z-index:30;background:rgba(255,255,255,.96);padding:7px 0;margin-bottom:8px}
  .ds-chip{min-height:38px}
  .ds-table-grid{grid-template-columns:1fr}
  .ds-table-card{min-height:145px}
  .ds-table-name{font-size:22px;margin:13px 0 9px}
  .ds-card-actions .ds-btn{min-height:45px}
  .ds-searchbar{position:sticky;top:0;z-index:31;background:rgba(255,255,255,.96);padding:7px 0}
  .ds-searchbar input{min-height:44px!important;font-size:16px!important}
  .ds-product-grid{grid-template-columns:1fr 1fr;gap:7px}
  .ds-product-card{min-height:120px;padding:10px}
  .ds-product-row{grid-template-columns:minmax(0,1fr) auto}
  .ds-product-row .ds-product-category{display:none}
  .ds-product-row .ds-btn{grid-column:1/-1;min-height:42px}
  .ds-form-grid{grid-template-columns:1fr}
  .ds-field.full{grid-column:auto}
  .ds-field input,.ds-field select,.ds-field textarea{font-size:16px!important}
  .ds-form-actions{display:grid;grid-template-columns:1fr 1fr}
  .ds-form-actions .ds-btn{min-height:45px}
  .ds-order-layout{display:block}
  .ds-cart{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:180;max-height:82dvh;border-radius:17px 17px 0 0;border-bottom:0;transform:translateY(105%);transition:.22s ease;box-shadow:0 -14px 40px rgba(32,29,24,.15);padding-bottom:env(safe-area-inset-bottom)}
  .ds-cart.open{transform:translateY(0)}
  .ds-cart-close{display:grid;place-items:center;width:31px;height:31px;border:1px solid var(--ds-line);border-radius:7px;background:#fff;font-size:16px}
  .ds-cart-line{grid-template-columns:minmax(0,1fr) auto 22px}
  .ds-cart-price{grid-column:1;color:var(--ds-muted)}
  .ds-cart-actions{grid-template-columns:1fr}
  .ds-cart-actions .ds-btn{min-height:45px}
  .ds-cart-fab{position:fixed;left:10px;right:10px;bottom:calc(67px + env(safe-area-inset-bottom));z-index:120;min-height:50px;border:0;border-radius:12px;background:var(--ds-text);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 14px;font-size:10px;font-weight:800;box-shadow:0 9px 25px rgba(35,31,26,.16)}
  .ds-kitchen-grid{grid-template-columns:1fr}
  .ds-kitchen-actions .ds-btn{min-height:44px}
  .ds-table-admin-row{grid-template-columns:44px minmax(0,1fr) auto}
  .ds-table-admin-row.header{display:none}
  .ds-table-admin-row>:nth-child(3),.ds-table-admin-row>:nth-child(4){display:none}
  .ds-table-admin-row>:last-child{grid-column:1/-1;display:flex;justify-content:flex-end}
  .ds-table-admin-row input{min-height:42px!important;font-size:16px!important}

  .ds-mobile-nav{
    position:fixed;left:0;right:0;bottom:0;z-index:150;
    display:grid;grid-template-columns:repeat(4,1fr);
    background:rgba(255,255,255,.98);border-top:1px solid var(--ds-line);
    padding:5px 6px calc(5px + env(safe-area-inset-bottom));
    backdrop-filter:blur(14px)
  }
  .ds-mobile-nav a{min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:9px;color:var(--ds-muted)!important;text-decoration:none!important}
  .ds-mobile-nav a>span{font-size:16px}
  .ds-mobile-nav small{font-size:8px;font-weight:700}
  .ds-mobile-nav a.active{background:var(--ds-soft);color:var(--ds-text)!important}
  .ds-toast{bottom:calc(132px + env(safe-area-inset-bottom))}
}


/* 0.8.0 CRUD additions */
.ds-product-row-actions{
  grid-template-columns:minmax(0,1.55fr) minmax(120px,.65fr) minmax(120px,.55fr) auto;
}
.ds-row-actions{display:flex;align-items:center;gap:6px;justify-content:flex-end}
.ds-row-actions form{margin:0}
.ds-checkbox-row{
  display:flex!important;
  flex-direction:row!important;
  align-items:center;
  gap:8px!important;
  min-height:42px;
  padding:0 2px;
  text-transform:none!important;
  letter-spacing:0!important;
  font-size:12px!important;
  color:var(--ds-text)!important;
}
.ds-checkbox-row input{width:18px!important;height:18px!important;min-height:0!important;padding:0!important}

@media(max-width:760px){
  .ds-product-row-actions{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .ds-product-row-actions .ds-product-category{display:none}
  .ds-product-row-actions .ds-product-money{grid-column:2;grid-row:1}
  .ds-product-row-actions .ds-row-actions{
    grid-column:1/-1;
    justify-content:stretch;
  }
  .ds-product-row-actions .ds-row-actions .ds-btn,
  .ds-product-row-actions .ds-row-actions form,
  .ds-product-row-actions .ds-row-actions form .ds-btn{
    flex:1;
    width:100%;
    min-height:42px;
  }
}


/* 0.8.1 — EN / ΕΛ language switch */
.ds-lang-switch{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:3px;
  border:1px solid var(--ds-line2);
  border-radius:9px;
  background:#fff;
}
.ds-lang-switch a{
  min-width:34px;
  min-height:31px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  color:var(--ds-muted)!important;
  text-decoration:none!important;
  font-size:10px;
  font-weight:800;
  line-height:1;
}
.ds-lang-switch a:hover{
  background:var(--ds-soft);
  color:var(--ds-text)!important;
}
.ds-lang-switch a.active{
  background:var(--ds-text);
  color:#fff!important;
}

@media(max-width:760px){
  .ds-lang-switch{
    justify-self:end;
  }
  .ds-lang-switch a{
    min-width:42px;
    min-height:38px;
    font-size:11px;
  }
}

/* DoliServe 0.9 — kitchen printing */
.ds-section-title{margin:8px 0 1px;padding-top:10px;border-top:1px solid var(--ds-line);color:var(--ds-text);font-size:12px;font-weight:800;text-transform:none;letter-spacing:0}
.ds-kitchen-send{display:flex;flex-direction:column;gap:6px;padding:11px 12px;border-top:1px solid var(--ds-line);background:#fff}
.ds-kitchen-send label{color:var(--ds-muted);font-size:9px;font-weight:750;text-transform:uppercase;letter-spacing:.05em}
.ds-kitchen-send textarea{width:100%;min-height:56px;max-height:110px;resize:vertical;padding:8px 9px;border:1px solid var(--ds-line2);border-radius:8px;background:#fff;color:var(--ds-text);font:inherit;font-size:11px;box-shadow:none}
.ds-kitchen-send .ds-btn{min-height:42px}
@media(max-width:760px){.ds-kitchen-send textarea{min-height:62px;font-size:16px}.ds-kitchen-send .ds-btn{min-height:48px}}


/* DoliServe 0.11 — cloud printing */
.ds-printer-select{
  width:100%;
  min-height:42px;
  padding:8px 10px;
  border:1px solid var(--ds-line2);
  border-radius:8px;
  background:#fff;
  color:var(--ds-text);
  font:inherit;
}
.ds-status-box{
  min-height:48px;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:9px 10px;
  border:1px solid var(--ds-line2);
  border-radius:8px;
  background:#fff;
  font-size:11px;
}
.ds-status-box.muted{
  color:var(--ds-muted);
  justify-content:center;
}
.ds-cloud-stats{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.ds-cloud-stats span{
  padding:7px 9px;
  border:1px solid var(--ds-line2);
  border-radius:8px;
  background:#fff;
  color:var(--ds-muted);
  font-size:10px;
}
.ds-cloud-stats b{
  color:var(--ds-text);
}


/* v0.12.0 — custom restaurant areas + bulk table management */
.ds-management-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:12px}
.ds-form-card-wide{grid-column:1/-1;max-width:none}
.ds-form-section-title,.ds-section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px}
.ds-form-section-title div,.ds-section-heading div{display:grid;gap:2px}
.ds-form-section-title span,.ds-section-heading span{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:var(--ds-muted);font-weight:750}
.ds-form-section-title strong,.ds-section-heading strong{font-size:16px;color:var(--ds-text)}
.ds-form-section-title small,.ds-section-heading small,.ds-field small{color:var(--ds-muted);font-size:10px;line-height:1.45}
.ds-form-grid-three{grid-template-columns:2fr 1fr 1fr}
.ds-bulk-divider{display:flex;align-items:center;gap:10px;margin:13px 0;color:var(--ds-muted);font-size:9px;text-transform:uppercase;font-weight:750;letter-spacing:.06em}
.ds-bulk-divider:before,.ds-bulk-divider:after{content:"";height:1px;background:var(--ds-line);flex:1}
.ds-area-manager{background:#fff;border:1px solid var(--ds-line);border-radius:10px;padding:15px;margin-bottom:12px}
.ds-area-manager .ds-chip-row{margin-bottom:10px}
.ds-area-edit-row{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;border-top:1px solid var(--ds-line);padding-top:10px}
.ds-area-edit-row form:first-child{display:grid;grid-template-columns:auto minmax(180px,360px) auto;align-items:center;gap:7px}
.ds-area-edit-row label{font-size:10px;font-weight:700;color:var(--ds-muted)}
.ds-area-edit-row input{min-height:38px!important;border:1px solid var(--ds-line2)!important;border-radius:7px!important;padding:0 9px!important}
@media(max-width:760px){
  .ds-management-grid{grid-template-columns:1fr}
  .ds-form-card-wide{grid-column:auto}
  .ds-form-grid-three{grid-template-columns:1fr}
  .ds-form-section-title,.ds-section-heading{display:grid;gap:5px}
  .ds-area-edit-row{display:grid;align-items:stretch}
  .ds-area-edit-row form:first-child{grid-template-columns:1fr auto}
  .ds-area-edit-row form:first-child label{grid-column:1/-1}
  .ds-area-edit-row input{font-size:16px!important}
  .ds-area-edit-row form:last-child .ds-btn{width:100%}
}
