/* R16.9.10.46.25: application-header selectors retired from this file; assets/amnko-header.css is the sole header authority. */
/*
 * AMNKO application shell and first-paint guard.
 * R16.9.10.46.24C: extracted from layout.php so the shell has one auditable,
 * render-blocking stylesheet and no large inline CSS cascade.
 */

    html.amnko-ui-preparing .page-content > :not(.amnko-page-header) { visibility: hidden !important; }
    @media print { html.amnko-ui-preparing .page-content > * { visibility: visible !important; } }
  

    :root {
      --main-font: "Cairo", sans-serif;
      --primary-gradient: var(--amk-gradient-primary, linear-gradient(135deg, #00b8d9 0%, #0098b3 100%));
      --sidebar-gradient: linear-gradient(180deg, #1a1a1a 0%, #2c2c2c 100%);
      --bg-light: var(--amk-color-app-bg, #f4f6f9);
      --text-dark: var(--amk-color-text, #2d3748);
    }

    body { 
      background: var(--bg-light); 
      font-family: var(--main-font);
      font-size: 0.95rem;
      color: var(--text-dark);
      overflow-x: hidden;
    }

    /* --- Shared Header Styles --- */
    
    .amnko-bg-gradient{background: var(--primary-gradient) !important;}

    /* Compact mobile list cards (used for invoices/purchases/customers lists) */
    .amnko-mobile-list{ display: grid; gap: 10px; }
    .amnko-mobile-list .amnko-item-card{
      background: #fff;
      border: 1px solid #e9ecef;
      border-radius: 14px;
      box-shadow: 0 3px 10px rgba(0,0,0,0.04);
      padding: 12px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .amnko-mobile-list .amnko-item-title{
      font-weight: 800;
      color: #111827;
      margin: 0;
      line-height: 1.2;
      font-size: 1rem;
    }
    .amnko-mobile-list .amnko-item-sub{
      font-size: .8rem;
      color: #6b7280;
      margin-top: 2px;
    }
    .amnko-mobile-list .amnko-item-chevron{
      width: 34px;
      height: 34px;
      border-radius: 12px;
      background: rgba(0,184,217,0.12);
      color: #00b8d9;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
    }
    .amnko-click-item{ cursor: pointer; }
    
    

    

    /* User Profile Badge */
    
    
    
    

    /* --- Sidebar Styles --- */
    .sidebar {
      background: var(--sidebar-gradient);
      min-height: 100vh;
      box-shadow: 4px 0 10px rgba(0,0,0,0.05);
      display: flex;
      flex-direction: column;
    }

    /* Desktop: keep sidebar visible while scrolling + allow its own scroll */
    @media (min-width: 992px) {
      .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
      }
    }
    
    .sidebar a.sidebar__link {
      min-width: 0;
      color: rgba(255,255,255,0.75);
      text-decoration: none;
      display: block;
      padding: 12px 16px;
      border-radius: 8px;
      margin: 4px 10px;
      transition: all 0.2s ease-in-out;
      font-weight: 500;
      border-bottom: none; /* Removed old border */
    }

    /* Logo link: keep clickable but without hover/active effects */
    .sidebar a.sidebar__logo {
      display: inline-block;
      padding: 0 !important;
      margin: 0 !important;
      border-radius: 0 !important;
      background: transparent !important;
      transform: none !important;
    }
    .sidebar a.sidebar__logo:hover,
    .sidebar a.sidebar__logo:focus,
    .sidebar a.sidebar__logo:active {
      background: transparent !important;
      color: inherit !important;
      transform: none !important;
      outline: none !important;
    }

    /* Sidebar labels: keep single line and avoid wrapping */
    .sidebar a.sidebar__link .nav-label {
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }



    .sidebar__menu { flex: 1 1 auto; }
    .sidebar__bottom { margin-top: auto; }
    .sidebar__top { position: relative; }

    /* Desktop sidebar layout */
    @media (min-width: 992px) {
      /* Slimmer sidebar to give more room to the page */
      .sidebar-col { flex: 0 0 200px; max-width: 200px; }
      .main-col { flex: 1 1 auto; max-width: calc(100% - 200px); }
    }

    .sidebar a.sidebar__link:hover,
    .sidebar a.sidebar__link.active {
      background: rgba(0, 184, 217, 0.15); /* Soft highlight */
      color: #00b8d9; /* Brand color text */
      transform: translateX(-3px);
    }

    /* Offcanvas Sidebar (Mobile) */
    .offcanvas.sidebar-offcanvas { 
      background: #1a1a1a; /* Match sidebar dark theme */
      width: 260px; 
      border-left: 1px solid rgba(255,255,255,0.05);
    }
    

    /* Offcanvas sidebar (mobile) */
    .sidebar.sidebar--offcanvas {
      height: 100%;
      min-height: 100%;
    }

    /* --- Main Content Area --- */
    .content-wrap { 
      background: var(--bg-light);
      min-height: 100vh;
    }
    
    .page-content { 
      padding: 24px; 
      animation: fadeIn 0.4s ease-out;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Alert Styling */
    .alert {
      border: none;
      box-shadow: 0 2px 6px rgba(0,0,0,0.05);
      border-radius: 8px;
      font-weight: 600;
    }

    .amnko-flash-overlay{
      position: fixed;
      inset: 0;
      z-index: 1095;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(15, 23, 42, 0.28);
      backdrop-filter: blur(5px);
      -webkit-backdrop-filter: blur(5px);
    }
    .amnko-flash-card{
      position: relative;
      width: min(540px, 100%);
      background: #fff;
      border-radius: 28px;
      padding: 28px;
      box-shadow: 0 24px 72px rgba(0, 76, 92, .20);
      border: 1px solid rgba(226,232,240,.98);
      animation: amnkoFlashIn .22s ease-out;
      overflow: hidden;
    }
    .amnko-flash-card:before{
      content: "";
      position: absolute;
      inset-inline-start: 0;
      top: 0;
      bottom: 0;
      width: 7px;
      background: var(--primary-gradient);
    }
    .amnko-flash-card:after{
      content: "";
      position: absolute;
      width: 190px;
      height: 190px;
      border-radius: 50%;
      background: rgba(0,184,217,.09);
      inset-inline-end: -70px;
      top: -95px;
      pointer-events: none;
    }
    .amnko-flash-danger:before{ background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); }
    .amnko-flash-warning:before{ background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); }
    .amnko-flash-success:before{ background: var(--primary-gradient); }
    .amnko-flash-close{
      position: absolute;
      top: 18px;
      left: 18px;
      width: 38px;
      height: 38px;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      background: #fff;
      color: #64748b;
      font-size: 26px;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: .16s ease;
      box-shadow: 0 8px 18px rgba(15,23,42,.06);
      z-index: 2;
    }
    .amnko-flash-close:hover{ background: #f8fafc; color: #0f172a; transform: translateY(-1px); }
    .amnko-flash-body{ display: flex; gap: 16px; align-items: flex-start; padding-inline-end: 48px; position: relative; z-index: 1; }
    .amnko-flash-icon{
      width: 58px;
      height: 58px;
      border-radius: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      color: #fff;
      background: var(--primary-gradient);
      box-shadow: 0 14px 28px rgba(0,184,217,.20);
    }
    .amnko-flash-danger .amnko-flash-icon{ background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 14px 28px rgba(220,38,38,.18); }
    .amnko-flash-warning .amnko-flash-icon{ background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 14px 28px rgba(217,119,6,.16); }
    .amnko-flash-success .amnko-flash-icon{ background: var(--primary-gradient); box-shadow: 0 14px 28px rgba(0,184,217,.18); }
    .amnko-flash-title{ margin: 0 0 8px; font-weight: 900; color: #0f172a; font-size: 1.16rem; letter-spacing:-.01em; }
    .amnko-flash-message{ margin: 0; color: #475569; line-height: 1.9; font-weight: 650; text-align: right; unicode-bidi: plaintext; }
    .amnko-flash-message bdi{ direction:ltr; unicode-bidi:isolate; display:inline-block; }
    .amnko-license-eyebrow{ display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; background:#ecfeff; color:#0e7490; font-weight:900; font-size:.78rem; margin-bottom:10px; }
    .amnko-license-summary{ margin:0; color:#475569; line-height:1.9; font-weight:700; }
    .amnko-license-reason{ margin-top:18px; padding:14px 16px; border-radius:18px; background:#f8fafc; border:1px solid #e2e8f0; color:#334155; font-weight:750; line-height:1.8; position:relative; z-index:1; }
    .amnko-license-support{ margin-top:14px; display:grid; grid-template-columns: 1fr 1fr; gap:10px; position:relative; z-index:1; }
    .amnko-license-support-box{ padding:14px; border:1px solid #e2e8f0; border-radius:18px; background:#fff; }
    .amnko-license-support-label{ color:#64748b; font-size:.82rem; font-weight:800; margin-bottom:4px; }
    .amnko-license-support-value{ color:#0f172a; font-weight:900; }
    .amnko-license-company-link{ color:#0f172a; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
    .amnko-license-company-link:hover{ color:#00a6c7; text-decoration:underline; }
    .amnko-license-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; position:relative; z-index:1; }
    .amnko-license-action{ display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:9px 16px; border-radius:999px; text-decoration:none; font-weight:900; border:1px solid transparent; }
    .amnko-license-action-primary{ background:var(--primary-gradient); color:#fff; box-shadow:0 14px 26px rgba(0,184,217,.18); }
    .amnko-license-action-primary:hover{ color:#fff; transform:translateY(-1px); }
    .amnko-license-action-secondary{ background:#fff; color:#0f172a; border-color:#e2e8f0; }
    .amnko-license-action-secondary:hover{ background:#f8fafc; color:#0f172a; }
    .amnko-license-code{ margin-top:14px; padding-top:12px; border-top:1px dashed #e2e8f0; color:#64748b; font-weight:800; font-size:.86rem; position:relative; z-index:1; }
    .amnko-license-code bdi{ direction:ltr; unicode-bidi:isolate; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color:#0f172a; background:#f1f5f9; border-radius:10px; padding:3px 8px; }
    @keyframes amnkoFlashIn{
      from{ opacity:0; transform: translateY(14px) scale(.98); }
      to{ opacity:1; transform: translateY(0) scale(1); }
    }
    .amnko-flash-overlay.is-hiding{ animation: amnkoOverlayOut .16s ease-in forwards; }
    .amnko-flash-overlay.is-hiding .amnko-flash-card{ animation: amnkoFlashOut .16s ease-in forwards; }
    @keyframes amnkoOverlayOut{ to{ opacity:0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); } }
    @keyframes amnkoFlashOut{ to{ opacity:0; transform: translateY(10px) scale(.985); } }
    @media (max-width: 576px){
      .amnko-flash-card{ padding: 24px 18px 20px; border-radius: 24px; }
      .amnko-flash-body{ gap: 12px; padding-inline-end: 42px; }
      .amnko-flash-icon{ width: 48px; height: 48px; border-radius: 18px; }
      .amnko-license-support{ grid-template-columns: 1fr; }
      .amnko-license-actions{ flex-direction: column; }
      .amnko-license-action{ width: 100%; }
    }

    /* Responsive Tables (Mobile Stack) */
    .table-responsive-stack td:before { 
      content: attr(data-label); 
      font-weight: 700; 
      color: #6c757d;
      display: none; 
    }

    /* Clickable table rows (open details modal) */
    .amnko-row-clickable{ cursor: pointer; }
    @media (min-width: 992px){
      table.table tbody tr.amnko-row-clickable:hover{ background: rgba(0,184,217,0.06); }
    }
    
    @media (max-width: 991px) {
      .sidebar:not(.sidebar--offcanvas) { min-height: auto; }
      
      /* Mobile Table Card Style */
      .table-responsive-stack thead { display: none; }
      .table-responsive-stack tr { 
        display: block; 
        border: 1px solid #e9ecef; 
        border-radius: 8px;
        margin-bottom: 15px; 
        background: #fff; 
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
      }
      .table-responsive-stack td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center;
        padding: 12px 15px; 
        border-bottom: 1px solid #f1f3f5; 
      }
      .table-responsive-stack td:last-child { border-bottom: none; }
      .table-responsive-stack td:before { display: block; }

      /* Mobile Header Tweaks */
      
    }

    /* Desktop Specific Header Positioning */
    
    
    
    
    
    

    /* --- Mobile Bottom Navigation (Project-wide) --- */
    .mobile-bottom-nav{
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1050;
      background: rgba(255,255,255,0.96);
      backdrop-filter: blur(8px);
      border-top: 1px solid rgba(0,0,0,0.08);
      box-shadow: 0 -6px 18px rgba(0,0,0,0.08);
    }
    .mobile-bottom-nav .nav{
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 2px;
      padding: 6px 8px;
    }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button{
      appearance: none;
      border: 0;
      background: transparent;
      padding: 8px 6px;
      border-radius: 12px;
      color: #111827;
      text-decoration: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-height: 56px;
      font-size: 12px;
      font-weight: 700;
    }
    .mobile-bottom-nav a .ico,
    .mobile-bottom-nav button .ico{
      width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #4b5563;
    }
    .mobile-bottom-nav a.active{
      background: rgba(0,184,217,0.16);
      color: #00b8d9;
    }
    .mobile-bottom-nav a.active .ico{ color: #00b8d9; }

    @media (max-width: 991px){
      /*
        Prevent fixed bottom-nav from covering last interactive controls.
        Some pages (tables/cards) may end exactly at viewport bottom, so we add
        extra space both on body and on the page content container.
      */
      body.has-bottom-nav{ padding-bottom: 92px; }
      body.has-bottom-nav .page-content{ padding-bottom: 92px; }

      /* Extra safety for stacked mobile tables: ensure the last card can scroll above bottom-nav */
      body.has-bottom-nav .table-responsive-stack tr:last-child{ margin-bottom: 92px; }
    }

    /* --- Numeric inputs: force LTR + tabular numerals for consistent alignment --- */
    input[type=number],
    input[inputmode=numeric],
    input[inputmode=decimal],
    input.amount,
    input.money,
    input.qty,
    .ltr-num {
      direction: ltr !important;
      text-align: left !important;
      font-variant-numeric: tabular-nums;
    }

  
