/*
 * TAWAZON Audit — MEAAR Unified Interface V2
 * يحمّل بعد ملف MEAAR المرجعي للحفاظ على لغة عرض واحدة بين النظامين.
 */
:root{
  --tawazon-red:var(--mear-red,#8B0D18);
  --tawazon-red-2:var(--mear-red-2,#B11226);
  --tawazon-red-soft:var(--mear-red-soft,#FFF1F3);
  --tawazon-charcoal:var(--mear-charcoal,#1A1A1D);
  --tawazon-slate:var(--mear-slate,#667085);
  --tawazon-line:var(--mear-line,#E6E8EF);
  --tawazon-bg:var(--mear-bg,#F7F8FB);
  --tawazon-shadow:var(--mear-shadow,0 18px 45px rgba(26,26,29,.08));
}
html,body{max-width:100%;overflow-x:hidden}
body{background:var(--tawazon-bg)!important;color:#101828;font-family:Tahoma,Arial,sans-serif}

/* Header lockup: same MEAAR geometry, TAWAZON identity. */
.tawazon-lockup-box{
  width:340px!important;min-width:285px!important;max-width:360px!important;height:68px!important;
  padding:5px 0!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;
  gap:12px!important;overflow:visible!important;background:transparent!important;border:0!important;box-shadow:none!important
}
.tawazon-header-logo{
  width:58px!important;height:58px!important;object-fit:contain!important;border-radius:15px!important;
  background:#fff!important;padding:3px!important;box-shadow:0 10px 24px rgba(0,0,0,.22)!important;flex:0 0 auto
}
.tawazon-brand-copy{display:flex;flex-direction:column;line-height:1.35;min-width:0}
.tawazon-brand-copy strong{color:#fff!important;font-size:20px;font-weight:900;white-space:nowrap}
.tawazon-brand-copy small{color:#E7E8EE!important;font-size:11px;font-weight:700;white-space:nowrap}
.brand-actions{max-width:calc(100% - 360px)}
.active-engagement-chip{
  text-decoration:none!important;min-width:250px;max-width:370px;display:grid!important;
  grid-template-columns:auto auto;grid-template-areas:"label code" "client client";gap:1px 8px;
  padding:7px 12px!important;border-radius:14px!important;line-height:1.25
}
.active-engagement-chip span{grid-area:label;font-size:10px;color:#FFD9DE!important;font-weight:800}
.active-engagement-chip b{grid-area:code;color:#fff!important;font-size:12px;direction:ltr;text-align:left}
.active-engagement-chip small{grid-area:client;color:#fff!important;font-size:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.active-engagement-chip.is-empty{opacity:.86}
.tawazon-user-copy{display:flex;flex-direction:column;line-height:1.25}
.tawazon-user-copy b{color:#fff;font-size:12px;white-space:nowrap}.tawazon-user-copy small{color:#D0D5DD;font-size:10px;white-space:nowrap}
.tawazon-logout-form{margin:0}.tawazon-logout-form .mear-logout{border:0!important;box-shadow:none!important;min-height:auto!important;cursor:pointer;font-family:inherit}
.tawazon-admin-nav{margin-inline-start:auto}
.nav-disabled-item{display:block;padding:10px 12px;border-radius:10px;color:#98A2B3;background:#F8FAFC;font-size:12px;font-weight:700;cursor:not-allowed}
.top-main-nav>a.is-active{background:rgba(139,13,24,.70)!important;border-color:rgba(255,255,255,.18)!important;color:#fff!important}
.tawazon-public-header .brand-row{justify-content:center}.tawazon-public-nav{justify-content:center}

/* MEAAR page geometry for every audit screen. */
.main.main-top-layout{margin-right:0!important;min-height:calc(100vh - 118px);background:var(--tawazon-bg)!important}
.page-title-bar{height:58px!important;background:#fff!important;border-bottom:1px solid var(--tawazon-line)!important;padding:0 28px!important}
.page-title-bar h1{font-size:18px!important;color:#101828!important;font-weight:900!important}
.content{width:100%;max-width:1680px;margin:0 auto;padding:22px 28px 36px!important;box-sizing:border-box}
.content>.container,.content .container{width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
.tawazon-app-footer{text-align:center;padding:15px;color:#7B7380;font-size:11px}

/* Compatibility layer for the existing 74 audit templates. */
.card,.form-card,.table-card,.hero-card,.page-head,.stage-card,.risk-card,.summary-card,.panel,.side-panel,
.workflow-step,.audit-file-card,.command-metric,.cardless-panel,.report-standard-box,.detail-item,.empty-state,
.kpi,.kpi-card,.quick-run-form,.audit-section,.section-card{
  background:#fff!important;border:1px solid var(--tawazon-line)!important;border-radius:18px!important;
  box-shadow:0 10px 28px rgba(16,24,40,.05)!important
}
.card,.form-card,.table-card,.stage-card,.risk-card,.panel,.section-card{padding:18px!important;margin-bottom:16px}
.page-head,.hero-card{padding:22px 26px!important;background:radial-gradient(circle at 15% 0%,rgba(139,13,24,.08),transparent 40%),linear-gradient(135deg,#fff,#fff 58%,#fff4f5)!important}
.page-head h1,.page-head h2,.hero-card h1,.hero-card h2,h1,h2,h3,h4{color:#101828}
.page-head p,.hero-card p,.muted,.helper-text,.card-subtitle{color:var(--tawazon-slate)!important}

.button,a.button,.btn,a.btn,button,input[type="submit"]{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;
  border-radius:12px!important;padding:10px 16px!important;font-family:inherit;font-weight:900!important;cursor:pointer
}
.button:not(.secondary):not(.outline):not(.ghost),a.button:not(.secondary):not(.outline):not(.ghost),
.btn:not(.secondary):not(.outline),button:not(.secondary):not(.outline),input[type="submit"]{
  background:linear-gradient(135deg,#7D0715,#B11226)!important;color:#fff!important;border:0!important;
  box-shadow:0 10px 22px rgba(139,13,24,.18)!important
}
.button.secondary,.button.outline,.button.ghost,.btn.secondary,button.secondary,a.button.secondary,a.button.outline{
  background:#fff!important;color:#344054!important;border:1px solid var(--tawazon-line)!important;box-shadow:none!important
}
.button:hover,.btn:hover,button:hover{transform:translateY(-1px);filter:brightness(1.02)}

label,.field label,.form label{color:#344054!important;font-weight:900!important}
input,select,textarea,.form-control,.form-select{
  background:#fff!important;border:1px solid #D0D5DD!important;border-radius:12px!important;padding:11px 13px!important;
  color:#101828!important;font-family:inherit!important;box-shadow:none!important
}
input:focus,select:focus,textarea:focus{border-color:var(--tawazon-red)!important;box-shadow:0 0 0 3px rgba(139,13,24,.10)!important;outline:0!important}

.table-wrap{overflow:auto;border-radius:16px;border:1px solid var(--tawazon-line);background:#fff}
table,.table{width:100%;background:#fff!important;border-collapse:collapse!important;border-radius:16px;overflow:hidden}
th,td{padding:11px 10px!important;border-bottom:1px solid #EAECF0!important}
thead th,table th,.final-table th,.invoice-items th{background:#F9FAFB!important;color:#344054!important;font-weight:900!important}
tbody tr:nth-child(even){background:#FCFCFD!important}tbody tr:hover{background:#FFF6F7!important}

.msg,.alert,.notice{border-radius:14px!important;padding:12px 14px!important;margin-bottom:14px!important;box-shadow:none!important}
.msg.success,.alert-success{background:#ECFDF3!important;color:#067647!important;border:1px solid #ABEFC6!important}
.msg.error,.alert-danger{background:#FEF3F2!important;color:#B42318!important;border:1px solid #FECDCA!important}
.msg.warning,.alert-warning,.notice{background:#FFFAEB!important;color:#B54708!important;border:1px solid #FEDF89!important}
.msg.info,.alert-info{background:#EFF8FF!important;color:#175CD3!important;border:1px solid #B2DDFF!important}
.badge,.pill,.head-chip,.meta-badge,.status-pill{border-radius:999px!important;font-weight:900!important}

/* Login uses the exact MEAAR two-card composition. */
.tawazon-login-shell{grid-template-columns:440px minmax(0,1fr)!important}
.tawazon-login-brand img{object-fit:contain!important;border-radius:22px;background:#fff;padding:5px;border:1px solid #F3D4D8}
.tawazon-login-brand h1{font-size:34px!important;line-height:1.3}
.tawazon-login-side{align-items:center;text-align:center;overflow:hidden}
.tawazon-login-visual{width:100%;min-height:290px;display:grid;place-items:center;background:radial-gradient(circle,rgba(139,13,24,.10),transparent 62%);border-radius:22px}
.tawazon-login-side .mear-login-hero-img{width:min(100%,360px)!important;max-height:280px!important;object-fit:contain!important;background:#fff;padding:14px;border:1px solid #F1D0D5;border-radius:24px!important;box-shadow:0 18px 55px rgba(16,24,40,.10)!important}
.tawazon-login-capabilities{display:grid;grid-template-columns:1fr 1fr;gap:9px;width:100%}
.tawazon-login-capabilities span{background:#fff;border:1px solid var(--tawazon-line);border-radius:12px;padding:10px;font-size:12px;font-weight:900;color:#344054}

/* Dashboard: same card system and density as MEAAR. */
.tawazon-dashboard-shell{width:min(100%,1500px)!important;max-width:calc(100vw - 56px)!important}
.tawazon-hero-brand img{object-fit:contain!important;border-radius:13px!important;padding:2px;background:#fff}
.tawazon-kpi-row{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.tawazon-dashboard-grid{grid-template-columns:minmax(0,1.65fr) minmax(320px,.75fr)!important;align-items:start}
.tawazon-engagement-panel,.tawazon-status-panel{min-height:420px}
.tawazon-engagement-list{padding:12px 18px 20px;display:flex;flex-direction:column;gap:10px}
.tawazon-engagement-row{display:grid;grid-template-columns:minmax(230px,1.5fr) minmax(190px,1fr) minmax(190px,.9fr) auto;gap:14px;align-items:center;padding:15px;border:1px solid #EAECF0;border-radius:16px;background:#fff;position:relative}
.tawazon-engagement-row:hover{border-color:#E4B5BE;box-shadow:0 12px 28px rgba(16,24,40,.07)}
.tawazon-file-identity{display:flex;align-items:center;gap:12px;min-width:0}.tawazon-file-code{background:#FFF1F3;color:var(--tawazon-red);border-radius:10px;padding:8px 10px;font-weight:900;direction:ltr;white-space:nowrap}
.tawazon-file-identity h4{margin:0 0 4px;font-size:15px}.tawazon-file-identity small{color:#667085}
.tawazon-stage-summary{display:grid;grid-template-columns:1fr auto;gap:6px 8px;align-items:center}.tawazon-stage-summary>span{grid-column:1/-1;color:#344054;font-weight:800;font-size:12px}.tawazon-stage-summary>b{font-size:12px;color:var(--tawazon-red)}
.tawazon-progress{height:8px;background:#F2F4F7;border-radius:999px;overflow:hidden}.tawazon-progress i{display:block;height:100%;background:linear-gradient(90deg,#7D0715,#B11226);border-radius:999px}
.tawazon-file-signals{display:flex;gap:7px;flex-wrap:wrap}.tawazon-file-signals span{background:#F9FAFB;border:1px solid #EAECF0;border-radius:9px;padding:6px 8px;color:#667085;font-size:11px}.tawazon-file-signals b{color:#101828}
.tawazon-file-actions{display:flex;gap:6px}.tawazon-file-actions .mear-btn-main,.tawazon-file-actions .mear-btn-soft{padding:8px 11px;font-size:11px;white-space:nowrap}
.tawazon-blockers{grid-column:1/-1;display:flex;gap:6px;flex-wrap:wrap;border-top:1px solid #F2F4F7;padding-top:9px}.tawazon-blockers span{background:#FFF7ED;color:#B54708;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800}.tawazon-blockers.clean span{background:#ECFDF3;color:#067647}
.tawazon-empty-state{text-align:center;padding:60px 20px}.tawazon-empty-state p{color:#667085}
.tawazon-status-stack{padding:14px 20px 22px;display:flex;flex-direction:column;gap:10px}.tawazon-status-item{display:grid;grid-template-columns:1fr auto;gap:5px 12px;padding:14px;border:1px solid #EAECF0;border-radius:14px;background:#FCFCFD}.tawazon-status-item>span{font-weight:900;color:#344054}.tawazon-status-item>b{color:#101828}.tawazon-status-item>small{grid-column:1/-1;color:#667085}.status-ok{color:#067647!important}.status-bad{color:#B42318!important}
.tawazon-bottom-grid{grid-template-columns:1.1fr .9fr 1fr!important}.tawazon-shortcuts a,.tawazon-process-list a{color:var(--tawazon-red);text-decoration:none;font-weight:900}.tawazon-process-list b{min-width:62px}

/* Remove old visually heavy surfaces still referenced by a few legacy pages. */
.command-hero{background:radial-gradient(circle at 15% 0%,rgba(139,13,24,.08),transparent 40%),linear-gradient(135deg,#fff,#fff 60%,#fff4f5)!important;color:#101828!important;border:1px solid var(--tawazon-line)!important;box-shadow:var(--tawazon-shadow)!important}
.command-hero h1,.command-hero h2,.command-hero h3,.command-hero strong{color:#101828!important}.command-hero p,.command-hero span,.command-hero small{color:#667085!important}

@media(max-width:1250px){
  .brand-row{align-items:flex-start!important}.brand-actions{max-width:none;width:100%}.tawazon-lockup-box{width:300px!important;min-width:270px!important}
  .tawazon-dashboard-grid{grid-template-columns:1fr!important}.tawazon-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .tawazon-engagement-row{grid-template-columns:1fr 1fr}.tawazon-file-actions{justify-content:flex-end}
}
@media(max-width:800px){
  .content{padding:14px 12px 28px!important}.page-title-bar{padding:0 14px!important}
  .tawazon-lockup-box{width:auto!important;min-width:220px!important}.tawazon-brand-copy small{display:none}
  .active-engagement-chip{min-width:100%;max-width:none}.mear-user-box{width:100%;justify-content:flex-start}
  .tawazon-dashboard-shell{max-width:100%!important}.tawazon-kpi-row{grid-template-columns:1fr!important}
  .tawazon-engagement-row{grid-template-columns:1fr}.tawazon-file-actions{justify-content:flex-start}.tawazon-blockers{grid-column:1}
  .tawazon-bottom-grid{grid-template-columns:1fr!important}.tawazon-login-shell{grid-template-columns:1fr!important}.tawazon-login-side{display:none!important}
}
@media print{
  .top-nav-shell,.page-title-bar,.tawazon-app-footer{display:none!important}.content{padding:0!important;max-width:none!important}.main.main-top-layout{min-height:auto!important}
}
