/* =========================================================
   F BUSINESS — style.css (LIGHT PRO + Responsive + Safe)
   ✅ نفس الهيكل والكلاسات (No breaking changes)
   ✅ Light theme CRM + Glass + Smooth UI
   ✅ My Orders fixed (scroll inside card, no ugly squeeze)
   ✅ More Professional typography + calmer background
   ========================================================= */

/* =========================
   0) Font (Professional CRM)
   ========================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

/* =========================
   0) Tokens (Design System)
   ========================= */
:root{
  /* Brand */
  --brand-1:#00b7e3;
  --brand-2:#48e1b8;
  --brand-3:#2563eb;
  --brand-4:#7c3aed;

  /* Neutrals */
  --bg:#f5f7fb;
  --bg-2:#eef2ff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#667085;
  --muted-2:#94a3b8;
  --border:#e6eaf2;

  /* Effects */
  --shadow-sm:0 6px 16px rgba(15,23,42,.06);
  --shadow-md:0 14px 32px rgba(15,23,42,.10);
  --shadow-lg:0 22px 55px rgba(15,23,42,.14);

  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
  --radius-xl:24px;

  /* Focus */
  --ring:0 0 0 3px rgba(0,183,227,.18);

  /* Sidebar */
  --side:#020617;
  --side-2:#0b1224;
}

/* =========================
   0.1) Reset & Base
   ========================= */
*,
*::before,
*::after{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family:"Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Poppins", sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  color:var(--text);
}

a{ color:inherit; }

/* =========================
   1) Auth Pages (Login / Verify / Reset)
   ========================= */
.auth-body{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(0,183,227,.16) 0, transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(72,225,184,.14) 0, transparent 60%),
    radial-gradient(circle at 50% 110%, rgba(37,99,235,.10) 0, transparent 55%),
    var(--bg);
}

.auth-shell{
  width:100%;
  max-width:1080px;
  display:grid;
  grid-template-columns:minmax(0, 1.4fr) minmax(0, 1fr);
  gap:32px;
  align-items:stretch;
}

/* Brand side */
.brand-panel{
  position:relative;
  padding:40px 40px 32px;
  border-radius:var(--radius-xl);
  color:#ecfeff;
  overflow:hidden;
  background:linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow:0 20px 45px rgba(15,118,110,.26);
}

.brand-panel::before,
.brand-panel::after{
  content:"";
  position:absolute;
  border-radius:999px;
  filter:blur(34px);
  opacity:.42;
}

.brand-panel::before{
  width:230px;height:230px;
  background:rgba(255,255,255,.35);
  top:-70px; right:-50px;
}
.brand-panel::after{
  width:280px;height:280px;
  background:rgba(0,0,0,.14);
  bottom:-90px; left:-30px;
}

.brand-logo-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:24px;
  position:relative;
  z-index:1;
}

.brand-logo{ width:42px;height:42px; }
.brand-name{
  letter-spacing:.16em;
  text-transform:uppercase;
  font-size:12px;
  font-weight:800;
  opacity:.95;
}

.brand-title{
  margin:8px 0 12px;
  font-size:28px;
  line-height:1.25;
  max-width:420px;
  font-weight:900;
  position:relative;
  z-index:1;
}

.brand-subtitle{
  margin:0;
  max-width:440px;
  font-size:14px;
  opacity:.95;
  position:relative;
  z-index:1;
}

.brand-highlights{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:22px;
  position:relative;
  z-index:1;
}

.chip{
  padding:6px 12px;
  border-radius:999px;
  background:rgba(15,23,42,.14);
  border:1px solid rgba(240,253,250,.50);
  font-size:12px;
  backdrop-filter:blur(14px);
}

.brand-footer{
  margin-top:36px;
  font-size:12px;
  opacity:.85;
  position:relative;
  z-index:1;
}

/* Form side */
.form-panel{ display:flex; align-items:center; justify-content:center; }

.glass-card{
  width:100%;
  max-width:360px;
  padding:32px 30px 26px;
  border-radius:var(--radius-xl);
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(22px);
  box-shadow:var(--shadow-lg), 0 0 0 1px rgba(148,163,184,.35);
}

.form-header{ text-align:center; margin-bottom:20px; }
.form-logo{ width:48px;height:48px; margin-bottom:8px; }

.form-header h2{
  margin:0 0 6px;
  font-size:20px;
  color:var(--text);
  font-weight:900;
  letter-spacing:-.01em;
}

.form-caption{
  margin:0;
  font-size:13px;
  color:var(--muted);
}

.login-form{ display:flex; flex-direction:column; gap:12px; }

.input-group{ display:flex; flex-direction:column; gap:4px; text-align:left; }

.input-group label{
  font-size:13px;
  color:#4b5563;
  font-weight:700;
}

.input-group input,
.input-group select{
  width:100%;
  border-radius:12px;
  border:1px solid #d1d5db;
  padding:10px 12px;
  font-size:14px;
  background:#f9fafb;
  outline:none;
  appearance:none;
}

.input-group input:focus,
.input-group select:focus{
  border-color:var(--brand-1);
  background:#fff;
  box-shadow:var(--ring);
}

.form-footer-links{
  margin-top:14px;
  text-align:center;
}
.form-footer-links a{
  font-size:13px;
  color:#00a0cc;
  text-decoration:none;
  transition:color .15s ease;
}
.form-footer-links a:hover{ color:#0486aa; }

.single-panel{
  max-width:420px;
  grid-template-columns:minmax(0, 1fr);
}

/* Auth responsive */
@media (max-width:880px){
  .auth-shell{
    grid-template-columns:minmax(0,1fr);
    max-width:420px;
  }
  .brand-panel{ display:none; }
}

/* =========================
   2) Global Components (Shared)
   ========================= */
.flash{
  position:relative;
  padding:10px 12px;
  border-radius:12px;
  background:#ecfdf3;
  color:#166534;
  font-size:13px;
  margin-bottom:8px;
  border:1px solid rgba(22,101,52,.15);
  box-shadow:var(--shadow-sm);
  transition:opacity .35s ease, transform .35s ease;
}
.flash.flash-hide{ opacity:0; transform:translateY(-4px); }

/* Buttons */
.primary-btn{
  margin-top:8px;
  border:none;
  border-radius:999px;
  padding:11px 14px;
  font-size:15px;
  font-weight:900;
  color:#fff;
  cursor:pointer;
  background-image:linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow:0 12px 28px rgba(0,183,227,.32);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary-btn:hover{
  transform:translateY(-1px);
  filter:saturate(1.05);
  box-shadow:0 16px 34px rgba(0,183,227,.40);
}
.primary-btn:active{
  transform:translateY(0);
  box-shadow:0 10px 22px rgba(0,183,227,.30);
}

.secondary-btn{
  border-radius:999px;
  padding:8px 14px;
  font-size:13px;
  border:1px solid #d1d5db;
  background:#fff;
  color:#374151;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.secondary-btn:hover{
  background:#f9fafb;
  border-color:#cbd5e1;
  color:#111827;
  box-shadow:0 6px 14px rgba(15,23,42,.08);
  transform:translateY(-1px);
}

.danger-btn{
  border-color:#fca5a5;
  color:#b91c1c;
}
.danger-btn:hover{
  background:#fef2f2;
  border-color:#f97373;
  color:#991b1b;
}

.secondary-btn.small-btn,
.primary-btn.small-btn{
  padding:4px 10px;
  font-size:12px;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.secondary-btn.danger-btn:disabled{
  opacity:.55;
  cursor:default;
  box-shadow:none;
  transform:none;
}

.table-link{ color:#00a0cc; text-decoration:none; }
.table-link:hover{ text-decoration:underline; }

.contact-cell{
  display:flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}
.contact-icon-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* Search input */
.search-input{
  border-radius:999px;
  border:1px solid #d1d5db;
  background:#f9fafb;
  padding:8px 12px;
  font-size:13px;
  min-width:220px;
  outline:none;
  transition:box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.search-input:focus{
  border-color:var(--brand-1);
  background:#fff;
  box-shadow:var(--ring);
}

/* Helper: Big numbers (KPI) */
.big-number{
  margin-top:6px;
  font-size:26px;
  font-weight:900;
  letter-spacing:-.02em;
  color:var(--text);
}

/* =========================
   3) Dashboard Layout
   ========================= */
.dash-body{
  margin:0;
  background:
    radial-gradient(circle at 10% 0%, rgba(0,183,227,.07) 0, transparent 42%),
    radial-gradient(circle at 90% 20%, rgba(72,225,184,.06) 0, transparent 44%),
    radial-gradient(circle at 50% 110%, rgba(124,58,237,.05) 0, transparent 55%),
    var(--bg);
}

.dash-shell{
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  min-height:100vh;
}

/* Sidebar */
.dash-sidebar{
  background:linear-gradient(180deg, var(--side), var(--side-2));
  color:#e5e7eb;
  padding:20px 18px;
  display:flex;
  flex-direction:column;
  border-right:1px solid rgba(148,163,184,.10);
}

.dash-logo-row{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  margin-bottom:32px;
  padding-top:8px;
}

.dash-logo{ width:32px;height:32px; filter:drop-shadow(0 8px 18px rgba(0,0,0,.35)); }

.dash-logo-text{
  font-size:13px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#9ca3af;
}

.dash-nav{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:10px;
}

.dash-nav-item{
  padding:9px 10px;
  border-radius:12px;
  font-size:14px;
  color:#9ca3af;
  text-decoration:none;
  display:block;
  transition:background .15s ease, color .15s ease, transform .12s ease;
}

.dash-nav-item:hover{
  background:rgba(148,163,184,.10);
  color:#e5e7eb;
  transform:translateY(-1px);
}

.dash-nav-item.active{
  background:linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color:#fff;
  box-shadow:0 10px 25px rgba(0,183,227,.18);
}

.dash-nav-divider{
  margin:16px 0;
  border-top:1px solid rgba(148,163,184,.35);
}

.dash-nav-secondary .dash-nav-item{
  font-size:13px;
  opacity:.9;
}

.dash-sidebar-footer{
  margin-top:auto;
  padding-top:18px;
  border-top:1px solid rgba(148,163,184,.22);
  display:flex;
  justify-content:center;
}

.dash-logout{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:7px 14px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  color:#fecaca;
  background:rgba(248,113,113,.08);
  border:1px solid rgba(248,113,113,.40);
  text-decoration:none;
  transition:transform .2s ease, background .2s ease, color .2s ease;
}
.dash-logout::before{ content:"⎋"; font-size:13px; }
.dash-logout:hover{
  background:rgba(248,113,113,.16);
  color:#fee2e2;
  transform:translateY(-1px);
}

/* Main area */
.dash-main{
  padding:22px 26px 28px;
}



/* Header */
.dash-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:4px;
}
.dash-header h1{
  margin:0 0 4px;
  font-size:24px;
  color:var(--text);
  font-weight:900;
  letter-spacing:-.01em;
}
.dash-header-sub{
  margin:0;
  font-size:14px;
  color:var(--muted);
}

.dash-header .primary-btn,
.dash-header .secondary-btn{ margin-top:0; }

.header-actions{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

/* Grid & Cards */
.dash-grid{
  margin-top:20px;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  gap:16px;
}

.dash-card{
  background:rgba(255,255,255,.94);
  border-radius:var(--radius-lg);
  padding:18px 18px 16px;
  border:1px solid rgba(148,163,184,.22);
  box-shadow:var(--shadow-md);
  backdrop-filter:blur(10px);
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.dash-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-lg);
  border-color:rgba(0,183,227,.22);
}

.dash-card h2{
  margin:0 0 4px;
  font-size:16px;
  color:var(--text);
  font-weight:900;
}

.dash-card-sub{
  margin:0 0 12px;
  font-size:13px;
  color:var(--muted);
}

/* Simple stats */
.dash-stats{ display:flex; flex-wrap:wrap; gap:12px; }

.stat{
  background:linear-gradient(180deg, #ffffff, #f9fafb);
  border-radius:14px;
  padding:10px 12px;
  min-width:90px;
  border:1px solid rgba(148,163,184,.18);
}

.stat-label{
  display:block;
  font-size:11px;
  color:var(--muted);
}
.stat-value{
  font-size:18px;
  font-weight:900;
  color:#111827;
}

.dash-list{
  margin:8px 0 0;
  padding-left:18px;
  font-size:13px;
  color:#4b5563;
}

.dash-shortcuts{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.dash-btn{
  border-radius:999px;
  border:none;
  padding:8px 14px;
  font-size:13px;
  cursor:pointer;
  background-image:linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color:#fff;
  font-weight:900;
  box-shadow:0 10px 22px rgba(0,183,227,.20);
}

.dash-btn.outline{
  background:transparent;
  border:1px solid var(--brand-1);
  color:#0284a8;
}

/* =========================
   4) Forms & Tables (Employees / Customers / Requests / Orders)
   ========================= */
.dash-grid-wide{ grid-template-columns:minmax(0, 1.2fr) minmax(0, 1fr); }
.dash-grid-opps{ grid-template-columns:minmax(0, 1fr); }
.dash-grid-customers{ grid-template-columns:minmax(0, .9fr) minmax(0, 1.5fr); }

.emp-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:8px;
}

.emp-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.emp-submit-btn{ align-self:flex-start; margin-top:6px; }

/* Table wrap */
.emp-table-wrap{
  margin-top:10px;
  max-height:380px;
  overflow-y:auto;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:14px;
}

/* Requests page */
.emp-table-wrap-full{
  max-height:800px;
  overflow-y:auto;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:14px;
}

/* Unified table */
.emp-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  background:#fff;
}

/* Borders */
.emp-table thead tr{ border-bottom:1px solid var(--border); }
.emp-table tbody tr{ border-bottom:1px solid var(--border); }

/* Cells */
.emp-table th,
.emp-table td{
  padding:10px 12px;
  text-align:left;
  vertical-align:middle;
}

/* Header sticky inside scroll wrapper */
.emp-table th{
  font-weight:900;
  font-size:12px;
  color:#475569;
  background:linear-gradient(180deg, #ffffff, #f9fafb);
  position:sticky;
  top:0;
  z-index:1;
}

/* Body */
.emp-table td{
  font-size:13px;
  color:#111827;
}

.emp-table tbody tr:hover{ background:#f8fafc; }

/* Actions col default */
.emp-table th:last-child,
.emp-table td:last-child{
  width:120px;
  text-align:center;
  white-space:nowrap;
}

.emp-empty{
  text-align:center;
  color:#9ca3af;
  font-style:italic;
}

/* Actions icons */
.emp-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.inline-form{ display:inline-block; margin:0; }

.icon-btn{
  border:none;
  background:transparent;
  cursor:pointer;
  padding:4px;
  border-radius:10px;
  transition:background .2s ease, transform .2s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.icon-img{
  width:17px;height:17px;
  display:block;
  opacity:.85;
  transition:opacity .25s ease, transform .2s ease;
}

.icon-btn.secondary:hover{ background:rgba(0,183,227,.10); }
.icon-btn.danger:hover{ background:rgba(239,68,68,.10); }

.icon-btn:hover{
  background:#e5e7eb;
  transform:translateY(-1px);
}
.icon-btn:hover .icon-img{
  opacity:1;
  transform:scale(1.1);
}

/* Form action rows */
.form-actions{
  margin-top:12px;
  display:flex;
  align-items:center;
  gap:10px;
}

.form-actions-row{
  margin-top:14px;
  display:flex;
  align-items:center;
  gap:10px;
}
.form-actions-row .primary-btn{ margin-top:0; }

/* Cancel link */
.btn-secondary-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 14px;
  border-radius:999px;
  font-size:13px;
  color:var(--muted);
  background:#f3f4f6;
  text-decoration:none;
  border:1px solid var(--border);
  transition:background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-secondary-link::before{ content:"↩"; font-size:13px; }
.btn-secondary-link:hover{
  background:#e5e7eb;
  color:#374151;
  border-color:#d1d5db;
}

/* Subtitle above stage tables */
.table-subtitle{
  margin:18px 0 6px;
  font-size:13px;
  font-weight:900;
  color:#334155;
}

/* ✅ Stage title aligned with table content */
.myorders-page .table-subtitle{
  margin: 16px 0 10px !important;   /* مسافة ثابتة */
  padding-inline: 12px;             /* نفس padding خلايا الجدول */
  display: block;
  width: 100%;
  clear: both;
  text-align: start;
}

/* ✅ My Orders: scroll inside card when table is long */
.myorders-page .emp-table-wrap.orders-table-wrap{
  margin-top: 0;                    /* خله زي ما هو */
  max-height: 520px;                /* عدّل الرقم حسب اللي تبيه */
  overflow-y: auto !important;      /* هذا أهم سطر */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}





/* Requests list table (fixed widths) */
.requests-table{
  table-layout:fixed;
  width:100%;
}
.requests-table th:nth-child(1),
.requests-table td:nth-child(1){ width:12%; }
.requests-table th:nth-child(2),
.requests-table td:nth-child(2){ width:12%; }
.requests-table th:nth-child(3),
.requests-table td:nth-child(3){ width:28%; }
.requests-table th:nth-child(4),
.requests-table td:nth-child(4){ width:12%; }
.requests-table th:nth-child(5),
.requests-table td:nth-child(5){ width:12%; }
.requests-table th:nth-child(6),
.requests-table td:nth-child(6){ width:10%; }
.requests-table th:nth-child(7),
.requests-table td:nth-child(7){ width:14%; }

/* =========================
   5) Modals (Two Systems Supported)
   ========================= */
.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:40;
}
.modal.show,
.modal.open{ display:flex; }

.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.45);
  backdrop-filter:blur(6px);
}

.modal-panel,
.modal-dialog{
  position:relative;
  background:#fff;
  border-radius:18px;
  padding:18px 20px 16px;
  box-shadow:0 20px 40px rgba(15,23,42,.25);
  width:100%;
  z-index:1;
  border:1px solid rgba(148,163,184,.25);
}

.modal-panel{ max-width:320px; }
.modal-dialog{ max-width:420px; }

.modal-title{
  margin:0 0 6px;
  font-size:16px;
  color:var(--text);
  font-weight:900;
}
.modal-text{
  margin:0 0 14px;
  font-size:13px;
  color:var(--muted);
}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

/* Legacy modal buttons */
.btn-secondary,
.btn-danger{
  min-width:80px;
  border-radius:999px;
  padding:6px 12px;
  font-size:13px;
  border:none;
  cursor:pointer;
}
.btn-secondary{ background:#f3f4f6; color:#374151; }
.btn-secondary:hover{ background:#e5e7eb; }

.btn-danger{
  background:#ef4444;
  color:#fff;
  box-shadow:0 8px 18px rgba(239,68,68,.35);
}
.btn-danger:hover{ background:#dc2626; }

/* New system modal form */
.modal-dialog h3{
  margin:0 0 14px;
  font-size:18px;
  color:var(--text);
  font-weight:900;
}

.modal-dialog form{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.modal-field-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px 12px;
}

.field-block{ display:flex; flex-direction:column; gap:4px; }
.field-block label{
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}

.field-block input,
.field-block select{
  border-radius:12px;
  border:1px solid #d1d5db;
  padding:9px 10px;
  font-size:13px;
  background:#f9fafb;
  outline:none;
}

.field-block input:focus,
.field-block select:focus{
  border-color:var(--brand-1);
  background:#fff;
  box-shadow:var(--ring);
}

.modal-dialog .modal-actions{
  margin-top:16px;
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.modal-dialog .modal-actions .primary-btn,
.modal-dialog .modal-actions .secondary-btn{
  margin-top:0;
  font-size:13px;
  padding:8px 18px;
}

.confirm-modal .modal-dialog{ max-width:380px; }
.confirm-modal h3{ margin-bottom:8px; }
.confirm-modal .confirm-message{
  font-size:13px;
  color:#4b5563;
  margin-bottom:16px;
}

/* =========================
   6) Opportunity Detail
   ========================= */
.detail-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px 16px;
  font-size:13px;
}

.detail-row{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:10px 12px;
  border-radius:14px;
  background:linear-gradient(180deg, #ffffff, #f9fafb);
  border:1px solid rgba(148,163,184,.20);
  box-shadow:var(--shadow-sm);
}

.detail-label{
  font-size:11px;
  color:#9ca3af;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:2px;
}
.detail-value{
  font-size:13px;
  color:#111827;
  font-weight:900;
  text-align:left;
}
.detail-value-accent{ color:#2563eb; font-weight:900; }
.detail-value-discount{ color:#059669; font-weight:900; }

.detail-notes{
  margin-top:6px;
  font-size:13px;
  color:#4b5563;
  background:#f9fafb;
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(148,163,184,.18);
}

.opp-actions .primary-btn{ margin-top:0; }

/* SIM fields */
.sim-row{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:8px;
}
.sim-row label{ font-size:12px; color:var(--muted); font-weight:800; }
.sim-row input{
  border-radius:12px;
  border:1px solid #d1d5db;
  padding:9px 10px;
  font-size:13px;
  background:#f9fafb;
  outline:none;
}
.sim-row input:focus{
  border-color:var(--brand-1);
  background:#fff;
  box-shadow:var(--ring);
}

.remove-row{
  border:none;
  background:#fee2e2;
  color:#b91c1c;
  width:24px;
  height:24px;
  border-radius:999px;
  font-size:16px;
  line-height:1;
  cursor:pointer;
}
.remove-row:hover{ background:#fecaca; }

/* =========================
   7) Service Details (Request Detail / Operation)
   ========================= */
.service-details-card .emp-table{ table-layout:fixed; }

.service-details-card .emp-table th:nth-child(1),
.service-details-card .emp-table td:nth-child(1){ width:5%; }

.service-details-card .emp-table th:nth-child(2),
.service-details-card .emp-table td:nth-child(2){ width:20%; }

.service-details-card .emp-table th:nth-child(n+3),
.service-details-card .emp-table td:nth-child(n+3){ width:18.75%; }

.service-details-card .emp-table .service-input{
  width:100%;
  border-radius:10px;
  border:1px solid #d1d5db;
  padding:6px 8px;
  font-size:13px;
  background:#f9fafb;
  outline:none;
}

.service-details-card .emp-table .service-input:focus{
  border-color:#06b6d4;
  background:#fff;
  box-shadow:0 0 0 3px rgba(6,182,212,.15);
}

.service-toolbar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.service-toolbar .upload-form input[type="file"]{ font-size:12px; }

/* =========================
   8) Reports
   ========================= */
.reports-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:16px;
  margin-bottom:24px;
}

.report-card{
  position:relative;
  background:rgba(255,255,255,.94);
  border-radius:18px;
  padding:16px 18px 14px;
  border:1px solid rgba(148,163,184,.22);
  box-shadow:var(--shadow-md);
  display:flex;
  flex-direction:column;
  gap:6px;
  backdrop-filter:blur(10px);
  transition:transform .16s ease, box-shadow .16s ease;
}
.report-card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  border-top:3px solid transparent;
  pointer-events:none;
}
.reports-cards .report-card:nth-child(1)::before{ border-top-color:#eab308; }
.reports-cards .report-card:nth-child(2)::before{ border-top-color:#22c55e; }
.reports-cards .report-card:nth-child(3)::before{ border-top-color:#2563eb; }
.reports-cards .report-card:nth-child(4)::before{ border-top-color:#a855f7; }
.reports-cards .report-card:nth-child(5)::before{ border-top-color:#ef4444; }
.reports-cards .report-card:nth-child(6)::before{ border-top-color:#f59e0b; }
.reports-cards .report-card:nth-child(7)::before{ border-top-color:#4f46e5; }

.report-card h3{ font-size:.95rem; margin-bottom:8px; opacity:.92; font-weight:900; }
.report-number{ font-size:2rem; font-weight:900; letter-spacing:.01em; color:var(--text); }
.report-note{ font-size:.80rem; opacity:.75; color:var(--muted); }

.report-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }

.reports-tables-wrapper{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:20px; /* ✅ fixed */
}

.reports-table-card{
  background:rgba(255,255,255,.78);
  border-radius:16px;
  padding:16px 18px;
  border:1px solid rgba(148,163,184,.20);
  backdrop-filter:blur(10px);
}

.reports-table-card h2{ font-size:1.05rem; margin-bottom:10px; font-weight:900; }

/* Reports filters */
.reports-filters-card{ margin:14px 0 20px; }

.reports-filters-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.reports-filters-summary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}

.filters-chip{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 10px;
  border-radius:999px;
  background:#eff6ff;
  border:1px solid rgba(59,130,246,.20);
  font-size:11px;
  color:#1d4ed8;
}
.filters-chip .chip-label{ opacity:.7; }
.filters-chip .chip-value{ font-weight:900; }

.filters-clear-link{
  font-size:12px;
  color:var(--muted);
  text-decoration:none;
  margin-left:4px;
}
.filters-clear-link:hover{ text-decoration:underline; color:#374151; }

.reports-filters-layout{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr)) minmax(0, 180px);
  gap:16px;
  align-items:flex-end;
}

.filters-actions-inline{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
.filters-column{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.filters-dates-row{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.filters-actions{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

/* =========================
   9) Requests Dashboard Cards
   ========================= */
.dash-header-meta{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:4px;
}

.dash-header-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  background:#e0f2fe;
  color:#1d4ed8;
  border:1px solid rgba(59,130,246,.25);
  font-weight:900;
}

.request-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:18px 18px 14px;
  border-radius:20px;
  overflow:hidden;
  border:1px solid rgba(148,163,184,.20);
}

.request-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.request-card-title{
  margin:0 0 4px;
  font-size:15px;
  font-weight:900;
  color:var(--text);
}

.request-card-status-pill{
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border-radius:999px;
  font-size:11px;
  color:var(--text);
  background:rgba(148,163,184,.14);
  font-weight:900;
}

.request-card-icon{
  width:36px;height:36px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
  color:var(--text);
  background:rgba(255,255,255,.92);
  box-shadow:0 6px 14px rgba(15,23,42,.12);
}

.request-card-count-row{
  display:flex;
  align-items:baseline;
  gap:6px;
}

.request-card-count{
  font-size:26px;
  font-weight:900;
  color:var(--text);
}

.request-card-count-label{
  font-size:12px;
  color:var(--muted);
}

.request-card-footer{ margin-top:auto; }

.request-card-link{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:13px;
  color:#0284c7;
  text-decoration:none;
  font-weight:900;
}
.request-card-link:hover{ text-decoration:underline; }

/* Background tint per status */
.request-card-operation{
  background:radial-gradient(circle at top right, rgba(56,189,248,.18), transparent 60%), #f0f9ff;
}
.request-card-contract{
  background:radial-gradient(circle at top right, rgba(251,191,36,.16), transparent 60%), #fffbeb;
}
.request-card-open{
  background:radial-gradient(circle at top right, rgba(52,211,153,.16), transparent 60%), #ecfdf5;
}
.request-card-installation{
  background:radial-gradient(circle at top right, rgba(94,234,212,.16), transparent 60%), #ecfeff;
}
.request-card-posted{
  background:radial-gradient(circle at top right, rgba(129,140,248,.18), transparent 60%), #eef2ff;
}

/* Icon color match */
.request-card-operation .request-card-icon{ background:#0ea5e9; color:#ecfeff; }
.request-card-contract  .request-card-icon{ background:#f59e0b; color:#fffbeb; }
.request-card-open      .request-card-icon{ background:#10b981; color:#ecfdf5; }
.request-card-installation .request-card-icon{ background:#14b8a6; color:#ecfeff; }
.request-card-posted    .request-card-icon{ background:#4f46e5; color:#eef2ff; }

.request-card:hover{
  box-shadow:var(--shadow-md);
  transform:translateY(-1px);
  transition:box-shadow .18s ease, transform .18s ease;
}

/* =========================
   10) My Orders (FIXED + Beautiful)
   ========================= */
.dash-card-header-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.dash-card-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.icon-circle-btn{
  border:none;
  background:#f3f4f6;
  border-radius:999px;
  width:36px;height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,.10);
  transition:transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.icon-circle-btn i{ font-size:14px; }
.icon-circle-btn:hover{
  transform:translateY(-1px);
  background:#eef2f7;
  box-shadow:0 10px 22px rgba(15,23,42,.14);
}

.table-toolbar{
  display:flex;
  gap:8px;
  align-items:center;
}

/* ✅ keep old class but force center */
.orders-search-row{
  display:flex;
  justify-content:center !important;
  margin:6px 0 10px;
}

/* ✅ Optional classes (if you use them later) */
.myorders-search-row{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  margin:10px 0 14px;
}
.myorders-search-box{
  width:100%;
  max-width:520px;
}
.myorders-search-box .orders-search-input{
  width:100%;
}

/* ✅ Orders table wrapper: scroll inside card */
.orders-table-wrap{
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  border-radius:14px;
  scrollbar-gutter:stable;
}

/* ========= Orders table: consistent columns (all stages) ========= */
.myorders-page .orders-table{
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 1100px; /* baseline desktop */
}

/* fixed widths */
.myorders-page .orders-table th:nth-child(1),
.myorders-page .orders-table td:nth-child(1){ width: 180px; } /* AM */
.myorders-page .orders-table th:nth-child(2),
.myorders-page .orders-table td:nth-child(2){ width: 120px; } /* Request */
.myorders-page .orders-table th:nth-child(3),
.myorders-page .orders-table td:nth-child(3){ width: 160px; } /* Quote */
.myorders-page .orders-table th:nth-child(4),
.myorders-page .orders-table td:nth-child(4){ width: 360px; } /* Customer */
.myorders-page .orders-table th:nth-child(5),
.myorders-page .orders-table td:nth-child(5){ width: 300px; } /* Product */
.myorders-page .orders-table th:nth-child(6),
.myorders-page .orders-table td:nth-child(6){ width: 130px; } /* Service */
.myorders-page .orders-table th:nth-child(7),
.myorders-page .orders-table td:nth-child(7){ width: 140px; } /* Status */
.myorders-page .orders-table th:nth-child(8),
.myorders-page .orders-table td:nth-child(8){ width: 120px; } /* Action */

.myorders-page .orders-table td:nth-child(4),
.myorders-page .orders-table td:nth-child(5){
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ========= Responsive tuning ========= */
@media (max-width: 1200px){
  .myorders-page .orders-table{ min-width: 980px; }
  .myorders-page .orders-table th:nth-child(4),
  .myorders-page .orders-table td:nth-child(4){ width: 300px; }
  .myorders-page .orders-table th:nth-child(5),
  .myorders-page .orders-table td:nth-child(5){ width: 260px; }
}

@media (max-width: 900px){
  .myorders-page .orders-table{ min-width: 920px; }
  .myorders-page .orders-table th:nth-child(1),
  .myorders-page .orders-table td:nth-child(1){ width: 160px; }
  .myorders-page .orders-table th:nth-child(4),
  .myorders-page .orders-table td:nth-child(4){ width: 260px; }
  .myorders-page .orders-table th:nth-child(5),
  .myorders-page .orders-table td:nth-child(5){ width: 240px; }
}


/* keep readable */
.orders-table th,
.orders-table td{
  white-space:nowrap;
  text-align:left !important;
  vertical-align:middle;
}

/* allow wrap only for Customer / Product columns */
.orders-table th:nth-child(4),
.orders-table td:nth-child(4),
.orders-table th:nth-child(5),
.orders-table td:nth-child(5){
  white-space:normal;
  word-break:break-word;
  min-width:240px;
  max-width:340px;
}

/* Good min widths */
.orders-table th:nth-child(1),
.orders-table td:nth-child(1){ min-width:170px; }
.orders-table th:nth-child(2),
.orders-table td:nth-child(2){ min-width:120px; }
.orders-table th:nth-child(3),
.orders-table td:nth-child(3){ min-width:140px; }
.orders-table th:nth-child(6),
.orders-table td:nth-child(6){ min-width:120px; }
.orders-table th:nth-child(7),
.orders-table td:nth-child(7){ min-width:120px; }
.orders-table th:nth-child(8),
.orders-table td:nth-child(8){ min-width:120px; }

/* Action column */
.orders-table th:last-child,
.orders-table td:last-child{
  text-align:left !important;
  width:auto;
}

/* Status badges */
.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
  background:#e5e7eb;
  color:#374151;
  border:1px solid rgba(148,163,184,.16);
}

.status-operation{ background:#e0f2fe; color:#1d4ed8; }
.status-contract-approval{ background:#fffbeb; color:#b45309; }
.status-open{ background:#ecfdf5; color:#047857; }
.status-installation{ background:#ecfeff; color:#0f766e; }
.status-posted{ background:#eef2ff; color:#4338ca; }

/* Nice scrollbar (WebKit) */
.orders-table-wrap::-webkit-scrollbar{ height:10px; }
.orders-table-wrap::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.35);
  border-radius:999px;
}
.orders-table-wrap::-webkit-scrollbar-track{
  background:rgba(148,163,184,.14);
  border-radius:999px;
}

/* =========================
   11) Full Page Loading Overlay
   ========================= */
.page-loading-overlay{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.55);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:18px;
}
.page-loading-overlay.is-visible{ display:flex; }

.page-loading-box{
  width:min(420px, 92vw);
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  border-radius:18px;
  padding:18px 16px;
  text-align:center;
  color:#fff;
}

.page-loading-spinner{
  width:34px;height:34px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.25);
  border-top-color:rgba(255,255,255,.95);
  margin:6px auto 12px;
  animation:pageLoadingSpin .9s linear infinite;
}
.page-loading-text{ font-size:14px; line-height:1.5; opacity:.95; }

body.loading-lock{ overflow:hidden; }

@keyframes pageLoadingSpin{ to{ transform:rotate(360deg); } }

/* =========================
   12) Responsive (Grouped & Safe)
   ========================= */
.mobile-nav-toggle,
.mobile-nav-close,
.mobile-nav-overlay{ display:none; }

@media (max-width:900px){
  .dash-shell{ grid-template-columns:1fr; }

  .dash-sidebar{
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:min(300px, 86vw);
    z-index:1000;
    padding:16px 14px;
    overflow-y:auto;
    overscroll-behavior:contain;
    box-shadow:18px 0 40px rgba(0,0,0,.35);
    transform:translateX(-105%);
    transition:transform .25s ease;
    will-change:transform;
  }

  [dir="rtl"] .dash-sidebar{
    left:auto;
    right:0;
    transform:translateX(105%);
    box-shadow:-18px 0 40px rgba(0,0,0,.35);
  }

  .mobile-nav-overlay{
    position:fixed;
    inset:0;
    z-index:999;
    background:rgba(2,6,23,.55);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
  }

  .mobile-nav-toggle{
    display:inline-flex;
    position:fixed;
    top:14px;
    left:14px;
    z-index:1100;
    width:42px;height:42px;
    border-radius:14px;
    border:1px solid rgba(148,163,184,.25);
    background:rgba(2,6,23,.78);
    color:#e5e7eb;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 10px 25px rgba(0,0,0,.28);
    transition:transform .15s ease, background .15s ease;
  }
  [dir="rtl"] .mobile-nav-toggle{ left:auto; right:14px; }
  .mobile-nav-toggle:hover{
    transform:translateY(-1px);
    background:rgba(2,6,23,.88);
  }

  .mobile-nav-close{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;height:38px;
    border-radius:12px;
    border:1px solid rgba(148,163,184,.22);
    background:rgba(148,163,184,.10);
    color:#e5e7eb;
    cursor:pointer;
    margin-left:auto;
    flex:0 0 auto;
  }
  [dir="rtl"] .mobile-nav-close{
    margin-left:0;
    margin-right:auto;
  }

  .dash-logo-row{
    margin-bottom:18px;
    padding-top:4px;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }
  .dash-logo{ width:28px;height:28px; }
  .dash-logo-text{ display:none; }

  .dash-nav{ margin-top:0; gap:6px; padding-bottom:0; }
  .dash-nav-item{
    white-space:nowrap;
    padding:10px 12px;
    font-size:14px;
    border-radius:12px;
  }

  .dash-sidebar-footer{
    margin-top:auto;
    padding-top:14px;
    border-top:1px solid rgba(148,163,184,.22);
    display:flex;
    justify-content:center;
  }

  .dash-main{
    padding:16px 14px 20px;
    padding-top:70px;
  }

  .dash-grid-wide,
  .dash-grid-customers{ grid-template-columns:minmax(0, 1fr); }

  .emp-row{ grid-template-columns:minmax(0, 1fr); }

  .reports-filters-layout{ grid-template-columns:minmax(0, 1fr); }

  .reports-filters-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .reports-filters-summary{ justify-content:flex-start; }

  body.sidebar-open .dash-sidebar{ transform:translateX(0); }
  [dir="rtl"] body.sidebar-open .dash-sidebar{ transform:translateX(0); }

  body.sidebar-open .mobile-nav-overlay{
    opacity:1;
    pointer-events:auto;
  }

  .dash-sidebar::-webkit-scrollbar{ width:10px; }
  .dash-sidebar::-webkit-scrollbar-thumb{
    background:rgba(148,163,184,.18);
    border-radius:999px;
  }

  /* Orders KPI cards stack on mobile */
  .myorders-kpis{ grid-template-columns:1fr !important; }
}

@media (max-width:640px){
  .dash-header{
    flex-direction:column;
    align-items:flex-start;
  }
  .dash-nav-item{
    padding:9px 10px;
    font-size:13px;
  }
}

/* Opportunity detail grid */
@media (max-width:1024px){
  .detail-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width:640px){
  .detail-grid{ grid-template-columns:minmax(0, 1fr); }
  .dash-header-meta{ margin-top:6px; }
}
