:root{--bg:#f5f9f7;--surface:rgba(255,255,255,.88);--surface-solid:#fff;--text:#16372a;--muted:#718078;--line:#e2ebe6;--green:#15764d;--green2:#0e5f3e;--mint:#e9f6ee;--mint2:#dff1e7;--red:#b33f46;--red-bg:#fdebed;--amber:#9a6a13;--amber-bg:#fff4d8;--gray-bg:#eef2f0;--shadow:0 18px 50px rgba(24,68,48,.08);--radius:24px;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Tahoma,Arial,sans-serif;color:var(--text);background:var(--bg)}*{box-sizing:border-box}html{min-height:100%;background:var(--bg)}body{margin:0;min-height:100dvh;background:radial-gradient(circle at 80% -10%,#e6f5eb 0,transparent 34%),linear-gradient(180deg,#f8fbf9 0,#f3f7f5 100%);color:var(--text);-webkit-font-smoothing:antialiased}a{color:inherit}button,input,select,textarea{font:inherit}button{cursor:pointer}.ico{display:block;flex:0 0 auto}.app-shell{min-height:100dvh;display:grid;grid-template-columns:276px minmax(0,1fr)}.sidebar{height:100dvh;position:sticky;top:0;padding:22px 16px 18px;background:rgba(255,255,255,.82);backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px);border-left:1px solid rgba(218,231,224,.8);display:flex;flex-direction:column;z-index:30}.brand{display:flex;align-items:center;gap:12px;padding:4px 8px 20px}.brand-mark{width:44px;height:44px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(145deg,rgba(29,139,93,.90),rgba(14,95,62,.94)),url('brand/quarry-mosaic.jpg') center/cover;color:white;font:700 14px/1 system-ui;box-shadow:0 12px 24px rgba(18,110,71,.25);letter-spacing:.5px}.brand-mark.big{width:72px;height:72px;border-radius:24px;font-size:22px}.brand strong{display:block;font-size:15px}.brand small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.sidebar nav{display:flex;flex-direction:column;gap:4px;overflow:auto;padding:4px 2px 12px;scrollbar-width:thin}.sidebar nav a{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:14px;text-decoration:none;color:#50675b;font-size:12px;transition:.18s ease}.sidebar nav a:hover{background:#f1f7f3;color:var(--green);transform:translateX(-2px)}.sidebar nav a.active{background:linear-gradient(135deg,#e4f4ea,#edf8f1);color:var(--green);font-weight:700;box-shadow:inset 0 0 0 1px #d2eadc}.side-foot{margin-top:auto;padding-top:12px;border-top:1px solid var(--line)}.user-pill{display:flex;gap:10px;align-items:center;padding:8px}.user-pill>span{width:35px;height:35px;border-radius:12px;background:var(--mint);display:grid;place-items:center;color:var(--green);font-weight:700}.user-pill b,.user-pill small{display:block}.user-pill b{font-size:11px}.user-pill small{font-size:9px;color:var(--muted);margin-top:2px}.logout-link{display:flex;align-items:center;gap:9px;padding:10px 9px;color:#8a5558;text-decoration:none;font-size:11px}.workspace{min-width:0}.topbar{height:88px;position:sticky;top:0;z-index:20;padding:calc(14px + var(--safe-top)) 28px 14px;display:flex;justify-content:space-between;align-items:center;background:rgba(247,251,249,.82);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border-bottom:1px solid rgba(226,235,230,.72)}.topbar h1{font-size:20px;margin:1px 0 0;letter-spacing:-.4px}.topbar small{color:var(--muted);font-size:9px}.top-actions{display:flex;align-items:center;gap:10px;color:#6d7f75;font-size:11px}.live-dot{width:8px;height:8px;background:#23a565;border-radius:50%;box-shadow:0 0 0 5px rgba(35,165,101,.1)}.content{padding:28px;max-width:1600px;margin:0 auto}.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px}.page-head h2{margin:0;font-size:24px;letter-spacing:-.5px}.page-head p{margin:6px 0 0;color:var(--muted);font-size:11px}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.primary,.secondary,.danger-btn,.ghost,.icon-btn{border:0;text-decoration:none;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;font-weight:700;font-size:11px;transition:.15s ease}.primary{background:linear-gradient(145deg,#197b52,#0e6040);color:white;box-shadow:0 9px 20px rgba(18,106,70,.18)}.primary:hover{transform:translateY(-1px);box-shadow:0 12px 24px rgba(18,106,70,.24)}.secondary{background:white;color:var(--green);box-shadow:inset 0 0 0 1px #d9e9df}.ghost{background:transparent;color:#5d7468}.danger-btn{background:var(--red-bg);color:var(--red);box-shadow:inset 0 0 0 1px #f5d5d8}.compact{min-height:38px;padding:0 12px}.full{width:100%}.icon-btn{width:42px;padding:0;background:white;color:var(--text);box-shadow:inset 0 0 0 1px var(--line)}.grid{display:grid;gap:16px}.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px;margin:18px 0 24px}.stat-card{min-width:0;padding:18px;border:1px solid rgba(222,234,227,.9);background:rgba(255,255,255,.88);border-radius:22px;box-shadow:0 12px 35px rgba(22,61,43,.05);position:relative;overflow:hidden}.stat-card:after{content:"";position:absolute;inset:auto -20px -35px auto;width:90px;height:90px;border-radius:50%;background:radial-gradient(circle,#e6f5ec 0,transparent 68%)}.stat-card .label{font-size:10px;color:var(--muted);display:flex;align-items:center;gap:6px}.stat-card .value{font-size:22px;font-weight:700;margin-top:10px;letter-spacing:-.6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stat-card .sub{font-size:9px;color:#8a9991;margin-top:4px}.panel{background:rgba(255,255,255,.9);border:1px solid rgba(220,232,225,.9);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}.panel+.panel{margin-top:16px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.panel-head h3{font-size:15px;margin:0}.panel-head p{font-size:10px;color:var(--muted);margin:4px 0 0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.form-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}label{display:grid;gap:7px;font-size:10px;font-weight:600;color:#4f675b}input,select,textarea{width:100%;min-width:0;min-height:47px;border:1px solid #dce8e1;border-radius:14px;background:#fbfdfc;padding:10px 12px;color:var(--text);outline:none;transition:.15s ease}textarea{min-height:96px;resize:vertical}input:focus,select:focus,textarea:focus{border-color:#7dc6a1;box-shadow:0 0 0 4px rgba(80,173,126,.10);background:#fff}input[readonly]{background:#f2f6f4;color:#607169}.field-help{font-size:9px;color:#8a9991;font-weight:400}.sale-total{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;background:linear-gradient(135deg,#e9f7ef,#f8fcfa);border:1px solid #d3eadc;border-radius:20px;padding:17px 20px;margin:17px 0}.sale-total span{font-size:10px;color:#668074}.sale-total strong{display:block;font-size:27px;color:var(--green);margin-top:3px}.sale-total .formula{font-size:10px;color:#759084;text-align:left}.toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:16px}.toolbar label{min-width:145px}.toolbar .grow{flex:1;min-width:220px}.table-card{background:white;border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:0 10px 30px rgba(20,60,42,.04)}.table-scroll{overflow:auto;-webkit-overflow-scrolling:touch}.data-table{border-collapse:collapse;width:100%;font-size:10px}.data-table th,.data-table td{padding:13px 14px;text-align:right;border-bottom:1px solid #edf2ef;white-space:nowrap}.data-table th{background:#f6faf8;color:#657a6f;font-weight:600;position:sticky;top:0}.data-table tr:last-child td{border-bottom:0}.data-table tbody tr:hover td{background:#fbfdfc}.data-table a{text-decoration:none;color:var(--green);font-weight:600}.badge{display:inline-flex;align-items:center;justify-content:center;min-height:25px;padding:0 9px;border-radius:999px;font-size:9px;font-weight:700}.badge.green{background:#e4f5eb;color:#1c7b50}.badge.amber{background:var(--amber-bg);color:var(--amber)}.badge.gray{background:var(--gray-bg);color:#607069}.badge.red{background:var(--red-bg);color:var(--red)}.empty{text-align:center;padding:50px 20px;color:#7b8d84}.empty .ico{margin:0 auto 12px}.alert,.toast{padding:13px 15px;border-radius:14px;font-size:10px;margin-bottom:16px}.alert.error,.toast.error{background:var(--red-bg);color:#8d3035;border:1px solid #f6d7d9}.alert.success,.toast.success{background:#e8f7ee;color:#176a45;border:1px solid #d6eddf}.toast{display:flex;align-items:center;gap:9px}.muted{color:var(--muted)}.kpi-line{display:flex;gap:14px;flex-wrap:wrap}.kpi-line>div{padding:10px 14px;background:#f7faf8;border-radius:14px}.kpi-line b,.kpi-line span{display:block}.kpi-line b{font-size:14px}.kpi-line span{font-size:8px;color:var(--muted);margin-top:3px}.quick-list{display:grid;gap:9px}.quick-row{display:grid;grid-template-columns:minmax(0,1.3fr) 1fr 1fr auto;align-items:center;gap:10px;padding:12px 13px;border:1px solid #edf2ef;border-radius:15px}.quick-row strong,.quick-row span,.quick-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.quick-row strong{font-size:10px}.quick-row span{font-size:9px;color:#667c70}.quick-row small{font-size:9px;color:#8a9991}.invoice-sheet{max-width:980px;margin:0 auto}.invoice-hero{background:linear-gradient(145deg,#15764d,#0e5c3d);color:white;border-radius:28px;padding:24px;box-shadow:0 18px 40px rgba(15,95,63,.22);display:flex;justify-content:space-between;gap:20px;align-items:center}.invoice-hero h2{margin:0;font-size:24px}.invoice-hero p{margin:6px 0 0;color:#d9f0e3;font-size:10px}.invoice-amount{text-align:left}.invoice-amount small{display:block;color:#d9f0e3;font-size:9px}.invoice-amount strong{font-size:30px}.detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}.detail{background:white;border:1px solid var(--line);border-radius:18px;padding:14px}.detail span{display:block;font-size:9px;color:var(--muted)}.detail b{display:block;font-size:12px;margin-top:5px}.auth-body{min-height:100dvh;display:grid;place-items:center;padding:22px;background:linear-gradient(rgba(238,247,242,.94),rgba(248,250,249,.96)),url('brand/quarry-desktop.jpg') center/cover fixed}.auth-card{width:min(940px,100%);min-height:570px;display:grid;grid-template-columns:1.05fr .95fr;background:rgba(255,255,255,.84);border:1px solid rgba(255,255,255,.92);border-radius:34px;overflow:hidden;box-shadow:0 30px 90px rgba(17,68,43,.14);backdrop-filter:blur(25px)}.auth-visual{padding:48px;background:linear-gradient(145deg,rgba(8,75,48,.76),rgba(21,111,73,.60)),url('brand/quarry-desktop.jpg') center/cover;color:white;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}.auth-visual:before,.auth-visual:after{content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.07)}.auth-visual:before{width:260px;height:260px;top:-80px;left:-80px}.auth-visual:after{width:180px;height:180px;bottom:-70px;right:-40px}.auth-visual h1{font-size:29px;margin:24px 0 7px}.auth-visual p{font-size:11px;line-height:2;color:#d9efe3;max-width:380px}.auth-metric{margin-top:38px;padding:16px;border-radius:18px;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.12)}.auth-metric b,.auth-metric span{display:block}.auth-metric b{font-size:12px}.auth-metric span{font-size:9px;color:#d9efe3;margin-top:5px}.auth-form{padding:48px;display:flex;flex-direction:column;justify-content:center;gap:15px}.auth-form h2{font-size:25px;margin:0 0 4px}.eyebrow{font-size:9px;color:var(--green);font-weight:700}.mobile-tabs,.mobile-only{display:none}.sidebar-scrim{display:none}.code-box{direction:ltr;text-align:left;font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;background:#f4f7f5;border-radius:12px;padding:12px;font-size:10px;overflow:auto}.danger-zone{border-color:#f1d5d8;background:#fffafa}.summary-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}.summary-strip div{background:#f6faf8;border-radius:14px;padding:11px}.summary-strip span,.summary-strip b{display:block}.summary-strip span{font-size:8px;color:var(--muted)}.summary-strip b{font-size:12px;margin-top:4px}.switch{display:flex!important;align-items:center;gap:10px}.switch input{width:44px;height:24px;min-height:auto;accent-color:var(--green)}.pagination{display:flex;gap:6px;justify-content:center;margin-top:16px}.pagination a{min-width:36px;height:36px;border-radius:11px;background:white;border:1px solid var(--line);display:grid;place-items:center;text-decoration:none;font-size:10px}.pagination a.active{background:var(--green);color:white;border-color:var(--green)}
@media(max-width:1200px){.stats{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.cols-4,.form-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:920px){.app-shell{display:block}.sidebar{position:fixed;right:0;top:0;width:285px;transform:translateX(105%);transition:.22s ease;box-shadow:-18px 0 55px rgba(20,60,42,.16)}body.menu-open .sidebar{transform:translateX(0)}.sidebar-scrim{position:fixed;inset:0;background:rgba(14,35,25,.28);z-index:25;backdrop-filter:blur(3px)}body.menu-open .sidebar-scrim{display:block}.mobile-only{display:inline-flex}.topbar{height:80px;padding:calc(10px + var(--safe-top)) 15px 10px}.topbar h1{font-size:16px}.content{padding:18px 14px calc(92px + var(--safe-bottom))}.desktop-only{display:none}.mobile-tabs{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);align-items:center;bottom:calc(10px + var(--safe-bottom));right:12px;left:12px;z-index:22;min-height:64px;padding:7px 10px;background:rgba(255,255,255,.90);border:1px solid rgba(220,232,225,.92);border-radius:23px;box-shadow:0 18px 50px rgba(22,61,43,.18);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}.mobile-tabs a{text-decoration:none;color:#6d7f75;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:8px}.mobile-tabs .tab-main{width:50px;height:50px;border-radius:17px;background:linear-gradient(145deg,#197b52,#0e6040);color:white;margin:-24px auto 0;box-shadow:0 12px 25px rgba(15,99,64,.28)}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.cols-3,.grid.cols-2,.form-grid.cols-3,.form-grid.cols-2,.form-grid.cols-4{grid-template-columns:1fr}.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.auth-card{grid-template-columns:1fr;max-width:560px}.auth-visual{display:none}.auth-form{padding:32px 24px}.page-head{align-items:center}.page-head h2{font-size:19px}.primary.compact{padding:0 10px}}
@media(max-width:560px){.top-actions .primary{font-size:0;width:40px;padding:0}.top-actions .primary .ico{margin:0}.stats{gap:9px}.stat-card{padding:14px;border-radius:18px}.stat-card .value{font-size:17px}.panel{padding:15px;border-radius:20px}.page-head{margin-bottom:14px}.page-head p{font-size:9px}.detail-grid{grid-template-columns:1fr 1fr}.invoice-hero{padding:18px;border-radius:22px;align-items:flex-start}.invoice-hero h2{font-size:18px}.invoice-amount strong{font-size:22px}.toolbar{display:grid;grid-template-columns:1fr 1fr}.toolbar .grow{grid-column:1/-1;min-width:0}.toolbar label{min-width:0}.quick-row{grid-template-columns:1fr auto}.quick-row span,.quick-row small{display:none}.summary-strip{grid-template-columns:1fr 1fr}.data-table th,.data-table td{padding:11px 10px}.sale-total{grid-template-columns:1fr}.sale-total .formula{text-align:right}.auth-form{padding:28px 20px}}
@media print{.sidebar,.topbar,.mobile-tabs,.no-print,.actions,.toast,.sidebar-scrim{display:none!important}.app-shell,.workspace{display:block}.content{padding:0;max-width:none}.panel,.table-card{box-shadow:none;border-color:#bbb;background:white}.data-table th,.data-table td{border:1px solid #bbb;white-space:normal;font-size:9px}.data-table th{position:static;background:#eee}.stats{grid-template-columns:repeat(5,1fr)}body{background:white}@page{margin:10mm;size:A4 landscape}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
.dashboard-hero{position:relative;overflow:hidden;min-height:154px;border-radius:30px;padding:26px 28px;margin-bottom:20px;background:linear-gradient(90deg,rgba(7,59,39,.90) 0%,rgba(13,101,65,.70) 48%,rgba(15,84,58,.26) 100%),url('brand/quarry-dashboard.jpg') center/cover;color:white;box-shadow:0 20px 50px rgba(15,83,55,.18);display:flex;align-items:center;justify-content:space-between;gap:20px}.dashboard-hero h2{margin:0;font-size:27px;letter-spacing:-.5px}.dashboard-hero p{margin:7px 0 0;color:#dcefe5;font-size:11px}.dashboard-hero .hero-chip{display:inline-flex;align-items:center;gap:8px;padding:9px 12px;border-radius:999px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);font-size:9px;backdrop-filter:blur(10px)}

@media(max-width:920px){.auth-body{background:linear-gradient(rgba(241,248,244,.91),rgba(248,250,249,.96)),url('brand/quarry-mobile.jpg') center/cover fixed}.dashboard-hero{min-height:132px;padding:20px;border-radius:23px}.dashboard-hero h2{font-size:21px}.dashboard-hero .hero-chip{display:none}}

/* === Abu Al Fawaris UI refresh 2.1 === */
:root{--ios-green:#0f6f4b;--ios-green-2:#149363;--ios-glass:rgba(255,255,255,.86);--ios-line:rgba(215,230,222,.88);--ios-shadow:0 18px 55px rgba(18,74,49,.10)}
body{background:radial-gradient(circle at 88% -8%,rgba(189,235,208,.55),transparent 30%),linear-gradient(180deg,#f9fcfa 0,#f2f7f4 100%)}
.sidebar{background:rgba(252,254,253,.88);border-left:1px solid rgba(211,227,218,.9);box-shadow:-10px 0 40px rgba(22,68,47,.025)}
.sidebar nav a{border-radius:16px;padding:9px 10px;gap:10px}.sidebar nav a .ico{width:36px!important;height:36px!important;padding:8px;border-radius:12px;background:#f1f7f4;color:#5c7568;box-shadow:inset 0 0 0 1px rgba(219,232,225,.8);transition:.18s ease}.sidebar nav a.active .ico,.sidebar nav a:hover .ico{background:linear-gradient(145deg,#1c8c60,#0f6b48);color:white;box-shadow:0 8px 18px rgba(18,115,76,.18)}
.topbar{background:rgba(248,252,250,.86);border-bottom:1px solid rgba(220,233,226,.72)}
.primary{background:linear-gradient(145deg,#178457,#0c6543);box-shadow:0 10px 24px rgba(15,105,69,.19)}.secondary{background:rgba(255,255,255,.9);box-shadow:inset 0 0 0 1px #d8e7df,0 6px 20px rgba(25,72,51,.04)}
.panel,.table-card,.stat-card,.detail{box-shadow:var(--ios-shadow);border-color:var(--ios-line)}
input,select,textarea{background:rgba(250,253,251,.96);border-color:#d8e6de;border-radius:16px;min-height:50px}input:hover,select:hover,textarea:hover{border-color:#b9d7c7}input:focus,select:focus,textarea:focus{border-color:#68ba91;box-shadow:0 0 0 5px rgba(54,164,111,.10)}
.optional{font-size:8px;color:#91a098;font-weight:500}.section-title{display:flex;align-items:center;gap:12px;margin-bottom:16px}.section-title>div{min-width:0;flex:1}.section-title h3{margin:0;font-size:15px}.section-title p{margin:4px 0 0;color:var(--muted);font-size:9px}.section-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(145deg,#e8f6ed,#f4fbf7);color:var(--ios-green);box-shadow:inset 0 0 0 1px #d6ebdf}.sale-panel{padding:0;overflow:hidden}.sale-section{padding:22px}.sale-section+.sale-section{border-top:1px solid #eaf1ed}.invoice-items-editor{display:grid;gap:10px}.invoice-item-row{display:grid;grid-template-columns:38px minmax(220px,1.6fr) minmax(130px,.8fr) minmax(140px,.8fr) minmax(145px,.8fr) 42px;gap:10px;align-items:end;padding:14px;border:1px solid #e1ece6;border-radius:20px;background:linear-gradient(180deg,#fff,#fbfdfc);box-shadow:0 8px 24px rgba(21,70,48,.035)}.item-index{width:32px;height:32px;border-radius:11px;display:grid;place-items:center;background:#edf7f1;color:var(--green);font-weight:800;font-size:11px;align-self:center}.line-total{min-height:50px;padding:9px 12px;border-radius:15px;background:#eff8f3;display:flex;flex-direction:column;justify-content:center}.line-total span{font-size:8px;color:#71897d}.line-total b{font-size:12px;color:var(--green);margin-top:2px}.remove-line{margin-bottom:1px;color:#a24a50;background:#fff7f7;box-shadow:inset 0 0 0 1px #f2dcdc}.modern-total{margin:0 22px 18px;border-radius:22px;background:linear-gradient(135deg,#e6f7ed,#f9fdfa);box-shadow:inset 0 0 0 1px #d1eadb}.modern-total small{display:block;color:#7d9186;font-size:8px;margin-top:5px}.sale-submit{width:calc(100% - 44px);margin:0 22px 22px;min-height:52px;border-radius:17px;font-size:12px}
.mobile-tabs a .ico{stroke-width:2.1}.mobile-tabs a{position:relative}.mobile-tabs a:not(.tab-main) .ico{width:27px!important;height:27px!important;padding:5px;border-radius:10px;background:rgba(239,247,243,.86)}.mobile-tabs .tab-main .ico{width:24px!important;height:24px!important}

/* Login */
.auth-body{padding:22px;background:linear-gradient(135deg,rgba(238,247,242,.88),rgba(249,251,250,.95)),url('brand/quarry-desktop.jpg') center/cover fixed}.modern-login{min-height:610px}.login-brand{display:flex;align-items:center;gap:16px;position:relative;z-index:1}.login-brand small,.login-brand h1{display:block}.login-brand small{font-size:9px;color:#d8eee3}.login-brand h1{margin:4px 0 0;font-size:23px}.auth-copy{position:relative;z-index:1;margin-top:60px}.auth-kicker{font-size:10px;color:#cbe7d8;font-weight:700}.auth-copy h2{font-size:30px;line-height:1.45;margin:10px 0 12px;max-width:430px}.auth-copy p{margin:0;max-width:430px}.auth-metric{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.auth-metric .metric-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:rgba(255,255,255,.12)}.auth-form{background:rgba(255,255,255,.9)}.auth-subtitle{font-size:10px;color:var(--muted);margin:-6px 0 6px}.interactive-field>span{font-size:10px}.input-shell{position:relative;display:flex;align-items:center}.input-shell>.ico{position:absolute;right:14px;color:#789084;z-index:1}.input-shell input{padding-right:44px;padding-left:46px;min-height:54px;border-radius:17px}.password-toggle{position:absolute;left:8px;width:38px;height:38px;border:0;border-radius:12px;background:#eef6f2;color:#5c7568;display:grid;place-items:center}.remember-row{display:flex!important;grid-template-columns:auto 1fr;align-items:flex-start;gap:10px;padding:12px 13px;border-radius:16px;background:#f6faf8;border:1px solid #e4eee8;cursor:pointer}.remember-row input{width:20px;height:20px;min-height:20px;margin:1px 0 0;accent-color:var(--green)}.remember-row b,.remember-row small{display:block}.remember-row b{font-size:10px}.remember-row small{font-size:8px;color:#84958c;margin-top:3px;line-height:1.7}.login-button{min-height:54px;border-radius:17px;font-size:12px}.login-mobile-brand{display:none}.login-version{text-align:center;font-size:8px}

@media(max-width:1100px){.invoice-item-row{grid-template-columns:34px 1.4fr 1fr 1fr 1fr 42px}}
@media(max-width:920px){
  .content{padding:18px 14px calc(88px + var(--safe-bottom))}
  .mobile-tabs{right:0;left:0;bottom:0;min-height:72px;padding:9px 12px calc(8px + var(--safe-bottom));border-radius:28px 28px 0 0;border:1px solid rgba(210,226,217,.92);border-bottom:0;background:rgba(255,255,255,.94);box-shadow:0 -12px 40px rgba(18,67,45,.13);backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px)}
  .mobile-tabs .tab-main{width:54px;height:54px;border-radius:18px;margin:-26px auto 0;border:4px solid rgba(255,255,255,.96);box-shadow:0 10px 25px rgba(14,103,68,.28)}
  .invoice-item-row{grid-template-columns:34px 1fr 1fr;align-items:end}.invoice-item-row .item-product{grid-column:2/-1}.invoice-item-row .line-total{grid-column:2/3}.invoice-item-row .remove-line{grid-column:3/4}.sale-section{padding:18px}.modern-total{margin:0 18px 16px}.sale-submit{width:calc(100% - 36px);margin:0 18px 18px}
  .auth-body{padding:0;background:#f7fbf8}.modern-login{width:100%;max-width:none!important;min-height:100dvh;border:0;border-radius:0;box-shadow:none;background:linear-gradient(180deg,#f8fcfa,#f2f8f5)}.modern-login .auth-visual{display:none}.modern-login .auth-form{min-height:100dvh;padding:calc(26px + var(--safe-top)) 22px calc(26px + var(--safe-bottom));justify-content:center;background:radial-gradient(circle at 85% 5%,#dff3e7 0,transparent 33%),linear-gradient(180deg,#fbfdfc,#f2f7f4)}.login-mobile-brand{display:flex;align-items:center;gap:11px;margin-bottom:28px}.login-mobile-brand .brand-mark{width:50px;height:50px;border-radius:16px}.login-mobile-brand small,.login-mobile-brand b{display:block}.login-mobile-brand small{font-size:8px;color:#7d9086}.login-mobile-brand b{font-size:13px;margin-top:3px}.modern-login .auth-form h2{font-size:28px}.interactive-field input{background:rgba(255,255,255,.94);box-shadow:0 8px 22px rgba(20,66,46,.045)}
}
@media(max-width:560px){.invoice-item-row{grid-template-columns:30px 1fr}.invoice-item-row .item-product,.invoice-item-row label,.invoice-item-row .line-total,.invoice-item-row .remove-line{grid-column:2/-1}.invoice-item-row .remove-line{justify-self:end}.section-title{align-items:flex-start;flex-wrap:wrap}.section-title .add-line{margin-right:54px}.modern-login .auth-form{padding-left:18px;padding-right:18px}.remember-row{padding:11px}.mobile-tabs{border-radius:25px 25px 0 0}}
@media(max-width:920px){.mobile-tabs a.active{color:var(--ios-green);font-weight:800}.mobile-tabs a.active:not(.tab-main) .ico{background:#dff2e7;color:var(--ios-green);box-shadow:inset 0 0 0 1px #c9e7d6}.mobile-tabs .tab-main.active{background:linear-gradient(145deg,#1b9461,#0a613f);transform:translateY(-2px)}}

/* ======================================================================
   Abu Al Fawaris Quarry System — V3 Visual System
   Inspired by modern iPhone task apps: white surfaces, violet gradients,
   cyan highlights, soft shadows and edge-to-edge mobile navigation.
   ====================================================================== */
:root{
  --bg:#eef3fb;--surface:rgba(255,255,255,.92);--surface-solid:#fff;--text:#171d38;--muted:#7c849d;
  --line:#e3e8f2;--green:#5b42e8;--green2:#432ac8;--mint:#f0edff;--mint2:#e8e5ff;
  --red:#ec5363;--red-bg:#fff0f2;--amber:#a66a13;--amber-bg:#fff6df;--gray-bg:#f0f3f8;
  --shadow:0 20px 55px rgba(43,47,96,.09);--radius:26px;--ios-green:#5b42e8;--ios-green-2:#7257f5;
  --violet:#5b42e8;--violet2:#7355f2;--blue:#2f7df6;--cyan:#25c1ea;--ink:#171d38;
  --soft-violet:#efedff;--soft-blue:#edf5ff;--soft-cyan:#e9fbff;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)
}
html{background:var(--bg);color-scheme:light;overflow-x:hidden}
body{background:
  radial-gradient(circle at 85% -5%,rgba(106,82,245,.13),transparent 30%),
  radial-gradient(circle at 10% 0,rgba(40,194,236,.09),transparent 28%),
  linear-gradient(180deg,#f7f9fe 0,#eef3fb 100%);color:var(--text);overflow-x:hidden}
::selection{background:#dcd6ff;color:#291d75}
.ico{stroke-width:1.8}

/* Brand */
.brand-mark{font-size:0!important;position:relative;background:linear-gradient(145deg,#fafbff,#eef1ff)!important;box-shadow:0 12px 30px rgba(82,62,210,.18)!important;border:1px solid rgba(255,255,255,.9);overflow:hidden}
.brand-mark:before{content:"";position:absolute;inset:7px;background:url('icons/app.svg') center/contain no-repeat}
.brand-mark.big:before{inset:10px}
.brand strong{color:#202645}.brand small{color:#8c93aa}

/* Desktop shell */
.app-shell{grid-template-columns:270px minmax(0,1fr);background:transparent}
.sidebar{padding:20px 14px 18px;background:rgba(249,250,255,.86);border-left:1px solid rgba(221,226,240,.82);box-shadow:-10px 0 40px rgba(48,49,92,.025);backdrop-filter:blur(30px);-webkit-backdrop-filter:blur(30px)}
.sidebar nav{gap:5px}.sidebar nav a{color:#707891;border-radius:16px;padding:11px 13px;font-size:11px;position:relative}
.sidebar nav a .ico{width:19px;height:19px;padding:0;color:#8b90a8}
.sidebar nav a:hover{background:#f0efff;color:#4d35d8;transform:none}
.sidebar nav a.active{background:linear-gradient(135deg,#5b42e8,#7153f1);color:white;box-shadow:0 12px 30px rgba(85,63,222,.22),inset 0 1px 0 rgba(255,255,255,.22)}
.sidebar nav a.active .ico{color:white}.side-foot{border-top-color:#e6e9f3}.user-pill>span{background:linear-gradient(145deg,#ece9ff,#e7f5ff);color:#5740dd}
.logout-link{color:#a15365}
.workspace{background:transparent}
.topbar{height:84px;padding:calc(12px + var(--safe-top)) 28px 12px;background:rgba(247,249,254,.80);border-bottom:1px solid rgba(225,229,240,.8);box-shadow:0 4px 20px rgba(35,40,83,.025)}
.topbar h1{color:#1d2342;font-size:19px}.topbar small{color:#9299af}.top-actions{color:#7c849d}.live-dot{background:#2bc59a;box-shadow:0 0 0 5px rgba(43,197,154,.10)}
.content{padding:28px 30px 40px}
.page-head h2{color:#171d38;font-size:25px}.page-head p{color:#848ba3;line-height:1.8}
.eyebrow{color:#6348eb;letter-spacing:.02em}

/* Buttons and inputs */
.primary,.secondary,.danger-btn,.ghost,.icon-btn{border-radius:15px;min-height:46px;font-weight:750}
.primary{background:linear-gradient(135deg,#6548ee 0%,#5339dd 48%,#2f7df6 100%);color:white;box-shadow:0 11px 25px rgba(74,58,213,.22),inset 0 1px 0 rgba(255,255,255,.22)}
.primary:hover{box-shadow:0 15px 34px rgba(74,58,213,.28);transform:translateY(-1px)}
.secondary{background:rgba(255,255,255,.92);color:#563ddd;box-shadow:inset 0 0 0 1px #dedaf9,0 8px 20px rgba(54,48,100,.04)}
.ghost{color:#747d96}.icon-btn{background:#fff;color:#5a6079;box-shadow:inset 0 0 0 1px #e2e6f0,0 6px 16px rgba(46,48,83,.045)}
input,select,textarea{min-height:50px;border-color:#dfe4ef;border-radius:16px;background:#fbfcff;color:#202644;padding:11px 13px;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
input:focus,select:focus,textarea:focus{border-color:#8674f1;box-shadow:0 0 0 4px rgba(98,73,234,.10),0 8px 24px rgba(65,53,162,.06);background:white}
label{color:#626b84;font-size:10px}.field-help,.optional{color:#989fb3}.switch input{accent-color:#5b42e8}

/* Dashboard */
.dashboard-hero{min-height:184px;border-radius:32px;padding:30px 32px;background:
  linear-gradient(92deg,rgba(67,39,194,.94) 0%,rgba(93,61,229,.85) 44%,rgba(47,125,246,.42) 100%),
  url('brand/quarry-dashboard.jpg') center/cover;box-shadow:0 24px 60px rgba(67,47,180,.23);isolation:isolate}
.dashboard-hero:after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 20% 10%,rgba(255,255,255,.12),transparent 25%),linear-gradient(130deg,transparent 60%,rgba(41,203,234,.20));pointer-events:none;z-index:-1}
.dashboard-hero h2{font-size:30px}.dashboard-hero p{color:#e9e6ff;font-size:11px}.dashboard-hero .hero-chip{background:rgba(255,255,255,.13);border-color:rgba(255,255,255,.18);box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.stats{gap:14px}.stat-card{border-color:#e8eaf3;background:rgba(255,255,255,.94);border-radius:24px;box-shadow:0 16px 38px rgba(48,51,92,.06);padding:19px}
.stat-card:after{background:radial-gradient(circle,rgba(107,83,242,.12),transparent 68%);width:105px;height:105px}
.stat-card .label{color:#7f879f}.stat-card .label .ico{width:32px!important;height:32px!important;padding:7px;border-radius:11px;background:linear-gradient(145deg,#ede9ff,#eef6ff);color:#5c43e7}
.stat-card .value{color:#1c2241;font-size:23px}.stat-card .sub{color:#9ca2b5}
.panel,.table-card{background:rgba(255,255,255,.94);border-color:#e7eaf3;border-radius:26px;box-shadow:0 18px 46px rgba(48,51,92,.055)}
.panel-head h3{color:#252b49}.panel-head p{color:#9197ab}.quick-row{border-color:#edf0f6;border-radius:17px;background:#fff}.quick-row:hover{background:#fafaff;border-color:#dfdcfa}.quick-row strong{color:#252b49}.quick-row span,.quick-row small{color:#8990a5}
.summary-strip div{background:linear-gradient(145deg,#f8f8ff,#f4f7ff);border:1px solid #ececf6;border-radius:16px}.summary-strip span{color:#9299ad}.summary-strip b{color:#272d4e}

/* Tables */
.table-card{overflow:hidden}.data-table{font-size:10px}.data-table th{background:#f7f8fc;color:#747c95;font-weight:700;border-bottom-color:#e8ebf2}.data-table td{border-bottom-color:#eef0f5;color:#333a58}.data-table tbody tr:hover td{background:#fafaff}.data-table a{color:#583ee1}.badge{border-radius:999px}.badge.green{background:#eafaf4;color:#178466}.badge.amber{background:#fff5dd;color:#9a681c}.badge.gray{background:#f0f2f7;color:#687087}.badge.red{background:#fff0f2;color:#d34d5c}

/* New sale / multi-line invoice */
.sale-panel{border-radius:30px}.sale-section{padding:24px}.sale-section+.sale-section{border-top-color:#eceef5}.section-icon{width:44px;height:44px;border-radius:15px;background:linear-gradient(145deg,#ede9ff,#eaf7ff);color:#5b42e8;box-shadow:inset 0 0 0 1px #dfdcfa}.section-title h3{color:#242a49}.section-title p{color:#9299ad}
.invoice-items-editor{gap:12px}.invoice-item-row{border-color:#e4e7f1;border-radius:22px;background:linear-gradient(180deg,#fff,#fbfbff);box-shadow:0 10px 28px rgba(47,49,91,.045);padding:15px}
.item-index{background:linear-gradient(145deg,#5b42e8,#2f7df6);color:white;border-radius:12px;box-shadow:0 7px 15px rgba(80,59,214,.18)}
.line-total{background:linear-gradient(145deg,#f0edff,#edf6ff);border:1px solid #e0dcfb;border-radius:16px}.line-total span{color:#838aa2}.line-total b{color:#5238d8}.remove-line{color:#df5161;background:#fff4f5;box-shadow:inset 0 0 0 1px #f9dfe3}
.modern-total{background:linear-gradient(135deg,#efecff,#edf6ff);box-shadow:inset 0 0 0 1px #ddd9fa;border-radius:24px}.sale-total strong{color:#4f36d2}.sale-total .formula{color:#747d96}.sale-submit{min-height:56px;border-radius:18px}

/* Invoice detail */
.invoice-sheet{max-width:1050px}.invoice-hero{background:linear-gradient(135deg,#6548ee,#5035d5 55%,#2f7df6);border-radius:30px;box-shadow:0 22px 55px rgba(73,54,207,.24);padding:26px 28px}.invoice-hero p,.invoice-amount small{color:#ebe8ff}.detail{border-color:#e7eaf3;border-radius:20px;box-shadow:0 10px 28px rgba(47,49,91,.04)}.detail span{color:#9198ad}.detail b{color:#252b4a}

/* Authentication */
.auth-body{padding:0;min-height:100dvh;background:linear-gradient(135deg,#edf3fb,#f7f8ff);place-items:stretch}
.auth-card{width:100%;max-width:none;min-height:100dvh;border:0;border-radius:0;box-shadow:none;background:white;grid-template-columns:minmax(360px,.9fr) minmax(430px,1.1fr)}
.auth-visual{padding:52px 56px;background:
 linear-gradient(135deg,rgba(67,38,194,.90),rgba(90,60,228,.78) 52%,rgba(47,125,246,.56)),
 url('brand/quarry-desktop.jpg') center/cover;color:white;justify-content:flex-end;min-height:100dvh}
.auth-visual:before{width:420px;height:420px;top:-170px;left:-130px;background:rgba(255,255,255,.06)}
.auth-visual:after{width:300px;height:300px;bottom:-120px;right:-90px;background:rgba(34,213,238,.13)}
.auth-visual h1{font-size:34px;margin:22px 0 9px}.auth-visual p{color:#ebe8ff;font-size:12px;line-height:2}.auth-kicker{display:inline-flex;width:max-content;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.16);font-size:9px}.auth-copy h2{font-size:27px;max-width:480px;margin:12px 0 8px}.auth-metric{background:rgba(255,255,255,.11);border-color:rgba(255,255,255,.15);max-width:430px}.auth-metric span{color:#eceaff}
.auth-form{padding:48px clamp(36px,6vw,92px);max-width:650px;width:100%;margin:auto;gap:14px}.auth-form h2{font-size:31px;color:#1d2343}.auth-subtitle{color:#858ca3;font-size:11px;line-height:1.8;margin:0 0 7px}.interactive-field>span{font-size:10px;color:#69718a}.input-shell>.ico{color:#6f62d9}.input-shell input{min-height:56px;border-radius:18px;background:#fbfbff}.input-shell.focused input{background:#fff}.password-toggle{background:#efedff;color:#5940dc}.remember-row{border-color:#e6e6f1;background:#f8f8fd;border-radius:17px}.remember-row input{accent-color:#5b42e8}.remember-row b{color:#333957}.remember-row small{color:#8e95aa}.login-button{min-height:56px;border-radius:18px;font-size:12px}.login-mobile-brand{margin-bottom:18px}.login-version{color:#a2a7b8}.login-brand{position:relative;z-index:2}.login-brand small{color:#e6e4ff}

/* Mobile */
@media(max-width:920px){
  .app-shell{display:block;min-height:100dvh}.sidebar{width:min(86vw,310px);background:rgba(249,250,255,.96);box-shadow:-22px 0 60px rgba(35,37,73,.18)}
  .topbar{height:74px;padding:calc(8px + var(--safe-top)) 14px 8px;background:rgba(248,249,254,.90);backdrop-filter:blur(26px);-webkit-backdrop-filter:blur(26px)}
  .topbar h1{font-size:16px}.content{padding:15px 13px calc(88px + var(--safe-bottom));transition:padding-bottom .18s ease}
  .dashboard-hero{min-height:150px;border-radius:25px;padding:22px 20px;background:linear-gradient(120deg,rgba(76,44,208,.94),rgba(92,65,232,.78),rgba(47,125,246,.44)),url('brand/quarry-mobile.jpg') center/cover}.dashboard-hero h2{font-size:23px}.dashboard-hero p{font-size:10px;max-width:70%}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat-card{border-radius:20px;padding:15px}.stat-card .value{font-size:18px}.stat-card .label{font-size:9px}.stat-card .label .ico{width:29px!important;height:29px!important;padding:6px}
  .panel,.table-card{border-radius:22px}.page-head h2{font-size:20px}.page-head p{font-size:9px}
  .mobile-tabs{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);align-items:center;right:0;left:0;bottom:0;z-index:70;min-height:72px;padding:8px 10px calc(7px + var(--safe-bottom));border:1px solid rgba(220,223,238,.96);border-bottom:0;border-radius:29px 29px 0 0;background:rgba(255,255,255,.96);box-shadow:0 -14px 42px rgba(41,43,84,.14);backdrop-filter:blur(30px);-webkit-backdrop-filter:blur(30px);transition:transform .22s ease,opacity .16s ease}
  .mobile-tabs a{color:#8b91a6;gap:4px;font-size:8px;font-weight:650;text-decoration:none}.mobile-tabs a .ico{width:30px!important;height:30px!important;padding:6px;border-radius:11px;transition:.18s ease}
  .mobile-tabs a.active{color:#583ee1;font-weight:800}.mobile-tabs a.active:not(.tab-main) .ico{background:linear-gradient(145deg,#ebe7ff,#edf5ff);color:#583ee1;box-shadow:inset 0 0 0 1px #ddd8fb}
  .mobile-tabs .tab-main{width:54px;height:54px;border-radius:18px;margin:-26px auto 0;background:linear-gradient(145deg,#694cf0,#5337db 55%,#2f7df6);color:#fff;border:4px solid rgba(255,255,255,.98);box-shadow:0 12px 26px rgba(72,53,207,.30)}
  body.keyboard-open .mobile-tabs{transform:translateY(calc(110% + var(--safe-bottom)));opacity:0;pointer-events:none}
  body.keyboard-open .content{padding-bottom:20px}
  .grid.cols-2,.grid.cols-3,.form-grid.cols-2,.form-grid.cols-3,.form-grid.cols-4{grid-template-columns:1fr}
  .invoice-item-row{grid-template-columns:34px 1fr 1fr}.invoice-item-row .item-product{grid-column:2/-1}.invoice-item-row .line-total{grid-column:2/3}.invoice-item-row .remove-line{grid-column:3/4}
  .sale-section{padding:18px}.modern-total{margin:0 18px 16px}.sale-submit{width:calc(100% - 36px);margin:0 18px 18px}
  .auth-card{display:flex;flex-direction:column;min-height:100dvh;background:#fff}.auth-visual{display:flex!important;min-height:35dvh;height:auto;padding:calc(28px + var(--safe-top)) 22px 56px;justify-content:flex-end;background:linear-gradient(145deg,rgba(71,38,203,.88),rgba(95,66,233,.72),rgba(47,125,246,.38)),url('brand/quarry-mobile.jpg') center/cover}
  .auth-visual .auth-copy{display:none}.auth-visual .auth-metric{display:none}.auth-visual h1{font-size:23px;margin:10px 0 0}.auth-visual .brand-mark.big{width:58px;height:58px;border-radius:18px}.auth-form{position:relative;z-index:2;max-width:none;margin:-32px 0 0;padding:28px 20px calc(24px + var(--safe-bottom));border-radius:32px 32px 0 0;background:#fff;box-shadow:0 -18px 50px rgba(34,36,75,.08);justify-content:flex-start;gap:12px;min-height:65dvh}
  .login-mobile-brand{display:none}.modern-login .auth-form{min-height:auto;background:#fff}.modern-login .auth-form h2{font-size:27px;margin-top:2px}.auth-subtitle{font-size:10px;margin-bottom:4px}.interactive-field input{box-shadow:none}
}
@media(max-width:560px){
  .content{padding-left:11px;padding-right:11px}.top-actions .primary{width:42px}.page-head{gap:10px}.panel{padding:15px}.stats{gap:9px}.stat-card{padding:14px}.dashboard-hero{min-height:142px;padding:20px 17px;border-radius:23px}
  .invoice-item-row{grid-template-columns:30px 1fr;padding:13px}.invoice-item-row .item-product,.invoice-item-row label,.invoice-item-row .line-total,.invoice-item-row .remove-line{grid-column:2/-1}.invoice-item-row .remove-line{justify-self:end}.section-title{align-items:flex-start}.section-title .add-line{margin-right:auto}
  .detail-grid{grid-template-columns:1fr 1fr;gap:9px}.detail{padding:12px;border-radius:17px}.invoice-hero{border-radius:24px;padding:20px}.invoice-hero h2{font-size:19px}.invoice-amount strong{font-size:22px}
  .auth-visual{min-height:34dvh;padding:calc(22px + var(--safe-top)) 18px 52px}.auth-form{margin-top:-28px;padding:25px 18px calc(20px + var(--safe-bottom));border-radius:28px 28px 0 0}.input-shell input{min-height:54px}.remember-row{padding:11px 12px}.login-button{min-height:54px}
}
@supports(height:100svh){.auth-card{min-height:100svh}.auth-visual{min-height:35svh}}
@media print{body{background:#fff}.mobile-tabs{display:none!important}}
/* V3 icon treatment */
.sidebar nav a .ico{width:31px!important;height:31px!important;padding:6px;border-radius:10px;background:#f0f1f7;color:#7d849d;box-shadow:inset 0 0 0 1px #e8eaf2}.sidebar nav a.active .ico{background:rgba(255,255,255,.14);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.section-icon .ico,.stat-card .label .ico,.top-actions .ico,.actions .ico{stroke-width:1.9}.password-toggle .ico{stroke-width:1.9}

/* =====================================================================
   V3.1 Exact-reference refinement — white + violet/blue mobile app system
   ===================================================================== */
:root{--ref-violet:#5b3ff2;--ref-violet-2:#6f51f4;--ref-blue:#2f7df6;--ref-cyan:#21c4e8;--ref-ink:#171d3a;--ref-soft:#f4f7fc;--ref-line:#e4e9f3;--ref-shadow:0 18px 50px rgba(42,48,102,.11)}
body{background:#f2f6fc;color:var(--ref-ink)}
.brand-logo{width:48px;height:48px;object-fit:contain;border-radius:15px;background:#fff;padding:6px;box-shadow:0 10px 25px rgba(75,56,207,.14)}
.round-action{position:relative;width:40px;height:40px;border:0;border-radius:14px;background:#fff;color:#5941de;display:grid;place-items:center;box-shadow:inset 0 0 0 1px #e4e7f1}.round-action i{position:absolute;top:6px;right:7px;width:7px;height:7px;border-radius:50%;background:#ff5b68;border:2px solid #fff}.topbar-title small{display:block}.top-date{font-size:10px;color:#8990a7}
.primary{background:linear-gradient(135deg,var(--ref-violet),var(--ref-violet-2) 58%,var(--ref-blue));box-shadow:0 12px 26px rgba(83,62,223,.23)}.secondary{color:#533bd8;border-color:#ddd8fb;background:#fff}.text-link{color:#5e43e5;text-decoration:none;font-size:10px;font-weight:800}
.panel,.table-card{border-color:var(--ref-line);box-shadow:var(--ref-shadow);background:#fff}.panel{border-radius:24px}.data-table th{background:#f6f7fc;color:#717993}.data-table tbody tr:hover td{background:#fafbff}.data-table a{color:#573fdc}
input,select,textarea{border-color:#dfe4ef;background:#fbfcff;color:var(--ref-ink)}input:focus,select:focus,textarea:focus{border-color:#8c7af5;box-shadow:0 0 0 4px rgba(91,63,242,.09)}

/* Dashboard matching the approved visual reference */
.dashboard-header-card{position:relative;padding:22px;border-radius:30px;background:linear-gradient(145deg,#6548ef,#573ade 56%,#4430c6);color:#fff;overflow:hidden;box-shadow:0 22px 46px rgba(74,52,202,.26);margin-bottom:18px}.dashboard-header-card:before{content:"";position:absolute;inset:-130px -80px auto auto;width:330px;height:330px;border:1px solid rgba(255,255,255,.08);border-radius:50%;box-shadow:0 0 0 38px rgba(255,255,255,.025),0 0 0 76px rgba(255,255,255,.018)}.dashboard-user-row{display:flex;align-items:center;justify-content:space-between;gap:14px;position:relative;z-index:2;margin-bottom:18px}.dashboard-user-row small{font-size:9px;color:#ded9ff}.dashboard-user-row h2{font-size:20px;margin:2px 0}.dashboard-user-row p{font-size:9px;margin:0;color:#ebe8ff}.dash-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#5138d4;font-weight:900;border:3px solid rgba(255,255,255,.45);box-shadow:0 8px 20px rgba(24,16,86,.2)}.dashboard-banner{height:190px;border-radius:23px;position:relative;overflow:hidden;background:#3e2caa}.dashboard-banner>img{width:100%;height:100%;object-fit:cover;display:block}.dashboard-banner-shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(34,24,100,.12),rgba(43,26,116,.55))}.dashboard-banner-copy{position:absolute;top:23px;right:22px;z-index:2}.dashboard-banner-copy span{display:block;font-size:9px;color:#e8e4ff;margin-bottom:5px}.dashboard-banner-copy strong{font-size:22px;line-height:1.35}.banner-action{position:absolute;left:18px;bottom:18px;width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(145deg,#32caf0,#2f7df6);color:#fff;box-shadow:0 10px 25px rgba(30,121,234,.32)}
.reference-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 18px}.reference-stats .stat-card{padding:17px;border-radius:20px;border:1px solid #e7eaf3;background:#fff;box-shadow:0 12px 30px rgba(39,45,92,.07)}.reference-stats .stat-card:after{display:none}.stat-icon{width:40px;height:40px;border-radius:14px;display:grid;place-items:center;margin-bottom:13px}.card-blue .stat-icon{background:linear-gradient(145deg,#e5efff,#dfeaff);color:#2f7df6}.card-coral .stat-icon{background:#fff0f2;color:#fb5668}.card-purple .stat-icon{background:#efebff;color:#6a45f1}.card-teal .stat-icon{background:#e3fbf7;color:#13b8a5}.reference-stats .label{font-size:9px;color:#858ca4}.reference-stats .value{font-size:20px;color:#1c2241;margin-top:7px}.reference-stats .value small{font-size:8px;color:#8b92a8}.reference-stats .sub{font-size:8px;color:#9aa0b1}.dashboard-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px;margin-bottom:16px}.week-chart{height:180px;display:flex;direction:rtl;gap:10px;align-items:flex-end;padding:20px 4px 0}.bar-col{flex:1;min-width:0;text-align:center;display:grid;grid-template-rows:20px 1fr 24px;align-items:end}.bar-value{font-size:7px;color:#6850de;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-track{height:112px;border-radius:9px 9px 4px 4px;background:#eff2fb;position:relative;overflow:hidden}.bar-track i{display:block;position:absolute;bottom:0;left:0;right:0;border-radius:9px 9px 4px 4px;background:linear-gradient(180deg,#8067fa,#5b42e8)}.bar-col span{font-size:8px;color:#8b92a8;margin-top:7px}.activity-list{display:grid;gap:8px}.activity-item{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:10px;text-decoration:none;padding:10px 0;border-bottom:1px solid #eef0f6}.activity-item:last-child{border-bottom:0}.activity-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#f0edff;color:#5f43e6}.activity-item b,.activity-item small{display:block}.activity-item b{font-size:10px}.activity-item small{font-size:8px;color:#9298ab;margin-top:2px}.activity-item strong{font-size:10px;color:#293050;direction:ltr}.debt-mini-list{display:grid}.debt-mini-list a{display:flex;justify-content:space-between;gap:12px;text-decoration:none;padding:12px 3px;border-bottom:1px solid #eef0f6;font-size:10px}.debt-mini-list a:last-child{border:0}.debt-mini-list b{color:#5840dc;direction:ltr}.secondary-dashboard{grid-template-columns:.8fr 1.2fr}

/* Sale screen */
.sale-app-head{display:flex;justify-content:space-between;align-items:center;padding:23px 24px;border-radius:28px 28px 0 0;background:linear-gradient(135deg,#633ff0,#5635d8 58%,#3e38cf);color:#fff;box-shadow:0 16px 36px rgba(81,57,211,.22)}.sale-app-head small{color:#e1dcff;font-size:9px}.sale-app-head h2{margin:4px 0 0;font-size:22px}.sale-head-action{width:45px;height:45px;border-radius:15px;display:grid;place-items:center;background:rgba(255,255,255,.12);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}.reference-sale{border-radius:0 0 28px 28px;box-shadow:var(--ref-shadow);border-top:0}.reference-sale .sale-section{padding:21px}.reference-sale .section-title{margin-bottom:16px}.reference-sale .section-title h3{font-size:14px}.reference-sale .section-title p{font-size:8px;color:#8b92a8}.reference-fields{gap:12px}.reference-fields label>span,.invoice-item-row label>span{font-size:9px;color:#59617a;font-weight:700}.reference-fields em{font-style:normal;font-size:8px;color:#a0a5b5;font-weight:500}.field-icon-shell{position:relative;display:flex;align-items:center}.field-icon-shell>.ico{position:absolute;right:13px;color:#6048e3;z-index:2}.field-icon-shell input{padding-right:42px;padding-left:40px;background:#fff}.inline-plus{position:absolute;left:8px;width:29px;height:29px;border-radius:9px;border:0;background:#efedff;color:#6046e3;display:grid;place-items:center}.products-section{background:#fbfcff}.invoice-items-editor{gap:12px}.invoice-item-row{display:block;padding:13px;border-radius:18px;border:1px solid #e2e6f0;background:#fff;box-shadow:0 8px 22px rgba(39,44,91,.045)}.item-row-top{display:grid;grid-template-columns:30px minmax(0,1fr) 34px;gap:10px;align-items:center}.item-index{width:29px;height:29px;background:#efedff;color:#5b42e8;border-radius:10px}.item-product{min-width:0}.item-product input{min-height:43px;background:#fafbff}.remove-line{width:34px;height:34px;border:0;border-radius:10px;color:#ef5364;background:#fff0f2;display:grid;place-items:center}.item-row-values{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px;margin-top:10px}.item-row-values label input{min-height:42px}.line-total{min-height:62px;border-radius:13px;background:#f3f1ff;padding:9px 11px;display:flex;flex-direction:column;justify-content:center}.line-total span{font-size:8px;color:#858ca2}.line-total b{font-size:11px;color:#553ad8;direction:ltr}.add-product-card{width:100%;margin-top:13px;min-height:65px;border:1px dashed #9d8ff1;border-radius:17px;background:#fbfaff;color:#5c43dd;display:flex;align-items:center;justify-content:center;gap:11px}.add-product-card>span{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#6045e7;color:#fff}.add-product-card b,.add-product-card small{display:block;text-align:right}.add-product-card b{font-size:10px}.add-product-card small{font-size:8px;color:#9298ad;margin-top:2px}.wide-field{grid-column:1/-1}.sale-total.modern-total{display:grid;grid-template-columns:1fr 1fr 1fr;gap:0;margin:0 21px 17px;padding:0;background:#f5f5fc;border:1px solid #e4e6f0;border-radius:17px;overflow:hidden;box-shadow:none}.sale-total.modern-total>div{padding:13px 14px;border-left:1px solid #e5e6f1}.sale-total.modern-total>div:last-of-type{border-left:0}.sale-total.modern-total span{font-size:8px;color:#7e859d}.sale-total.modern-total strong,.sale-total.modern-total b{display:block;font-size:16px;color:#2c3253;margin-top:4px;direction:ltr}.sale-total.modern-total .total-highlight{background:#eeebff}.sale-total.modern-total .total-highlight b{color:#573bdb}.sale-total.modern-total>small{grid-column:1/-1;padding:8px 14px;color:#8d93a8;background:#fff}.sale-actions{display:grid;grid-template-columns:.7fr 1.3fr;gap:10px;padding:0 21px 21px}.sale-actions .sale-submit{width:auto;margin:0;min-height:50px}

/* Invoice preview */
.invoice-view{max-width:900px;margin:0 auto}.invoice-preview-card{background:#fff;border:1px solid #e5e8f1;border-radius:28px;box-shadow:0 24px 65px rgba(42,46,91,.12);overflow:hidden;margin-bottom:18px}.invoice-preview-head{display:flex;justify-content:space-between;align-items:center;padding:24px 26px 15px}.invoice-brand{display:flex;align-items:center;gap:12px}.invoice-brand img{width:58px;height:58px;object-fit:contain;border-radius:14px;background:#f5f4ff;padding:6px}.invoice-brand b,.invoice-brand small{display:block}.invoice-brand b{font-size:14px}.invoice-brand small{font-size:8px;color:#8b92a8;margin-top:3px}.invoice-number-box{padding:10px 15px;border:1px solid #ddd8fb;background:#f7f5ff;border-radius:13px;text-align:center}.invoice-number-box span,.invoice-number-box strong{display:block}.invoice-number-box span{font-size:7px;color:#796cae}.invoice-number-box strong{font-size:15px;color:#563bdc;margin-top:2px}.invoice-preview-title{display:flex;justify-content:space-between;align-items:center;padding:8px 26px 18px}.invoice-preview-title h2{font-size:20px;margin:0}.invoice-preview-title span{font-size:8px;color:#8b92a8}.invoice-party-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:0 26px 18px}.invoice-party-grid>div{padding:14px;border:1px solid #e7eaf2;border-radius:16px;background:#fbfcff}.invoice-party-grid span{display:flex;align-items:center;gap:5px;font-size:8px;color:#7c849d}.invoice-party-grid b,.invoice-party-grid small{display:block}.invoice-party-grid b{font-size:11px;margin-top:5px}.invoice-party-grid small{font-size:8px;color:#9ba1b3;margin-top:3px}.invoice-preview-table{margin:0 26px;border:1px solid #e0e4ee;border-radius:14px;overflow:hidden}.preview-row{display:grid;grid-template-columns:38px 1.5fr .75fr .85fr .85fr;min-height:42px;align-items:center;border-bottom:1px solid #e9ebf2;font-size:9px}.preview-row:last-child{border:0}.preview-row>*{padding:0 9px}.preview-head-row{background:#f2efff;color:#5840d8;font-weight:800}.preview-row b{direction:ltr;text-align:right}.invoice-totals{margin:18px 26px 0;margin-right:auto;width:min(380px,calc(100% - 52px));border-top:1px solid #e8eaf1}.invoice-totals>div{display:flex;justify-content:space-between;padding:9px 4px;border-bottom:1px solid #eef0f5;font-size:9px}.invoice-totals b,.invoice-totals strong{direction:ltr}.invoice-totals .grand{background:#efedff;color:#553bd8;padding:12px 10px;border-radius:10px;border:0;margin-top:5px}.invoice-totals .grand strong{font-size:15px}.invoice-note{margin:18px 26px;padding:13px 15px;background:#f7f8fc;border-radius:14px}.invoice-note span{font-size:8px;color:#7e859b}.invoice-note p{font-size:9px;margin:4px 0 0}.invoice-art{height:88px;margin:8px 26px 0;border-radius:18px;overflow:hidden;opacity:.32;position:relative}.invoice-art:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#fff,transparent 30%,transparent 70%,#fff)}.invoice-art img{width:100%;height:100%;object-fit:cover;filter:saturate(.65)}.invoice-preview-footer{display:flex;justify-content:space-between;gap:10px;padding:15px 26px 21px;color:#9ba1b3;font-size:8px}.payment-manager{margin-top:16px}.add-payment{margin-top:15px}

/* Settings / branding */
.settings-layout{display:grid;gap:16px}.brand-upload-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.brand-upload-card{border:1px solid #e4e7f0;border-radius:19px;overflow:hidden;background:#fbfcff}.brand-preview{height:150px;background:#edf2fa}.brand-preview img{width:100%;height:100%;object-fit:cover}.brand-upload-card:first-child .brand-preview img{object-fit:contain;padding:25px;background:#f5f4ff}.brand-upload-copy{padding:13px}.brand-upload-copy b,.brand-upload-copy small{display:block}.brand-upload-copy b{font-size:11px}.brand-upload-copy small{font-size:8px;color:#8c93a8;margin:4px 0 10px}.brand-upload-copy input[type=file]{min-height:auto;padding:8px;font-size:9px;background:#fff}.reset-brand{display:flex!important;grid-template-columns:auto 1fr;align-items:center;gap:7px;margin-top:8px;font-size:8px}.reset-brand input{width:17px;height:17px;min-height:auto}.settings-save{min-height:52px;justify-self:start}.password-panel{margin-top:16px}

/* Login screen — exact mobile composition */
.auth-body{padding:0!important;background:#dfe8f6!important;min-height:100dvh}.login-screen{min-height:100dvh;width:min(100%,1080px);margin:0 auto;display:grid;grid-template-columns:1.05fr .95fr;background:#fff;box-shadow:0 28px 90px rgba(44,52,100,.15)}.login-visual{position:relative;min-height:100dvh;overflow:hidden;background:#eaf1fb}.login-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.login-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(236,244,255,.10) 0,rgba(60,43,159,.05) 55%,rgba(65,43,181,.38) 100%)}.login-identity{position:absolute;top:9%;right:8%;left:8%;text-align:center;color:#18204a}.login-logo{width:92px;height:92px;object-fit:contain;padding:8px;border-radius:25px;background:rgba(255,255,255,.82);box-shadow:0 14px 36px rgba(62,49,151,.15);backdrop-filter:blur(14px)}.login-identity h1{font-size:25px;margin:14px 0 3px}.login-identity p{font-size:10px;margin:0;color:#4e587f}.login-sheet{display:flex;flex-direction:column;justify-content:center;padding:50px 52px;background:#fff}.login-welcome small{font-size:9px;color:#6a4fea;font-weight:800}.login-welcome h2{font-size:32px;margin:5px 0 4px}.login-welcome p{font-size:10px;color:#8c93a8;margin:0 0 18px}.interactive-field{margin-bottom:12px}.interactive-field>span{font-size:9px;color:#676f88}.input-shell{position:relative;display:flex;align-items:center}.input-shell>.ico{position:absolute;right:15px;z-index:2;color:#5f46e0}.input-shell input{padding-right:44px;padding-left:46px;min-height:55px;border-radius:15px;background:#fff}.password-toggle{position:absolute;left:8px;width:38px;height:38px;border:0;border-radius:11px;background:#f0efff;color:#5b43dd}.remember-row{display:flex!important;grid-template-columns:auto 1fr;gap:9px;align-items:flex-start;padding:8px 2px;margin:2px 0 10px;border:0;background:transparent}.remember-row input{width:19px;height:19px;min-height:19px;accent-color:#5b42e8}.remember-row b,.remember-row small{display:block}.remember-row b{font-size:9px}.remember-row small{font-size:7px;color:#979daf;margin-top:2px}.login-button{min-height:56px;border-radius:18px;font-size:12px}.login-button>span{width:37px;height:37px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#563bdc;margin-left:auto}.login-foot{display:flex;justify-content:space-between;margin-top:18px;font-size:7px;color:#a0a5b5}

@media(max-width:920px){
  .sidebar{position:fixed;right:0;top:0;bottom:0;width:min(86vw,320px);height:100dvh;transform:translateX(105%);transition:transform .24s ease;z-index:100;border-left:0;border-radius:0 0 0 28px}.menu-open .sidebar{transform:none}.sidebar-scrim{position:fixed;inset:0;background:rgba(25,24,55,.38);backdrop-filter:blur(3px);z-index:90;opacity:0;pointer-events:none;transition:.2s}.menu-open .sidebar-scrim{opacity:1;pointer-events:auto}.app-shell{display:block}.topbar{height:72px;padding:calc(9px + var(--safe-top)) 14px 9px;background:rgba(247,249,254,.92)}.content{padding:14px 12px calc(94px + var(--safe-bottom));max-width:none}.page-dashboard .topbar,.page-sale .topbar{display:none}.page-dashboard .content,.page-sale .content{padding-top:0}.dashboard-header-card{margin:0 -12px 14px;border-radius:0 0 28px 28px;padding:calc(17px + var(--safe-top)) 16px 17px}.dashboard-banner{height:150px}.dashboard-banner-copy strong{font-size:19px}.reference-stats{grid-template-columns:1fr 1fr;gap:9px}.reference-stats .stat-card{padding:13px}.stat-icon{width:35px;height:35px;margin-bottom:9px}.reference-stats .value{font-size:16px}.dashboard-grid,.secondary-dashboard{grid-template-columns:1fr}.secondary-dashboard{display:none}.week-chart{height:160px}.activity-panel{margin-top:0}.mobile-tabs{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;right:0;left:0;bottom:0;z-index:80;min-height:76px;padding:8px 8px calc(8px + var(--safe-bottom));border:0;border-radius:28px 28px 0 0;background:linear-gradient(135deg,#5535db,#633eea 55%,#4531bf);box-shadow:0 -15px 38px rgba(54,39,149,.24);transition:transform .18s ease,opacity .16s ease}.mobile-tabs a,.mobile-tabs button{border:0;background:transparent;color:#d9d4ff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-decoration:none;font-size:8px;font-weight:650}.mobile-tabs .ico{background:transparent!important;box-shadow:none!important;padding:0!important;width:22px!important;height:22px!important}.mobile-tabs a.active{color:#fff}.mobile-tabs a.active .ico{filter:drop-shadow(0 3px 6px rgba(0,0,0,.2))}.mobile-more{font:inherit}.mobile-tabs a:active,.mobile-tabs button:active{transform:scale(.94)}body.keyboard-open .mobile-tabs{transform:translateY(calc(110% + var(--safe-bottom)));opacity:0;pointer-events:none}.sale-app-head{margin:0 -12px;border-radius:0 0 28px 28px;padding:calc(18px + var(--safe-top)) 17px 23px}.reference-sale{margin:-8px 0 0;border-radius:24px;position:relative;z-index:2}.reference-sale .sale-section{padding:17px 14px}.reference-fields{grid-template-columns:1fr 1fr}.item-row-values{grid-template-columns:1fr 1fr 1fr}.sale-total.modern-total{margin:0 14px 14px}.sale-actions{padding:0 14px 16px}.invoice-page-actions .actions{width:100%;justify-content:stretch}.invoice-page-actions .actions>*{flex:1}.invoice-preview-card{border-radius:23px}.invoice-preview-head{padding:18px 16px 12px}.invoice-brand img{width:48px;height:48px}.invoice-preview-title,.invoice-party-grid{padding-left:16px;padding-right:16px}.invoice-preview-table{margin-left:16px;margin-right:16px;overflow-x:auto}.preview-row{min-width:570px}.invoice-totals{width:calc(100% - 32px);margin-left:16px;margin-right:16px}.invoice-note,.invoice-art{margin-left:16px;margin-right:16px}.invoice-preview-footer{padding-left:16px;padding-right:16px}.brand-upload-grid{grid-template-columns:1fr}.login-screen{display:flex;flex-direction:column;min-height:100dvh;width:100%;box-shadow:none}.login-visual{min-height:43dvh;height:43dvh}.login-photo{object-position:center 60%}.login-shade{background:linear-gradient(180deg,rgba(235,243,255,.08),rgba(65,46,177,.12))}.login-identity{top:calc(7% + var(--safe-top))}.login-logo{width:72px;height:72px;border-radius:21px}.login-identity h1{font-size:20px;margin-top:9px}.login-sheet{position:relative;z-index:2;margin-top:-30px;min-height:57dvh;padding:27px 18px calc(20px + var(--safe-bottom));border-radius:31px 31px 0 0;justify-content:flex-start;box-shadow:0 -20px 50px rgba(44,46,95,.08)}.login-welcome h2{font-size:27px}.login-welcome p{margin-bottom:15px}.login-foot{margin-top:auto;padding-top:14px}
}
@media(max-width:560px){.reference-fields{grid-template-columns:1fr}.item-row-values{grid-template-columns:1fr 1fr}.item-row-values .line-total{grid-column:1/-1}.sale-total.modern-total{grid-template-columns:1fr}.sale-total.modern-total>div{border-left:0;border-bottom:1px solid #e5e6f1}.invoice-party-grid{grid-template-columns:1fr}.dashboard-user-row h2{font-size:18px}.dashboard-banner{height:138px}.week-chart{gap:6px}.bar-value{display:none}.brand-preview{height:130px}}
@media print{.topbar,.sidebar,.mobile-tabs,.sidebar-scrim,.invoice-page-actions,.payment-manager{display:none!important}.content{padding:0!important}.invoice-preview-card{box-shadow:none;border:0;border-radius:0}.invoice-view{max-width:none}.invoice-art{opacity:.18}}
/* final phone-density tuning to match the approved mockup */
@media(max-width:560px){
  .item-row-values{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .item-row-values .line-total{grid-column:auto;min-width:0;padding:8px 7px}
  .item-row-values label input{padding:8px 7px;text-align:center;font-size:9px}
  .line-total b{font-size:9px;white-space:nowrap}
  .invoice-preview-table{overflow:visible}
  .preview-row{min-width:0;grid-template-columns:24px minmax(92px,1.35fr) 50px 57px 67px;font-size:7px}
  .preview-row>*{padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .preview-head-row{font-size:6.5px}
}
@media(max-width:560px){
  .invoice-item-row .item-row-values label,.invoice-item-row .item-row-values .line-total{grid-column:auto!important}
}

/* v3.1.1 patch: avatars, PWA install controls, PDF feedback */
.user-pill-link{display:flex!important;text-decoration:none;color:inherit}.user-pill-avatar,.topbar-avatar,.dash-avatar,.table-avatar{overflow:hidden;display:grid;place-items:center;background:linear-gradient(145deg,#6b4cf2,#2f7df6);color:#fff;font-weight:800}.user-pill-avatar img,.topbar-avatar img,.dash-avatar img,.table-avatar img{width:100%;height:100%;object-fit:cover;display:block}.user-pill-avatar{width:40px;height:40px;border-radius:13px;flex:0 0 auto}.topbar-avatar-link{display:grid;place-items:center;text-decoration:none}.topbar-avatar{width:38px;height:38px;border-radius:13px;border:2px solid #fff;box-shadow:0 6px 18px rgba(59,47,149,.15)}.dash-avatar-link{text-decoration:none}.dash-avatar{width:46px;height:46px;border-radius:50%;border:2px solid rgba(255,255,255,.9);box-shadow:0 8px 20px rgba(24,18,92,.2)}.table-avatar{width:32px;height:32px;border-radius:10px;flex:0 0 auto;font-size:11px}.user-list-name{display:flex;align-items:center;gap:9px}.pwa-install-btn,.login-pwa-install{width:100%;border:1px solid rgba(91,66,232,.16);background:#f2f0ff;color:#5038d5;border-radius:14px;padding:11px 13px;font:700 10px inherit;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer}.pwa-install-btn[hidden],.login-pwa-install[hidden]{display:none!important}.login-pwa-install{margin-top:12px;background:#f4f2ff}.pwa-help[hidden]{display:none!important}.pwa-help{position:fixed;inset:0;z-index:500;background:rgba(26,24,58,.48);backdrop-filter:blur(5px);display:grid;place-items:end center;padding:18px}.pwa-help-card{position:relative;width:min(100%,420px);background:#fff;border-radius:25px;padding:25px 22px 22px;box-shadow:0 25px 80px rgba(31,26,87,.25)}.pwa-help-card b{font-size:17px}.pwa-help-card p{font-size:12px;line-height:1.8;color:#747b94;margin:10px 0 0}.pwa-help-close{position:absolute;left:14px;top:12px;border:0;background:#f1f2f7;width:32px;height:32px;border-radius:50%;font-size:22px;color:#555d76}.pdf-loading{opacity:.65;pointer-events:none;position:relative}.pdf-loading:after{content:"";width:14px;height:14px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:pdfspin .7s linear infinite;margin-inline-start:7px;display:inline-block;vertical-align:middle}@keyframes pdfspin{to{transform:rotate(360deg)}}
.profile-grid{display:grid;grid-template-columns:300px 1fr;gap:16px}.profile-card{text-align:center;display:flex;flex-direction:column;align-items:center}.profile-avatar-large{width:132px;height:132px;border-radius:38px;overflow:hidden;display:grid;place-items:center;background:linear-gradient(145deg,#6b4cf2,#2f7df6);color:#fff;font-size:48px;font-weight:800;box-shadow:0 18px 45px rgba(82,59,210,.22);margin:5px auto 14px}.profile-avatar-large img{width:100%;height:100%;object-fit:cover}.profile-card h3{font-size:19px;margin:4px 0}.profile-card p{color:#8a91a8;font-size:11px;margin:0 0 12px}.profile-upload-form{display:grid;gap:14px}.avatar-dropzone{border:1.5px dashed #cfc9fb;border-radius:22px;background:linear-gradient(145deg,#faf9ff,#f3f7ff);min-height:180px;display:flex!important;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;color:#5b42e8;cursor:pointer;padding:20px}.avatar-dropzone b{color:#282e4d;font-size:14px}.avatar-dropzone small{color:#8b92a8;max-width:320px}.avatar-dropzone input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.avatar-preview{width:112px;height:112px;border-radius:30px;overflow:hidden;border:3px solid #fff;box-shadow:0 10px 28px rgba(54,42,134,.16)}.avatar-preview img{width:100%;height:100%;object-fit:cover}
@media(max-width:720px){.profile-grid{grid-template-columns:1fr}.profile-card{padding:20px}.profile-avatar-large{width:112px;height:112px;border-radius:32px}.topbar-avatar{width:34px;height:34px}.pwa-help{padding:10px 10px calc(10px + var(--safe-bottom))}.pwa-help-card{border-radius:24px 24px 12px 12px}}
