:root { --sidebar-width: 292px; }
* { box-sizing: border-box; }
body { font-family: 'Tajawal', Tahoma, Arial, sans-serif; font-weight:400; background: #f8fafc; color: #1f2937; }
.admin-shell { min-height: 100vh; display: flex; direction: rtl; }
.admin-sidebar { width: var(--sidebar-width); background: linear-gradient(180deg,#111827,#0f172a); color: #fff; position: fixed; top:0; bottom:0; right:0; padding: 20px 16px; overflow-y:auto; z-index: 30; box-shadow: -10px 0 30px rgba(15,23,42,.14); }
.admin-main { margin-right: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); min-height: 100vh; }
.brand { display:flex; align-items:center; gap:12px; padding: 10px 8px 22px; border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:16px; }
.brand-logo { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; background:linear-gradient(135deg,#06b6d4,#2563eb); color:#fff; font-weight:900; }
.brand-title { font-size: 20px; font-weight: 800; }
.brand-subtitle { font-size: 12px; color:#94a3b8; margin-top:2px; }
.nav-section-title { color:#64748b; font-size:12px; padding:14px 12px 8px; }
.side-link { display:flex; align-items:center; gap:10px; padding: 11px 12px; color:#cbd5e1; border-radius:14px; margin-bottom:6px; text-decoration:none; transition:.15s; font-size:14px; }
.side-link:hover, .side-link.active { color:#fff; background:rgba(255,255,255,.1); }
.side-icon { width:28px; height:28px; display:grid; place-items:center; border-radius:10px; background:rgba(255,255,255,.08); }
.topbar { height:74px; background:#fff; border-bottom:1px solid #e5e7eb; display:flex; align-items:center; justify-content:space-between; padding:0 28px; position:sticky; top:0; z-index:20; }
.content-wrap { padding:28px; }
.page-title { font-size:30px; font-weight:900; color:#111827; margin:0; }
.page-subtitle { color:#64748b; margin-top:6px; }
.kpi-grid { display:grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap:18px; }
.kpi-card { background:#fff; border:1px solid #e5e7eb; border-radius:22px; padding:20px; box-shadow:0 12px 30px rgba(15,23,42,.06); }
.kpi-card .label { color:#64748b; font-size:13px; }
.kpi-card .value { font-size:34px; font-weight:900; margin-top:10px; color:#0f172a; }
.kpi-card .hint { font-size:12px; margin-top:10px; color:#94a3b8; }
.kpi-icon { width:48px; height:48px; border-radius:16px; display:grid; place-items:center; font-size:22px; background:#eff6ff; }
.cardx { background:#fff; border:1px solid #e5e7eb; border-radius:22px; box-shadow:0 12px 30px rgba(15,23,42,.06); }
.cardx-header { padding:18px 20px; border-bottom:1px solid #eef2f7; display:flex; justify-content:space-between; align-items:center; }
.cardx-body { padding:20px; }
.tablex { width:100%; border-collapse: separate; border-spacing:0 10px; }
.tablex th { color:#64748b; font-size:12px; font-weight:700; padding: 0 14px 8px; }
.tablex td { background:#fff; border-top:1px solid #eef2f7; border-bottom:1px solid #eef2f7; padding:14px; vertical-align:middle; }
.tablex td:first-child { border-right:1px solid #eef2f7; border-radius:0 16px 16px 0; }
.tablex td:last-child { border-left:1px solid #eef2f7; border-radius:16px 0 0 16px; }
.badge-soft { padding:6px 10px; border-radius:999px; font-size:12px; font-weight:800; display:inline-block; }
.badge-green { background:#dcfce7; color:#166534; }
.badge-red { background:#fee2e2; color:#991b1b; }
.badge-yellow { background:#fef3c7; color:#92400e; }
.badge-blue { background:#dbeafe; color:#1d4ed8; }
.btnx { border:0; border-radius:14px; padding:11px 16px; text-decoration:none; display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-weight:800; }
.btn-primaryx { background:#2563eb; color:#fff; }
.btn-darkx { background:#111827; color:#fff; }
.btn-lightx { background:#f1f5f9; color:#0f172a; }
.form-card { max-width: 980px; }
.inputx, .selectx, .textareax { width:100%; border:1px solid #dbe3ef; background:#fff; border-radius:14px; padding:12px 14px; outline:none; }
.inputx:focus, .selectx:focus, .textareax:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.labelx { display:block; font-weight:800; margin-bottom:8px; color:#334155; font-size:13px; }
.quick-grid { display:grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap:14px; }
.quick-card { background:#fff; border:1px solid #e5e7eb; border-radius:20px; padding:16px; text-decoration:none; color:#0f172a; box-shadow:0 12px 30px rgba(15,23,42,.04); }
.quick-card:hover { transform: translateY(-2px); box-shadow:0 18px 40px rgba(15,23,42,.08); }
.alertx { padding:14px 16px; border-radius:16px; margin-bottom:18px; }
.alert-successx { background:#dcfce7; color:#166534; }
.alert-dangerx { background:#fee2e2; color:#991b1b; }
@media(max-width: 1100px){ .kpi-grid{grid-template-columns:repeat(2,1fr)} .quick-grid{grid-template-columns:repeat(2,1fr)} }
@media(max-width: 780px){ .admin-sidebar{position:relative;width:100%;height:auto}.admin-shell{display:block}.admin-main{margin-right:0;width:100%}.topbar{position:relative}.kpi-grid,.quick-grid{grid-template-columns:1fr}.content-wrap{padding:18px} }

input, select, textarea, button { font-family: 'Tajawal', Tahoma, Arial, sans-serif; }
strong, th, .btnx, .labelx, .brand-title, .page-title, .kpi-card .value { font-weight:700; }

/* Touch POS */
.touch-pos-grid { display:grid; grid-template-columns:minmax(0,1.25fr) 470px; gap:20px; align-items:start; }
.pos-category-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.pos-cat { border:0; border-radius:999px; padding:10px 14px; background:#f1f5f9; color:#0f172a; cursor:pointer; font-family:'Tajawal', Tahoma, Arial, sans-serif; font-weight:700; }
.pos-cat.active { background:#2563eb; color:#fff; }
.product-tile-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.product-tile { border:1px solid #e5e7eb; background:#fff; border-radius:20px; padding:14px; min-height:142px; cursor:pointer; text-align:right; transition:.15s; box-shadow:0 8px 20px rgba(15,23,42,.04); font-family:'Tajawal', Tahoma, Arial, sans-serif; }
.product-tile:hover { transform:translateY(-2px); border-color:#2563eb; box-shadow:0 16px 32px rgba(37,99,235,.14); }
.product-tile.is-disabled { opacity:.45; cursor:not-allowed; }
.tile-icon { width:42px; height:42px; border-radius:15px; display:grid; place-items:center; background:#dbeafe; color:#1d4ed8; font-weight:900; margin-bottom:12px; }
.tile-name { color:#0f172a; font-weight:800; min-height:40px; line-height:1.35; }
.tile-meta { display:flex; justify-content:space-between; gap:8px; color:#64748b; font-size:12px; margin-top:12px; }
.cart-panel { position:sticky; top:94px; }
.cart-lines { display:flex; flex-direction:column; gap:10px; min-height:180px; max-height:410px; overflow:auto; padding-left:4px; }
.empty-cart { border:1px dashed #cbd5e1; border-radius:18px; padding:32px 18px; text-align:center; color:#64748b; background:#f8fafc; }
.cart-line { display:grid; grid-template-columns:minmax(0,1fr) 116px 78px 34px; gap:8px; align-items:center; padding:10px; border:1px solid #eef2f7; border-radius:18px; background:#fff; }
.cart-product strong { display:block; font-size:14px; color:#0f172a; }
.cart-product span { display:block; font-size:12px; color:#64748b; margin-top:4px; }
.qty-control { display:grid; grid-template-columns:30px 1fr 30px; gap:4px; align-items:center; }
.qty-control button, .remove-line { border:0; border-radius:10px; background:#f1f5f9; color:#0f172a; cursor:pointer; height:32px; font-weight:900; }
.qty-control input { width:100%; height:32px; border:1px solid #e5e7eb; border-radius:10px; text-align:center; }
.line-total { font-weight:800; color:#0f172a; text-align:center; }
.remove-line { background:#fee2e2; color:#991b1b; }
.cart-summary { border-top:1px solid #eef2f7; margin-top:16px; padding-top:16px; }
.summary-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 0; color:#334155; }
.summary-row.total { font-size:22px; color:#0f172a; border-top:1px solid #eef2f7; margin-top:8px; padding-top:16px; }
.checkout-btn { width:100%; justify-content:center; margin-top:16px; font-size:17px; padding:15px; }
.checkout-btn:disabled { opacity:.5; cursor:not-allowed; }
@media(max-width: 1300px){ .touch-pos-grid{grid-template-columns:1fr}.cart-panel{position:relative;top:auto}.product-tile-grid{grid-template-columns:repeat(3,1fr)} }
@media(max-width: 780px){ .product-tile-grid{grid-template-columns:repeat(2,1fr)} .cart-line{grid-template-columns:1fr;}.line-total{text-align:right}.touch-pos-grid{gap:14px} }

*{font-family:'Tajawal',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-weight:400}.brand-title,.cardx-header strong,.btnx{font-weight:500}

/* Grouped collapsible sidebar */
.sidebar-groups { display:flex; flex-direction:column; gap:8px; }
.side-group { border:1px solid rgba(255,255,255,.06); border-radius:18px; background:rgba(255,255,255,.025); overflow:hidden; }
.side-group.is-active { background:rgba(37,99,235,.12); border-color:rgba(96,165,250,.22); }
.side-group-toggle { width:100%; border:0; outline:0; background:transparent; color:#e2e8f0; padding:11px 12px; display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; font-family:'Tajawal', Tahoma, Arial, sans-serif; font-weight:700; text-align:right; }
.side-group-toggle:hover { background:rgba(255,255,255,.07); color:#fff; }
.side-group-main { display:flex; align-items:center; gap:10px; min-width:0; }
.side-chevron { width:24px; height:24px; border-radius:8px; display:grid; place-items:center; color:#94a3b8; transition:.18s ease; transform:rotate(90deg); }
.side-group.is-open .side-chevron { transform:rotate(0deg); color:#fff; }
.side-submenu { display:none; padding:0 10px 10px; }
.side-group.is-open .side-submenu { display:block; }
.side-sublink { margin-bottom:4px; padding:9px 10px; font-size:13px; border-radius:13px; }
.side-icon.small { width:24px; height:24px; border-radius:8px; font-size:13px; background:rgba(255,255,255,.06); }
.side-sublink.active { background:rgba(59,130,246,.22); }
.side-group .side-link:hover { background:rgba(255,255,255,.09); }
