/* =====================================================================
   theinr-style.css — NET RISE Facturation
   Design system repris de Styles.css (TT Radmin) — préfixe theinr-
   Palette : Navy #1a2a5e | Blue #3b5998 | Red #cc0000 | Green | Amber
   Fonts : Inter (UI) + Cairo (arabe)
   ===================================================================== */
:root{
  --inr-navy:#1a2a5e; --inr-navy2:#12204a;
  --inr-blue:#3b5998; --inr-blue2:#2d4a8a;
  --inr-red:#cc0000;  --inr-red2:#a80000;
  --inr-green:#2d9c4e; --inr-green-bg:#e8f6ed;
  --inr-amber:#d4870a; --inr-amber-bg:#fff4e0;
  --inr-bg:#f5f6fa; --inr-surface:#ffffff;
  --inr-border:#e4e8f0; --inr-border2:#d0d6e8;
  --inr-text:#1a2a5e; --inr-muted:#6b7a9b; --inr-subtle:#9eaacc;
  --inr-sidebar-w:248px; --inr-topbar-h:56px; --inr-radius:10px;
  --inr-shadow:0 1px 3px rgba(26,42,94,.08),0 4px 16px rgba(26,42,94,.05);
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--inr-bg);color:var(--inr-text);
  font-family:'Inter',system-ui,Arial,sans-serif;font-size:14px;-webkit-font-smoothing:antialiased}
a{color:var(--inr-blue);text-decoration:none}
h1,h2,h3{margin:0}
img{max-width:100%}
.theinr-ar,.theinr-rtl{font-family:'Cairo','Inter',sans-serif}
.theinr-mono{font-family:ui-monospace,'SFMono-Regular',Menlo,monospace;font-size:.9em}
.theinr-right{text-align:right}
.theinr-nowrap{white-space:nowrap}

/* ── Shell ─────────────────────────────────────────────── */
.theinr-shell{display:flex;min-height:100vh}
.theinr-sidebar{width:var(--inr-sidebar-w);background:var(--inr-navy);color:#fff;
  position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;z-index:40}
.theinr-brand{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid rgba(255,255,255,.09)}
.theinr-brand-logo{height:34px;width:auto;background:#fff;border-radius:6px;padding:3px}
.theinr-brand-name{font-weight:700;letter-spacing:.06em;font-size:15px}
.theinr-nav{padding:12px 10px;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.theinr-nav-item{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:8px;
  color:#c9d2ea;font-weight:500;transition:.15s}
.theinr-nav-item:hover{background:rgba(255,255,255,.07);color:#fff}
.theinr-nav-item--active{background:var(--inr-blue);color:#fff;box-shadow:inset 3px 0 0 #fff3}
.theinr-nav-item .theinr-ic{width:18px;text-align:center;opacity:.9}
.theinr-nav-sep{margin:14px 12px 6px;font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:var(--inr-subtle)}

.theinr-main{flex:1;margin-left:var(--inr-sidebar-w);display:flex;flex-direction:column;min-width:0}
.theinr-topbar{height:var(--inr-topbar-h);background:var(--inr-surface);border-bottom:1px solid var(--inr-border);
  display:flex;align-items:center;gap:14px;padding:0 22px;position:sticky;top:0;z-index:30}
.theinr-topbar-title{font-size:16px;font-weight:600;flex:1}
.theinr-topbar-user{display:flex;align-items:center;gap:12px}
.theinr-user-name{font-weight:600;color:var(--inr-navy)}
.theinr-burger{display:none;background:none;border:0;font-size:20px;color:var(--inr-navy);cursor:pointer}
.theinr-content{padding:22px;flex:1}
.theinr-footer{padding:14px 22px;color:var(--inr-subtle);font-size:12px;border-top:1px solid var(--inr-border)}

/* ── Cards ─────────────────────────────────────────────── */
.theinr-card{background:var(--inr-surface);border:1px solid var(--inr-border);border-radius:var(--inr-radius);
  box-shadow:var(--inr-shadow);margin-bottom:20px;overflow:hidden}
.theinr-card--form{padding:22px}
.theinr-card-head{display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:16px 18px;border-bottom:1px solid var(--inr-border);flex-wrap:wrap}
.theinr-card-title{font-size:15px;font-weight:600}

/* ── Stats ─────────────────────────────────────────────── */
.theinr-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin-bottom:20px}
.theinr-stat{background:var(--inr-surface);border:1px solid var(--inr-border);border-radius:var(--inr-radius);
  padding:18px;box-shadow:var(--inr-shadow)}
.theinr-stat-val{font-size:24px;font-weight:700;color:var(--inr-navy)}
.theinr-stat-val small{font-size:13px;color:var(--inr-muted);font-weight:600}
.theinr-stat-lbl{color:var(--inr-muted);font-size:12.5px;margin-top:4px}
.theinr-stat--navy{background:var(--inr-navy);color:#fff}
.theinr-stat--navy .theinr-stat-val,.theinr-stat--navy .theinr-stat-lbl{color:#fff}
.theinr-stat--navy .theinr-stat-val small{color:#c9d2ea}
.theinr-stat--red{background:var(--inr-red);color:#fff}
.theinr-stat--red .theinr-stat-val,.theinr-stat--red .theinr-stat-lbl{color:#fff}
.theinr-stat--red .theinr-stat-val small{color:#ffd6d6}

/* ── Tables ────────────────────────────────────────────── */
.theinr-table{width:100%;border-collapse:collapse;font-size:13.5px}
.theinr-table thead th{background:#f7f9fc;color:var(--inr-muted);font-weight:600;text-align:left;
  padding:11px 14px;border-bottom:1px solid var(--inr-border);font-size:12px;text-transform:uppercase;letter-spacing:.03em}
.theinr-table tbody td{padding:11px 14px;border-bottom:1px solid var(--inr-border)}
.theinr-table tbody tr:hover{background:#fafbfe}
.theinr-empty{text-align:center;color:var(--inr-subtle);padding:34px!important}
.theinr-link{font-weight:600;margin-left:10px}
.theinr-link:first-child{margin-left:0}

/* ── Buttons ───────────────────────────────────────────── */
.theinr-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;
  font-family:inherit;font-weight:600;font-size:13.5px;padding:9px 16px;border-radius:8px;
  border:1px solid transparent;cursor:pointer;transition:.15s;line-height:1}
.theinr-btn--sm{padding:7px 12px;font-size:12.5px}
.theinr-btn--block{width:100%}
.theinr-btn--primary{background:var(--inr-blue);color:#fff}
.theinr-btn--primary:hover{background:var(--inr-blue2)}
.theinr-btn--ghost{background:#fff;border-color:var(--inr-border2);color:var(--inr-navy)}
.theinr-btn--ghost:hover{background:#f2f5fb}

/* ── Badges ────────────────────────────────────────────── */
.theinr-badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11.5px;font-weight:600}
.theinr-badge--navy{background:var(--inr-navy);color:#fff}
.theinr-badge--blue{background:#e6ecf8;color:var(--inr-blue2)}
.theinr-badge--green{background:var(--inr-green-bg);color:var(--inr-green)}
.theinr-badge--amber{background:var(--inr-amber-bg);color:var(--inr-amber)}
.theinr-badge--red{background:#ffecec;color:var(--inr-red2)}
.theinr-badge--subtle{background:#eef1f7;color:var(--inr-muted)}

/* ── Alerts ────────────────────────────────────────────── */
.theinr-alert{padding:12px 16px;border-radius:8px;margin-bottom:16px;font-weight:500;border:1px solid}
.theinr-alert--success{background:var(--inr-green-bg);border-color:#a8d8b8;color:#1c6b34}
.theinr-alert--error{background:#fff0f0;border-color:#f5b8b8;color:var(--inr-red2)}

/* ── Forms ─────────────────────────────────────────────── */
.theinr-form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.theinr-field{display:flex;flex-direction:column;gap:6px}
.theinr-field--wide{grid-column:1/-1}
.theinr-field-label{font-size:12.5px;font-weight:600;color:var(--inr-muted)}
.theinr-input{width:100%;padding:9px 12px;border:1px solid var(--inr-border2);border-radius:8px;
  font-family:inherit;font-size:14px;color:var(--inr-navy);background:#fff;transition:.15s}
.theinr-input:focus{outline:none;border-color:var(--inr-blue);box-shadow:0 0 0 3px rgba(59,89,152,.15)}
.theinr-input--mini{width:64px;display:inline-block;padding:5px 7px;text-align:right}
.theinr-check{flex-direction:row;align-items:center;gap:8px}
.theinr-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.theinr-search{flex:1;max-width:360px;margin:0}

/* ── Login ─────────────────────────────────────────────── */
.theinr-login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;
  background:linear-gradient(135deg,var(--inr-navy),var(--inr-blue2));padding:20px}
.theinr-login-card{background:#fff;border-radius:16px;padding:38px 34px;width:100%;max-width:400px;
  box-shadow:0 20px 60px rgba(0,0,0,.28);text-align:center}
.theinr-login-logo{height:70px;width:auto;margin-bottom:12px}
.theinr-login-title{font-size:21px;font-weight:700;color:var(--inr-navy)}
.theinr-login-sub{color:var(--inr-muted);margin:6px 0 22px;font-size:13.5px}
.theinr-login-form{display:flex;flex-direction:column;gap:14px;text-align:left}

/* ── Document editor (lignes) ──────────────────────────── */
.theinr-lines .theinr-input{padding:6px 8px}
.theinr-lines td{padding:6px 8px;vertical-align:top}
.theinr-l-total{padding-top:13px;font-weight:600;white-space:nowrap}
.theinr-doc-bottom{display:grid;grid-template-columns:1fr 340px;gap:20px;margin-bottom:18px}
.theinr-field--notes{background:var(--inr-surface);border:1px solid var(--inr-border);border-radius:var(--inr-radius);padding:16px;box-shadow:var(--inr-shadow)}
.theinr-totals{background:var(--inr-surface);border:1px solid var(--inr-border);border-radius:var(--inr-radius);
  padding:14px 18px;box-shadow:var(--inr-shadow);height:fit-content}
.theinr-total-row{display:flex;justify-content:space-between;align-items:center;padding:7px 0;
  border-bottom:1px dashed var(--inr-border);font-size:13.5px}
.theinr-total-row--grand{border-bottom:0;border-top:2px solid var(--inr-navy);margin-top:4px;padding-top:10px;
  font-weight:700;font-size:16px;color:var(--inr-navy)}

/* ── Feuille imprimable (A4) ───────────────────────────── */
.theinr-print-body{background:#e9edf5;margin:0}
.theinr-print-toolbar{display:flex;gap:10px;justify-content:center;padding:16px}
.theinr-sheet{background:#fff;width:210mm;min-height:297mm;margin:0 auto 24px;padding:16mm 15mm;
  box-shadow:0 4px 24px rgba(0,0,0,.15);color:#1a1a1a;font-size:12px}
.theinr-sheet-date{text-align:right;margin-bottom:8px}
.theinr-sheet-head{width:100%;border-collapse:collapse;margin-bottom:14px}
.theinr-sheet-head td{border:1px solid #888;padding:8px 10px;vertical-align:top;width:50%}
.theinr-sheet-logo{height:52px;width:auto;margin-bottom:4px}
.theinr-sh-name{font-weight:700;font-size:14px}
.theinr-sh-label{color:#555}
.theinr-sh-cname{font-weight:700}
.theinr-sh-po{margin-top:6px}
.theinr-sheet-title{font-size:16px;font-weight:700;margin:12px 0}
.theinr-sheet-items{width:100%;border-collapse:collapse;margin-bottom:12px}
.theinr-sheet-items th{background:#f0f2f8;border:1px solid #888;padding:6px 8px;text-align:center;font-size:11px}
.theinr-sheet-items td{border:1px solid #888;padding:6px 8px}
.theinr-si-des{text-align:left}
.theinr-si-name{font-weight:600}
.theinr-si-meta{display:block;color:#444;font-size:10.5px;margin-top:2px}
.theinr-si-total td{background:#f7f9fc}
.theinr-sheet-foot{width:100%;border-collapse:collapse;margin-top:6px}
.theinr-sheet-foot td{border:1px solid #888;padding:10px;vertical-align:top}
.theinr-sf-words{width:58%}
.theinr-sf-row{display:flex;justify-content:space-between;padding:3px 0}
.theinr-sf-row--grand{border-top:1.5px solid #333;margin-top:4px;padding-top:6px;font-weight:700;font-size:13px}
.theinr-sheet-legal{margin-top:20px;padding-top:8px;border-top:2px solid #333;text-align:center;
  font-size:10.5px;color:#333;line-height:1.6}

@media print{
  .theinr-print-body{background:#fff}
  .theinr-print-toolbar{display:none}
  .theinr-sheet{width:auto;min-height:auto;margin:0;padding:0;box-shadow:none}
  @page{size:A4;margin:14mm}
}

/* ── Responsive ────────────────────────────────────────── */
@media(max-width:900px){
  .theinr-form-grid{grid-template-columns:1fr}
  .theinr-doc-bottom{grid-template-columns:1fr}
}
@media(max-width:768px){
  .theinr-sidebar{transform:translateX(-100%);transition:.25s}
  .theinr-sidebar--open{transform:translateX(0)}
  .theinr-main{margin-left:0}
  .theinr-burger{display:block}
  .theinr-user-name{display:none}
  .theinr-table{font-size:12.5px}
}
