:root { --wine:#4a1025; --deep:#2b0c18; --rose:#ead1d8; --paper:#f6f3f1; --ink:#211b1d; --muted:#786e71; --line:#e6dfe1; --green:#43704e; --red:#b43d45; --amber:#ae7224; }
* { box-sizing: border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:"Alexandria",sans-serif; font-size:13px; }
button,input,select,textarea { font:inherit; } button,a { -webkit-tap-highlight-color:transparent; } button { cursor:pointer; } a { color:inherit; text-decoration:none; }
svg { fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
[hidden] { display:none !important; }
:focus-visible { outline:3px solid #c89843; outline-offset:2px; }

.login-screen { min-height:100vh; display:grid; grid-template-columns:1.1fr .9fr; background:#fff; }
.login-art { position:relative; overflow:hidden; background:var(--deep); color:white; padding:48px; display:flex; flex-direction:column; justify-content:space-between; }
.login-art::before { content:""; position:absolute; width:500px; height:500px; border:1px solid rgba(255,255,255,.1); border-radius:50%; left:-170px; top:-180px; }
.admin-wordmark { display:flex; flex-direction:column; line-height:1; position:relative; z-index:2; }
.admin-wordmark span { font:25px Georgia,serif; letter-spacing:.22em; color:#f2d5df; }
.admin-wordmark small { font-size:8px; color:#a9969d; margin-top:7px; }
.login-quote { position:relative; z-index:2; max-width:440px; }
.login-quote p { font:700 58px/1.12 "Aref Ruqaa",serif; margin:0 0 15px; }
.login-quote em { color:#deb066; font-style:normal; font-weight:400; }
.login-quote span { color:#bdadb3; font-size:11px; }
.login-art img { position:absolute; width:min(52vw,650px); left:-40px; bottom:-120px; opacity:.32; mix-blend-mode:screen; }
.login-card { width:min(400px,calc(100% - 48px)); margin:auto; display:flex; flex-direction:column; }
.kicker { color:var(--wine)!important; font-size:10px!important; font-weight:700; letter-spacing:.1em; }
.login-card h1 { font:700 48px "Aref Ruqaa",serif; color:var(--deep); margin:0; }
.login-card > p { color:var(--muted); font-size:11px; }
.login-card label { display:flex; flex-direction:column; gap:8px; margin-top:18px; }
.login-card label span,.drawer-fields label span,.drawer-status-row label span,.price-fields label span { font-size:10px; font-weight:600; color:#574d50; }
.login-card input,.drawer-fields input,.drawer-fields textarea,.drawer-status-row select,.price-fields input { min-height:50px; border:1px solid var(--line); border-radius:10px; padding:0 14px; background:#fff; }
.login-card input:focus,.drawer-fields input:focus,.drawer-fields textarea:focus,.drawer-status-row select:focus,.price-fields input:focus { outline:0; border-color:var(--wine); box-shadow:0 0 0 3px rgba(74,16,37,.08); }
.login-card button { border:0; border-radius:10px; min-height:54px; background:var(--wine); color:#fff; font-weight:600; margin-top:24px; display:flex; align-items:center; justify-content:center; gap:15px; }
.login-card > a { text-align:center; color:var(--muted); font-size:9px; margin-top:18px; }
.login-error,.drawer-error { color:var(--red)!important; min-height:18px; margin:8px 0 0!important; }

.admin-shell { min-height:100vh; display:grid; grid-template-columns:240px 1fr; }
.sidebar { background:var(--deep); color:white; padding:31px 20px; position:fixed; z-index:20; inset:0 0 0 auto; width:240px; display:flex; flex-direction:column; }
.sidebar .admin-wordmark { padding:0 13px 30px; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar nav { display:grid; gap:6px; margin-top:28px; }
.nav-item,.logout-button { border:0; background:transparent; color:#bdaeb4; display:flex; align-items:center; gap:12px; padding:12px 13px; border-radius:9px; text-align:right; font-size:11px; }
.nav-item svg,.logout-button svg { width:20px; }
.nav-item b { margin-inline-start:auto; background:#7d2947; color:white; min-width:19px; height:19px; border-radius:50%; display:grid; place-items:center; font-size:8px; }
.nav-item:hover,.nav-item.is-active { background:rgba(255,255,255,.09); color:white; }
.nav-item.is-active { box-shadow:inset -2px 0 #d9a450; }
.sidebar-status { margin-top:auto; display:flex; align-items:center; gap:10px; padding:12px; background:rgba(255,255,255,.06); border-radius:10px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:#b6792b; box-shadow:0 0 0 4px rgba(182,121,43,.13); flex:0 0 auto; }
.status-dot.online { background:#58a369; box-shadow:0 0 0 4px rgba(88,163,105,.13); }
.sidebar-status p { display:flex; flex-direction:column; margin:0; }
.sidebar-status strong { font-size:10px; }.sidebar-status small { color:#9e8f94; font-size:8px; }
.logout-button { margin-top:10px; width:100%; }

.admin-main { grid-column:2; padding:0 42px 60px; min-width:0; }
.admin-header { height:112px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); margin-bottom:32px; }
.admin-header p { color:var(--muted); font-size:9px; margin:0 0 2px; }.admin-header h1 { font:700 30px "Aref Ruqaa",serif; color:var(--deep); margin:0; }
.header-actions { display:flex; align-items:center; gap:10px; }.header-actions a,.header-actions button,.secondary-button { border:1px solid var(--line); background:#fff; border-radius:9px; padding:9px 13px; font-size:9px; }
.header-actions .primary-button { width:auto; min-height:auto; background:var(--wine); color:#fff; border-color:var(--wine); }
.header-actions button { padding:9px; }.header-actions svg,.secondary-button svg { width:17px; }.menu-button { display:none; }
.admin-view { display:none; }.admin-view.is-active { display:block; animation:fade .25s ease; } @keyframes fade { from{opacity:0;transform:translateY(5px)} }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:15px; }
.stat-card { background:white; border:1px solid var(--line); border-radius:15px; padding:22px; position:relative; overflow:hidden; display:flex; flex-direction:column; min-height:145px; }
.stat-card > span { color:var(--muted); font-size:9px; }.stat-card > strong { font-size:27px; color:var(--deep); margin:8px 0 auto; direction:ltr; text-align:right; }.stat-card > small { color:#93888b; font-size:8px; }.stat-card > svg { position:absolute; width:74px; height:74px; left:13px; bottom:10px; opacity:.05; }
.stat-card.accent { background:var(--wine); border-color:var(--wine); color:white; }.stat-card.accent > span,.stat-card.accent > small { color:#d8c4cb; }.stat-card.accent > strong { color:white; }.stat-card.accent > svg { opacity:.16; }
.overview-grid { display:grid; grid-template-columns:1.45fr .8fr; gap:18px; margin-top:20px; }
.panel { background:#fff; border:1px solid var(--line); border-radius:15px; padding:22px; }
.panel-heading { display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); padding-bottom:15px; margin-bottom:12px; }.panel-heading span { color:var(--muted); font-size:8px; }.panel-heading h2 { font-size:15px; margin:2px 0 0; }.panel-heading button { border:0; background:none; color:var(--wine); font-size:9px; }
.recent-order { display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid #f0ebed; cursor:pointer; }.recent-order:last-child{border:0}.order-avatar { width:38px;height:38px;border-radius:11px;background:var(--paper);display:grid;place-items:center;color:var(--wine);font-weight:700; }.recent-order p{margin:0;display:flex;flex-direction:column}.recent-order strong{font-size:10px}.recent-order span{font-size:8px;color:var(--muted)}.recent-order>strong{font-size:11px;color:var(--wine);direction:ltr}
.skeleton-row { height:55px; margin:8px 0; border-radius:10px; background:linear-gradient(90deg,#f4f0f1,#faf8f8,#f4f0f1); background-size:200%; animation:shimmer 1.2s infinite; } @keyframes shimmer{to{background-position:-200%}}
.status-chart { display:grid; gap:14px; padding-top:5px; }.status-row{display:grid;grid-template-columns:75px 1fr 25px;gap:10px;align-items:center;font-size:9px}.status-row span{color:var(--muted)}.status-row i{height:7px;border-radius:99px;background:#eee9ea;overflow:hidden}.status-row i::after{content:"";display:block;width:var(--value);height:100%;border-radius:inherit;background:var(--bar,var(--wine))}.status-row b{text-align:left;font-size:9px}

.toolbar { display:flex; gap:10px; margin-bottom:15px; }.search-box { flex:1; max-width:500px; position:relative; }.search-box svg{position:absolute;right:13px;top:50%;transform:translateY(-50%);width:18px;color:var(--muted)}.search-box input,.toolbar select{width:100%;min-height:43px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 41px 0 12px;font-size:10px}.toolbar select{width:170px;padding:0 12px}.secondary-button{display:flex;align-items:center;gap:7px;color:var(--wine)}
.orders-panel { padding:0; overflow:hidden; }.table-summary{padding:15px 20px;display:flex;justify-content:space-between;border-bottom:1px solid var(--line)}.table-summary span{font-size:10px;font-weight:600}.table-summary small{font-size:8px;color:var(--muted)}.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;min-width:950px;text-align:right}th{padding:12px 14px;background:#faf8f8;color:var(--muted);font-size:8px;font-weight:600;white-space:nowrap}td{padding:13px 14px;border-top:1px solid #f0ebed;font-size:9px;vertical-align:middle}tbody tr{cursor:pointer;transition:background .15s}tbody tr:hover{background:#fdf9fa}.customer-cell{display:flex;flex-direction:column}.customer-cell strong{font-size:9px}.customer-cell span{color:var(--muted);direction:ltr;text-align:right}.product-cell{display:flex;align-items:center;gap:8px}.product-cell img{width:34px;height:34px;border-radius:8px;object-fit:cover}.product-cell div{display:flex;flex-direction:column}.product-cell span{color:var(--muted);font-size:8px}.status-badge{display:inline-flex;padding:5px 8px;border-radius:99px;font-size:8px;font-weight:600;white-space:nowrap}.status-pending{background:#fff2d8;color:#986016}.status-confirmed{background:#e6eefc;color:#3d6499}.status-shipped{background:#eee6f7;color:#704d92}.status-delivered{background:#e3f2e6;color:#3d7448}.status-cancelled,.status-returned{background:#f7e4e5;color:#a13b43}.noest-chip{font-size:8px;color:var(--muted)}.noest-chip.sent{color:var(--green)}.row-action{border:0;background:none;color:var(--muted);font-size:18px}.empty-row{text-align:center!important;padding:50px!important;color:var(--muted)}.pagination{display:flex;justify-content:center;gap:5px;padding:15px;border-top:1px solid var(--line)}.pagination button{min-width:30px;height:30px;border:1px solid var(--line);background:white;border-radius:7px;font-size:9px}.pagination button.is-active{background:var(--wine);color:white}

.product-layout{display:grid;grid-template-columns:1fr 270px;gap:18px;align-items:start}.product-main{display:grid;gap:18px}.product-preview{display:flex;align-items:center;gap:18px}.product-preview img{width:110px;height:110px;object-fit:cover;border-radius:14px}.product-preview div{display:flex;flex-direction:column}.product-preview div>span{font-size:8px;letter-spacing:.12em;color:var(--wine)}.product-preview strong{font:700 25px "Aref Ruqaa",serif}.product-preview small{font-size:9px;color:var(--muted)}.switch-label{display:flex;align-items:center;gap:7px;font-size:8px;color:var(--muted);cursor:pointer}.switch-label input{display:none}.switch-label>span{width:31px;height:18px;background:#d4cdcf;border-radius:99px;position:relative}.switch-label>span::after{content:"";position:absolute;width:12px;height:12px;border-radius:50%;background:white;top:3px;right:3px;transition:.2s}.switch-label input:checked+span{background:var(--green)}.switch-label input:checked+span::after{transform:translateX(-13px)}.price-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}.price-fields label{display:flex;flex-direction:column;gap:7px}.fixed-shipping-note{display:flex;gap:9px;align-items:center;margin:16px 0 0;padding:11px;background:#f7f2e8;border-radius:9px;color:#80602c;font-size:8px}.fixed-shipping-note svg{width:20px}.inventory-list{display:grid;gap:8px}.inventory-row{display:grid;grid-template-columns:auto 1fr 130px auto;gap:12px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:9px}.inventory-row img{width:50px;height:50px;object-fit:cover;border-radius:8px}.inventory-row p{display:flex;flex-direction:column;margin:0}.inventory-row strong{font-size:10px}.inventory-row span{font-size:8px;color:var(--muted)}.inventory-row input[type=number]{height:38px;border:1px solid var(--line);border-radius:8px;padding:0 10px;width:100%}.save-card{position:sticky;top:20px}.save-card>span{font-size:8px;color:var(--muted)}.save-card h2{font:700 27px "Aref Ruqaa";color:var(--wine);margin:5px 0}.save-card p{font-size:8px;color:var(--muted)}.stock-total{border-block:1px solid var(--line);padding:16px 0;margin:18px 0;display:flex;justify-content:space-between;align-items:center}.stock-total small{color:var(--muted);font-size:9px}.stock-total strong{font-size:24px}.save-card button,.primary-button{width:100%;min-height:46px;border:0;border-radius:9px;background:var(--wine);color:white;font-weight:600;font-size:10px}
.save-card>img{width:100%;height:210px;object-fit:cover;border-radius:11px;margin-bottom:15px}.save-card>strong{display:block;color:var(--wine);font-size:10px;margin-bottom:18px}

.drawer-wrap{position:fixed;inset:0;z-index:100}.drawer-backdrop{position:absolute;inset:0;background:rgba(33,9,18,.53);backdrop-filter:blur(3px)}.order-drawer{position:absolute;inset:0 0 0 auto;width:min(540px,100%);background:white;overflow:auto;box-shadow:-20px 0 70px rgba(0,0,0,.18);animation:slide .25s ease}@keyframes slide{from{transform:translateX(100%)}}.order-drawer>header{position:sticky;top:0;z-index:3;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);display:flex;justify-content:space-between;padding:22px 28px;border-bottom:1px solid var(--line)}.order-drawer>header span{color:var(--muted);font-size:8px}.order-drawer>header h2{font-size:16px;margin:2px 0}.order-drawer>header button{border:0;background:var(--paper);width:32px;height:32px;border-radius:50%;font-size:20px}.order-drawer form{padding:25px 28px}.drawer-status-row,.drawer-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px}.drawer-status-row label,.drawer-fields label{display:flex;flex-direction:column;gap:6px}.drawer-status-row select{min-height:43px}.drawer-product{display:flex;gap:14px;align-items:center;margin:20px 0;padding:12px;background:var(--paper);border-radius:12px}.drawer-product img{width:72px;height:72px;object-fit:cover;border-radius:9px}.drawer-product div{display:flex;flex-direction:column}.drawer-product strong{font-size:11px}.drawer-product span,.drawer-product small{font-size:8px;color:var(--muted)}.drawer-fields .full{grid-column:1/-1}.drawer-fields input{min-height:43px}.drawer-fields textarea{padding:10px;resize:vertical}.drawer-noest{margin:20px 0;border:1px solid var(--line);border-radius:11px;padding:13px;display:flex;align-items:center;justify-content:space-between}.drawer-noest>div{display:flex;align-items:center;gap:10px}.drawer-noest p{display:flex;flex-direction:column;margin:0}.drawer-noest strong{font-size:9px}.drawer-noest small{font-size:8px;color:var(--muted)}.drawer-noest button{border:1px solid var(--wine);color:var(--wine);background:white;border-radius:8px;padding:8px 11px;font-size:8px}.history{border-top:1px solid var(--line);padding-top:16px}.history h3{font-size:10px}.history-entry{position:relative;padding:0 18px 14px 0;border-right:1px solid var(--line);display:flex;flex-direction:column}.history-entry::before{content:"";position:absolute;width:7px;height:7px;border-radius:50%;background:var(--wine);right:-4px;top:5px}.history-entry span{font-size:8px}.history-entry small{font-size:7px;color:var(--muted)}.drawer-actions{display:flex;gap:10px;margin-top:18px}.danger-button{border:1px solid #e8c8ca;background:white;color:var(--red);border-radius:9px;padding:0 14px;font-size:9px}.drawer-actions .primary-button{flex:1}.toast{position:fixed;z-index:200;left:24px;bottom:24px;background:var(--deep);color:white;border-radius:10px;padding:12px 17px;font-size:9px;box-shadow:0 15px 40px rgba(0,0,0,.2);transform:translateY(90px);opacity:0;transition:.25s}.toast.show{transform:none;opacity:1}.toast.error{background:var(--red)}

@media(max-width:1000px){.stats-grid{grid-template-columns:repeat(2,1fr)}.overview-grid{grid-template-columns:1fr}.product-layout{grid-template-columns:1fr}.save-card{position:static}.admin-main{padding-inline:25px}}
@media(max-width:720px){.login-screen{grid-template-columns:1fr}.login-art{display:none}.login-card{min-height:100vh;justify-content:center}.admin-shell{display:block}.sidebar{transform:translateX(105%);transition:.25s}.sidebar.is-open{transform:none}.admin-main{grid-column:auto;padding:0 14px 40px}.admin-header{height:88px;margin-bottom:20px}.menu-button{display:grid;place-items:center;border:0;background:white;border-radius:8px;width:38px;height:38px}.menu-button svg{width:20px}.header-actions a{display:none}.stats-grid{grid-template-columns:1fr 1fr;gap:9px}.stat-card{min-height:125px;padding:16px}.stat-card>strong{font-size:21px}.toolbar{flex-wrap:wrap}.search-box{max-width:none;flex:1 1 100%}.toolbar select{flex:1}.product-preview img{width:84px;height:84px}.price-fields{grid-template-columns:1fr}.inventory-row{grid-template-columns:auto 1fr 90px}.inventory-row>.switch-label{display:none}.order-drawer form,.order-drawer>header{padding-inline:18px}.drawer-status-row,.drawer-fields{grid-template-columns:1fr}.drawer-fields .full{grid-column:1}.table-summary small{display:none}}
