@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root{
  --sab-red:#d71920;
  --sab-red-dark:#a90f16;
  --sab-black:#111111;
  --sab-dark:#171717;
  --sab-text:#202124;
  --sab-muted:#6b7280;
  --sab-soft:#f5f6f8;
  --sab-border:#e5e7eb;
  --sab-card:#ffffff;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: Inter, Manrope, Arial, sans-serif;
  color:var(--sab-text);
  background:#fff;
}

html[dir="rtl"] body,
html[dir="rtl"] .btn,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] button{
  font-family: 'IBM Plex Sans Arabic', Inter, Arial, sans-serif;
}

a{text-decoration:none;color:inherit}

.btn-sab{
  background:var(--sab-red);
  color:#fff;
  border:0;
  border-radius:0;
  padding:13px 24px;
  font-weight:700;
  transition:.2s ease;
}

.btn-sab:hover{
  background:var(--sab-red-dark);
  color:#fff;
  transform:translateY(-1px);
}

.btn-outline-sab{
  border:1px solid var(--sab-red);
  color:var(--sab-red);
  background:#fff;
  border-radius:0;
  padding:12px 22px;
  font-weight:700;
}

.btn-outline-sab:hover{
  background:var(--sab-red);
  color:#fff;
}

.sab-header{
  min-height:82px;
  border-bottom:1px solid var(--sab-border);
  background:#fff;
}

.sab-logo-mark{
  width:48px;
  height:48px;
  background:var(--sab-red);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:900;
  letter-spacing:-1px;
}

.sab-logo-text{
  font-weight:900;
  letter-spacing:.02em;
  font-size:22px;
}

.platform-badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 12px;
  background:#fff;
  border-left:4px solid var(--sab-red);
  box-shadow:0 12px 35px rgba(0,0,0,.08);
  font-size:13px;
  color:var(--sab-muted);
}

.hero{
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 75% 20%, rgba(215,25,32,.10), transparent 28%),
    linear-gradient(135deg,#fff 0%,#fff 48%,#f7f7f8 48%,#f7f7f8 100%);
  min-height:650px;
  display:flex;
  align-items:center;
}

.hero:after{
  content:"";
  position:absolute;
  right:-80px;
  top:90px;
  width:420px;
  height:420px;
  border:42px solid rgba(215,25,32,.08);
  transform:rotate(20deg);
}

.hero-title{
  font-size:64px;
  line-height:1.02;
  letter-spacing:-.055em;
  font-weight:900;
  max-width:720px;
}

.hero-copy{
  font-size:18px;
  line-height:1.75;
  color:var(--sab-muted);
  max-width:620px;
}

.visual-panel{
  position:relative;
  z-index:1;
  background:#fff;
  border:1px solid var(--sab-border);
  box-shadow:0 24px 70px rgba(0,0,0,.12);
  padding:28px;
}

.visual-panel-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-bottom:18px;
  border-bottom:1px solid var(--sab-border);
}

.qr-demo{
  width:150px;
  height:150px;
  background:
    linear-gradient(90deg,#111 12px,transparent 12px) 0 0/28px 28px,
    linear-gradient(#111 12px,transparent 12px) 0 0/28px 28px,
    #fff;
  border:14px solid #fff;
  box-shadow:0 0 0 1px var(--sab-border);
}

.stat-mini{
  padding:18px;
  background:var(--sab-soft);
  border-left:4px solid var(--sab-red);
}

.stat-mini h4{
  margin:0;
  font-size:30px;
  font-weight:900;
}

.stat-mini p{
  margin:4px 0 0;
  color:var(--sab-muted);
  font-size:13px;
}

.section{
  padding:90px 0;
}

.section-title{
  font-size:42px;
  line-height:1.15;
  font-weight:900;
  letter-spacing:-.035em;
}

.section-copy{
  color:var(--sab-muted);
  line-height:1.75;
  font-size:16px;
}

.feature-card{
  height:100%;
  background:#fff;
  border:1px solid var(--sab-border);
  padding:30px;
  transition:.25s ease;
  position:relative;
  overflow:hidden;
}

.feature-card:before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:5px;
  height:100%;
  background:var(--sab-red);
  opacity:.85;
}

.feature-card:hover{
  transform:translateY(-4px);
  box-shadow:0 18px 45px rgba(0,0,0,.08);
}

.feature-icon{
  width:52px;
  height:52px;
  background:#fff2f2;
  color:var(--sab-red);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:22px;
  margin-bottom:22px;
}

.feature-card h3{
  font-size:20px;
  font-weight:900;
  margin-bottom:10px;
}

.feature-card p{
  color:var(--sab-muted);
  line-height:1.65;
  margin:0;
}

.secure-note{
  background:var(--sab-black);
  color:#fff;
  padding:46px;
  position:relative;
  overflow:hidden;
}

.secure-note:after{
  content:"";
  position:absolute;
  right:-60px;
  bottom:-60px;
  width:220px;
  height:220px;
  border:26px solid rgba(215,25,32,.45);
}

.secure-note p{
  color:#d1d5db;
  line-height:1.8;
  margin:0;
}

.sab-footer{
  background:#111;
  color:#fff;
  padding:32px 0;
}

.sab-footer small{
  color:#9ca3af;
}

/* Login */
.login-page{
  min-height:100vh;
  background:#f4f5f7;
}

.login-shell{
  min-height:100vh;
}

.login-brand-panel{
  min-height:100vh;
  color:#fff;
  background:
    linear-gradient(135deg,rgba(17,17,17,.96),rgba(17,17,17,.85)),
    radial-gradient(circle at 80% 20%,rgba(215,25,32,.45),transparent 28%);
  position:relative;
  overflow:hidden;
  padding:70px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.login-brand-panel:after{
  content:"";
  position:absolute;
  width:420px;
  height:420px;
  border:42px solid rgba(215,25,32,.35);
  right:-120px;
  bottom:-120px;
  transform:rotate(18deg);
}

.login-brand-content{
  position:relative;
  z-index:1;
}

.login-brand-panel h1{
  font-size:52px;
  line-height:1.05;
  letter-spacing:-.05em;
  font-weight:900;
  max-width:560px;
}

.login-brand-panel p{
  color:#d1d5db;
  line-height:1.75;
  max-width:520px;
}

.login-card{
  width:100%;
  max-width:460px;
  background:#fff;
  padding:44px;
  box-shadow:0 22px 65px rgba(0,0,0,.10);
  border:1px solid var(--sab-border);
}

.form-label{
  font-weight:700;
  font-size:14px;
}

.form-control{
  border-radius:0;
  min-height:52px;
  border:1px solid var(--sab-border);
}

.form-control:focus{
  box-shadow:none;
  border-color:var(--sab-red);
}

/* Custom dropdown chevron on all <select> */
select.form-control{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  padding-right:40px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:14px;
}

/* Search icon inside search inputs (any input named "search") */
input[name="search"]{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:left 14px center;
  background-size:16px;
  padding-left:42px;
}

.security-line{
  font-size:13px;
  color:var(--sab-muted);
  border-left:4px solid var(--sab-red);
  padding-left:12px;
}

/* App layout */
.app-body{
  background:#f5f6f8;
}

.app-shell{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:280px;
  background:#111;
  color:#fff;
  position:fixed;
  inset:0 auto 0 0;
  padding:24px 18px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
}

.sidebar .brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 8px 28px;
  border-bottom:1px solid rgba(255,255,255,.12);
}

.nav-link-app{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  color:#d1d5db;
  margin-top:6px;
  font-weight:500;
  border-left:4px solid transparent;
}

.nav-link-app:hover,.nav-link-app.active{
  background:rgba(255,255,255,.08);
  color:#fff;
  border-left-color:var(--sab-red);
}

/* SAB-red toggle switch (Settings) — flex layout for a proper gap + alignment */
.form-switch{
  display:flex;
  align-items:center;
  gap:.75em;
  padding-left:0;          /* override Bootstrap's negative-margin layout */
  min-height:auto;
}
.form-switch .form-check-input{
  width:2.6em;
  height:1.4em;
  margin:0;
  flex:0 0 auto;
  cursor:pointer;
}
.form-switch .form-check-label{
  margin:0;
  cursor:pointer;
}
.form-check-input:checked{
  background-color:var(--sab-red);
  border-color:var(--sab-red);
}
.form-check-input:focus{
  border-color:var(--sab-red);
  box-shadow:none;
}

/* Make a <button> nav item (e.g. Logout) identical to the anchor nav links */
button.nav-link-app{
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  font:inherit;
  text-align:left;
  background:none;
  border:0;
  border-left:4px solid transparent;
  color:#d1d5db;
  cursor:pointer;
}

.app-main{
  margin-left:280px;
  width:calc(100% - 280px);
  min-height:100vh;
}

.topbar{
  height:78px;
  background:#fff;
  border-bottom:1px solid var(--sab-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 32px;
}

.content{
  padding:32px;
}

.page-title{
  font-weight:900;
  letter-spacing:-.035em;
  margin:0;
}

.card-kpi{
  background:#fff;
  border:1px solid var(--sab-border);
  padding:24px;
  height:100%;
}

.card-kpi span{
  color:var(--sab-muted);
  font-size:13px;
  font-weight:700;
}

.card-kpi h3{
  margin:8px 0 0;
  font-size:34px;
  font-weight:900;
}

.panel{
  background:#fff;
  border:1px solid var(--sab-border);
  padding:24px;
}

.table{
  vertical-align:middle;
}

.table thead th{
  color:#6b7280;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  border-bottom:1px solid var(--sab-border);
}

.badge-status{
  border-radius:0;
  padding:7px 10px;
}

.badge-active{
  background:#e8f7ee;
  color:#137a3a;
}

.badge-inactive{
  background:#f3f4f6;
  color:#6b7280;
}

.action-link{
  color:var(--sab-red);
  font-weight:600;
  font-size:13px;
}

/* SAB-red pagination (square corners to match the UI) */
.pagination{ margin:0 0 0 16px; }        /* gap from the "Showing … results" text */
.page-link{
  color:var(--sab-red);
  border:1px solid var(--sab-border);
  border-radius:0;
  font-weight:700;
  padding:8px 14px;
}
.page-link:hover{
  color:#fff;
  background:var(--sab-red);
  border-color:var(--sab-red);
}
.page-link:focus{ box-shadow:none; }
.page-item.active .page-link{
  background:var(--sab-red);
  border-color:var(--sab-red);
  color:#fff;
}
.page-item.disabled .page-link{
  color:#9ca3af;
  background:#fff;
}

/* Mobile-only nav elements — hidden on desktop by default */
.nav-toggle,
.sidebar-close,
.topbar-logo,
.bottom-nav,
.sidebar-overlay{
  display:none;
}

@media(max-width:991px){
  .hero-title{font-size:44px}
  .hero{padding:70px 0}
  .login-brand-panel{min-height:auto;padding:42px}
  .login-brand-panel h1{font-size:38px}

  /* Sidebar becomes an off-canvas app drawer */
  .app-shell{display:block}
  .app-main{margin-left:0;width:100%}

  .sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:82%;
    max-width:320px;
    min-height:100vh;
    z-index:1050;
    transform:translateX(-100%);
    transition:transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y:auto;
    box-shadow:0 0 40px rgba(0,0,0,.35);
  }
  body.drawer-open .sidebar{
    transform:translateX(0);
  }

  .sidebar-overlay{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.5);
    opacity:0;
    visibility:hidden;
    transition:opacity .28s ease;
    z-index:1040;
  }
  body.drawer-open .sidebar-overlay{
    opacity:1;
    visibility:visible;
  }
  body.drawer-open{ overflow:hidden; }

  .sidebar-close{
    display:flex;
    align-items:center;
    justify-content:center;
    position:absolute;
    top:14px;
    right:14px;
    width:34px;
    height:34px;
    background:rgba(255,255,255,.08);
    border:0;
    color:#fff;
    cursor:pointer;
  }

  .nav-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    margin-left:-8px;
    background:none;
    border:0;
    color:var(--sab-text);
    cursor:pointer;
  }

  .topbar-logo{
    height:30px;
    width:auto;
    display:block;
  }
  .topbar-platform{ display:none; }
  .topbar-user{ display:none; }
}

@media(max-width:576px){
  .hero-title{font-size:36px}
  .section{padding:60px 0}
  .section-title{font-size:32px}
  .login-card{padding:28px}
}


/* Module 02 additions */
.page-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.role-pill{
  display:inline-flex;
  align-items:center;
  padding:7px 10px;
  background:#fff2f2;
  color:var(--sab-red);
  font-weight:800;
  font-size:12px;
  border-left:3px solid var(--sab-red);
}

.avatar-circle{
  width:42px;
  height:42px;
  background:#f3f4f6;
  border:1px solid var(--sab-border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:#111;
}

.qr-large{
  width:210px;
  height:210px;
  margin:auto;
  background:
    linear-gradient(90deg,#111 14px,transparent 14px) 0 0/32px 32px,
    linear-gradient(#111 14px,transparent 14px) 0 0/32px 32px,
    #fff;
  border:18px solid #fff;
  box-shadow:0 0 0 1px var(--sab-border),0 20px 45px rgba(0,0,0,.08);
}

.info-row{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:15px 0;
  border-bottom:1px solid var(--sab-border);
}

.info-row:last-child{border-bottom:0}

.info-label{
  color:var(--sab-muted);
  font-size:13px;
  font-weight:700;
}

.info-value{
  text-align:right;
  font-weight:600;
  max-width:60%;
  word-break:break-word;
}

.timeline{
  position:relative;
  padding-left:26px;
}

.timeline:before{
  content:"";
  position:absolute;
  left:8px;
  top:8px;
  bottom:8px;
  width:2px;
  background:var(--sab-border);
}

.timeline-item{
  position:relative;
  padding:0 0 22px;
}

.timeline-item:before{
  content:"";
  position:absolute;
  left:-24px;
  top:4px;
  width:14px;
  height:14px;
  background:var(--sab-red);
  border:3px solid #fff;
  box-shadow:0 0 0 1px var(--sab-red);
}

.log-action{
  font-weight:600;
  color:#111;
}

.settings-card{
  background:#fff;
  border:1px solid var(--sab-border);
  padding:28px;
  height:100%;
}

.permission-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.permission-item{
  border:1px solid var(--sab-border);
  padding:13px;
  background:#fafafa;
}

.permission-item strong{
  font-size:13px;
}

.profile-hero{
  background:
    linear-gradient(135deg,#111,#1f1f1f);
  color:#fff;
  padding:34px;
  position:relative;
  overflow:hidden;
}

.profile-hero:after{
  content:"";
  position:absolute;
  right:-70px;
  bottom:-90px;
  width:250px;
  height:250px;
  border:28px solid rgba(215,25,32,.35);
  transform:rotate(18deg);
}

.profile-avatar{
  width:78px;
  height:78px;
  background:var(--sab-red);
  color:#fff;
  font-weight:900;
  font-size:24px;
  display:flex;
  align-items:center;
  justify-content:center;
}

@media(max-width:767px){
  .info-row{display:block}
  .info-value{text-align:left;max-width:100%;margin-top:5px}
  .permission-grid{grid-template-columns:1fr}
}


/* Branding cleanup */
.brand-logo {
  height: 42px;
  width: auto;
  display: block;
}
.brand-logo-sm {
  height: 34px;
  width: auto;
  display: block;
}
.brand-logo-white {
  height: 42px;
  width: auto;
  display: block;
}
.brand-title-only {
  font-weight: 700;
  color: #6b7280;
  font-size: 14px;
  margin-top: 2px;
}
.sidebar .brand-title-only {
  color: rgba(255,255,255,.72);
}
.sab-footer .brand-title-only {
  color: #d1d5db;
}

/* QR download format tiles (icon view) */
.qr-dl-title{
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#6b7280;
  margin-bottom:10px;
}
.qr-dl-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.qr-dl-tile{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:14px 6px;
  border:1px solid var(--sab-border);
  color:#111;
  text-decoration:none;
  transition:all .15s ease;
}
.qr-dl-tile:hover{
  border-color:var(--sab-red);
  background:var(--sab-red);
  color:#fff;
}
.qr-dl-icon{
  width:26px;
  height:26px;
  color:var(--sab-red);
}
.qr-dl-tile:hover .qr-dl-icon{
  color:#fff;
}
.qr-dl-label{
  font-size:12px;
  font-weight:800;
  letter-spacing:.03em;
}

/* =========================================================
   Mobile app-like navigation + responsive tables
   ========================================================= */

/* Bottom navigation bar (mobile only) */
.bottom-nav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  min-height:60px;
  background:#fff;
  border-top:1px solid var(--sab-border);
  z-index:1030;
  justify-content:space-around;
  align-items:stretch;
  box-shadow:0 -4px 20px rgba(0,0,0,.07);
  padding-top:6px;
  /* Always keep clearance for the iOS home indicator so labels never clip */
  padding-bottom:max(10px, env(safe-area-inset-bottom, 0px));
}
.bottom-nav-item{
  flex:1 1 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  color:var(--sab-muted);
  font-size:10.5px;
  font-weight:700;
  letter-spacing:.01em;
  padding:6px 2px;
  min-width:0;
}
.bottom-nav-item svg{
  width:22px;
  height:22px;
}
.bottom-nav-item span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.bottom-nav-item.active{
  color:var(--sab-red);
}
.bottom-nav-fab{
  position:relative;
}
.bottom-nav-fab-circle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:46px;
  height:46px;
  margin-top:-24px;
  margin-bottom:1px;
  background:var(--sab-red);
  color:#fff;
  box-shadow:0 6px 16px rgba(215,25,32,.4);
}
.bottom-nav-fab-circle svg{
  width:24px;
  height:24px;
}
.bottom-nav-fab{ color:var(--sab-red); }

/* ---------- Tablet & mobile ---------- */
@media(max-width:991px){
  .bottom-nav{ display:flex; }
  .content{ padding-bottom:calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Phones: compact app density ---------- */
@media(max-width:767px){
  /* Guard horizontal overflow on the inner wrappers only.
     Never put overflow on html/body here — it breaks position:fixed
     on mobile browsers and makes the bottom nav scroll away. */
  .app-main,.content{ overflow-x:hidden; overflow-x:clip; }
  .topbar{ height:60px; padding:0 16px; }
  .content{ padding:16px 14px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .page-title{ font-size:22px; }
  .text-muted.mb-0{ font-size:13px; }

  .panel{ padding:16px; }
  .card-kpi{ padding:16px; }
  .card-kpi h3{ font-size:26px; }
  .card-kpi span{ font-size:12px; }

  .btn-sab,.btn-outline-sab{ padding:11px 16px; font-size:14px; }
  .form-control{ min-height:48px; font-size:14px; }
  .form-label{ font-size:13px; }

  /* Page header rows: let the title + primary action stack neatly */
  .content > .d-flex.justify-content-between.align-items-center{
    flex-wrap:wrap;
    gap:12px;
  }
  .page-actions .btn{ flex:1 1 auto; text-align:center; }

  .page-link{ padding:7px 11px; font-size:13px; }

  /* ---- Card-stacked responsive tables ---- */
  .table-responsive{ overflow-x:visible; }
  .table{ font-size:13px; }
  .table thead{ display:none; }
  .table,
  .table tbody,
  .table tr,
  .table td{
    display:block;
    width:100%;
  }
  .table tr{
    border:1px solid var(--sab-border);
    margin-bottom:12px;
    padding:4px 14px;
    background:#fff;
  }
  .table tbody tr:last-child{ margin-bottom:0; }
  .table td{
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:flex-start;
    gap:6px 14px;
    padding:10px 0;
    border:0;
    border-bottom:1px solid #f0f1f3;
    text-align:right;
    box-shadow:none;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  /* Let flex children shrink instead of forcing horizontal overflow */
  .table td > *{ min-width:0; max-width:100%; }
  .table td:last-child{ border-bottom:0; }
  .table td::before{
    content:attr(data-label);
    flex:0 0 34%;
    text-align:left;
    font-weight:700;
    font-size:10.5px;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:var(--sab-muted);
    padding-top:1px;
  }
  /* Cells with only a data-label but tables without labels: no ghost gap */
  .table td:not([data-label])::before{ content:""; }
  /* Empty-state / colspan rows stay centered full-width */
  .table td[colspan]{
    text-align:center;
    justify-content:center;
    border-bottom:0;
  }
  .table td[colspan]::before{ content:none; display:none; }
  /* Action cells: give links room to wrap on the value side */
  .table td .action-link{ display:inline-block; margin-bottom:2px; }
  /* Neutralise inline min-widths that force horizontal overflow */
  .table td[style*="min-width"]{ min-width:0 !important; }

  /* Per-page + pagination footer stacks cleanly */
  .panel > .d-flex.justify-content-between.align-items-center{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* ---------- Very small phones ---------- */
@media(max-width:400px){
  .bottom-nav-item{ font-size:9.5px; }
  .bottom-nav-item svg{ width:20px; height:20px; }
  .page-title{ font-size:20px; }
  .table td::before{ flex-basis:42%; }
}

/* =========================================================================
   RTL (Arabic) overrides — mirror the fixed sidebar layout and directional
   accents. Bootstrap's RTL stylesheet handles utilities/grid; these rules
   cover the app's custom fixed-shell chrome.
   ========================================================================= */
html[dir="rtl"] .sidebar{
  inset:0 0 0 auto;
}
html[dir="rtl"] .nav-link-app,
html[dir="rtl"] button.nav-link-app{
  border-left:0;
  border-right:4px solid transparent;
  text-align:right;
}
html[dir="rtl"] .nav-link-app:hover,
html[dir="rtl"] .nav-link-app.active{
  border-left-color:transparent;
  border-right-color:var(--sab-red);
}
html[dir="rtl"] .app-main{
  margin-left:0;
  margin-right:280px;
}
html[dir="rtl"] .form-switch{
  padding-right:0;
}
html[dir="rtl"] .alert[style*="border-left"]{
  border-left:0 !important;
  border-right:4px solid var(--sab-red) !important;
}

@media(max-width:992px){
  html[dir="rtl"] .app-main{ margin-right:0; }
  html[dir="rtl"] .sidebar{
    inset:0 0 0 auto;
    transform:translateX(100%);
  }
  html[dir="rtl"] body.drawer-open .sidebar{
    transform:translateX(0);
  }
  html[dir="rtl"] .sidebar-close{ right:auto; left:14px; }
  html[dir="rtl"] .nav-toggle{ margin-left:0; margin-right:-8px; }
}

/* Language switcher — brand-red active state (overrides Bootstrap's blue) */
.lang-switch-menu .dropdown-item.active,
.lang-switch-menu .dropdown-item:active{
  background:var(--sab-red);
  color:#fff;
}
.lang-switch-menu .dropdown-item:hover:not(.active){
  background:#fff2f2;
  color:var(--sab-red);
}
.lang-switch-btn{ font-weight:700; }
