/* Base theme, layout, buttons, tables, forms, login, board and ticket styles */
  @import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
  * { box-sizing: border-box; }
  body {
    margin: 0;
    --paper: #FBF8F2; --panel: #FFFFFF; --ink: #1C2B45; --ink-soft: #35456A;
    --brand-orange: #F26522; --kraft-tint: #F1E3CE; --kraft-dark: #93672F;
    --stamp-red: #AE3B33; --stamp-red-tint: #F6E2DF; --success: #3F7D58; --success-tint: #DEEBE2;
    --slate: #6B7280; --line: #E7DEC9; --line-soft: #EFEAE0;
    font-family: 'Inter', sans-serif; background: var(--paper); color: var(--ink);
  }
  .disp { font-family: 'Fraunces', serif; }
  .mono { font-family: 'IBM Plex Mono', monospace; }
  a { color: inherit; }
  input, select, textarea, button { font-family: inherit; }

  .shell { display: flex; min-height: 100vh; }
  .sidebar { width: 232px; flex-shrink: 0; background: var(--ink); color: #F1EEE6; display: flex; flex-direction: column; padding: 20px 14px; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px 10px; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 14px; }
  .brand-logo { width: 40px; height: 26px; object-fit: contain; background: #fff; border-radius: 5px; padding: 3px; flex-shrink: 0; }
  .brand-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 14px; line-height: 1.15; }
  .brand-sub { font-size: 10px; color: #B7C0D6; letter-spacing: 0.04em; text-transform: uppercase; }
  .nav-section { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #7C88A8; padding: 14px 12px 5px 12px; }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: #C7CEE0; cursor: pointer; margin-bottom: 2px; }
  .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .nav-item.active { background: var(--brand-orange); color: #fff; }
  .nav-count { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 11px; opacity: 0.8; }
  .main { flex: 1; min-width: 0; padding: 28px 32px 60px 32px; }
  .topbar { display: none; }

  .h1 { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
  .sub { color: var(--slate); font-size: 13.5px; margin-top: 3px; }
  .card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px; }
  .stat-num { font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 600; }
  .stat-label { font-size: 12px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.2; height: 34px; min-height: 34px; padding: 0 16px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; background: none; box-sizing: border-box; transition: all 0.15s ease; }
  .btn svg, .btn > svg { width: 14px !important; height: 14px !important; min-width: 14px !important; min-height: 14px !important; margin: 0 !important; display: inline-block !important; flex-shrink: 0 !important; color: inherit !important; vertical-align: middle !important; }
  .btn-primary { background: var(--ink); color: #fff; }
  .btn-primary:hover { opacity: 0.88; }
  .btn-kraft { background: var(--brand-orange); color: #fff; }
  .btn-kraft:hover { opacity: 0.88; }
  .btn-kraft svg { color: #fff !important; }
  .btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
  .btn-ghost:hover { background: var(--line-soft); }
  .btn-danger { background: transparent; color: var(--stamp-red); }
  .btn-danger:hover { background: var(--stamp-red-tint); }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .btn-sm { padding: 0 10px; height: 28px; min-height: 28px; font-size: 11.5px; }
  .icon-btn { padding: 6px; width: 32px; height: 32px; min-height: 32px; }

  .inp, select.inp, textarea.inp { width: 100%; font-size: 13.5px; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
  .inp:focus { outline: 2px solid var(--brand-orange); outline-offset: 1px; border-color: var(--brand-orange); }
  .lbl { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate); margin-bottom: 5px; display: block; }

  table.tbl { width: 100%; border-collapse: collapse; }
  .tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); }
  .tbl td { padding: 12px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
  .tbl tr:hover td { background: #FAF7F0; }
  .tbl tr:last-child td { border-bottom: none; }

  .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; border: 1.5px dashed; transform: rotate(-2deg); }
  .b-draft,.b-unpaid { color: var(--slate); border-color: #C9CBD1; background: #F4F4F5; }
  .b-sent, .b-submitted { color: #8A5A16; border-color: #D9A441; background: #FBF0DA; }
  .b-accepted,.b-paid,.b-won { color: var(--success); border-color: #5FA97C; background: var(--success-tint); }
  .b-rejected,.b-lost,.b-overdue { color: var(--stamp-red); border-color: #C9756E; background: var(--stamp-red-tint); }
  .b-partial { color: var(--kraft-dark); border-color: var(--brand-orange); background: var(--kraft-tint); }
  .b-new,.b-contacted,.b-quoted { color: #2C5B8A; border-color: #6E9FC7; background: #E4EEF6; }
  .b-received { color: var(--success); border-color: #5FA97C; background: var(--success-tint); }
  .b-cancelled { color: var(--stamp-red); border-color: #C9756E; background: var(--stamp-red-tint); }

  .tabs { display: inline-flex; gap: 3px; background: var(--kraft-tint); border-radius: 12px; padding: 4px; margin-bottom: 20px; flex-wrap: wrap; }
  .tab { padding: 8px 16px; font-size: 12.5px; font-weight: 600; color: var(--kraft-dark); cursor: pointer; border-radius: 9px; transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; white-space: nowrap; }
  .tab:hover { color: var(--ink); }
  .tab.active { color: #fff; background: var(--kraft-dark); box-shadow: 0 2px 6px rgba(60,40,10,0.25); }

  .modal-bg { position: fixed; inset: 0; background: rgba(28,43,69,0.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
  .modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 640px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
  .modal.wide { max-width: 920px; }
  .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

  .empty { text-align: center; padding: 48px 20px; color: var(--slate); }
  .empty > svg { width: 42px !important; height: 42px !important; margin: 0 auto 14px auto !important; color: var(--brand-orange) !important; display: block !important; }
  .empty .btn, .empty button.btn { margin: 0 auto !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; height: 34px !important; min-height: 34px !important; max-height: 34px !important; padding: 0 16px !important; line-height: 34px !important; }
  .empty .btn svg, .empty button svg { width: 14px !important; height: 14px !important; min-width: 14px !important; min-height: 14px !important; margin: 0 !important; display: inline-block !important; flex-shrink: 0 !important; color: #fff !important; vertical-align: middle !important; }

  .li-head, .li-row { display: grid; grid-template-columns: 1.4fr 55px 55px 85px 75px 85px 60px 32px; gap: 6px; align-items: center; }
  .li-row { margin-bottom: 8px; align-items: start; }
  .li-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--slate); margin-bottom: 6px; font-weight: 600; }
  .doc-desc-main { font-weight: 700; text-transform: uppercase; }
  .doc-desc-sub { white-space: pre-line; margin-top: 2px; font-weight: 400; }
  .li-read { font-size: 12.5px; font-weight: 600; }

  .userchip { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; background: rgba(255,255,255,0.06); margin-bottom: 8px; }
  .userchip-av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
  .userchip-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
  .userchip-role { font-size: 10px; color: #9AA4BE; text-transform: uppercase; letter-spacing: 0.04em; }
  .switchuser { margin-left: auto; color: #9AA4BE; cursor: pointer; padding: 4px; }
  .switchuser:hover { color: #fff; }

  .qsearch { position: relative; }
  .qsearch input { width: 100%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #fff; border-radius: 7px; padding: 7px 10px 7px 28px; font-size: 12.5px; }
  .qsearch svg { position: absolute; left: 9px; top: 9px; color: #9AA4BE; width: 13px; height: 13px; }
  .qresults { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); z-index: 30; max-height: 240px; overflow-y: auto; }
  .qresults .qi { padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
  .qresults .qi:hover { background: var(--paper); }

  .login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--ink); }
  .login-card { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 24px 70px rgba(0,0,0,0.35); }
  .login-logo { height: 46px; object-fit: contain; margin: 0 auto 18px auto; display: block; }
  .animlogo-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 auto 20px auto; }
  @keyframes zDrawKF { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
  @keyframes barSnapKF { 0% { opacity: 0; transform: scaleX(0); } 55% { opacity: 1; transform: scaleX(1.14); } 100% { opacity: 1; transform: scaleX(1); } }
  @keyframes riseInKF { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  .staffbtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; margin-bottom: 8px; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--ink); }
  .staffbtn:hover { border-color: var(--brand-orange); background: var(--kraft-tint); }
  .staffbtn-av { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
  .staffbtn-role { margin-left: auto; font-size: 10px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
  .team-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .team-row:last-child { border-bottom: none; }

  .doc-sheet { background: #fff; color: #222; font-family: Arial, Helvetica, sans-serif; width: 100%; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; }
  .doc-spacer { flex: 1 1 auto; min-height: 12px; }
  .doc-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0 18px 0; }
  .doc-logo { height: 62px; object-fit: contain; }
  .doc-badge { background: var(--brand-orange); color: #fff; text-align: center; padding: 8px 22px; border-radius: 2px; }
  .doc-badge-ar { font-size: 15px; font-weight: 700; }
  .doc-badge-en { font-size: 17px; font-weight: 800; letter-spacing: 0.02em; }
  .doc-bizinfo { text-align: right; font-size: 12px; color: #444; margin-top: 8px; line-height: 1.5; }
