/* gstcal.css — extracted verbatim from gstcal.html's original inline <style>; logic/behavior unchanged, only relocated */
/* --- SYSTEM CORE VARIABLES & FINTECH THEMES --- */
    :root {
      --font-stack: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
      --font-main: var(--font-stack);
      --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      --accent-color: #4f46e5;
      
      --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
      --card-bg: #ffffff;
      --card-border: #e2e8f0;
      --calc-border: var(--card-border);
      --text-main: #0f172a;
      --text-muted: #64748b;
      --input-bg: #ffffff;
      --input-border: #cbd5e0;
      --primary: #4f46e5;
      --primary-glow: rgba(79, 70, 229, 0.1);
      --success: #10b981;
      --success-glow: rgba(16, 185, 129, 0.15);
      --secondary: #0ea5e9;
      --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
      --panel-bg: #f8fafc;
      --radius-lg: 20px;
      --radius-md: 16px;
      --radius-sm: 12px;
      --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.dark-mode {
      --accent-color: #818cf8;
      --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
      --card-bg: rgba(30, 41, 59, 0.95);
      --card-border: rgba(255, 255, 255, 0.05);
      --calc-border: var(--card-border);
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --input-bg: #1e293b;
      --input-border: #334155;
      --primary: #818cf8;
      --primary-glow: rgba(129, 140, 248, 0.25);
      --success: #34d399;
      --success-glow: rgba(52, 211, 153, 0.25);
      --shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
      --panel-bg: rgba(255, 255, 255, 0.03);
    }

    body.amoled-mode {
      --accent-color: #a78bfa;
      --bg-gradient: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
      --card-bg: rgba(10, 10, 10, 0.98);
      --card-border: rgba(255, 255, 255, 0.1);
      --calc-border: var(--card-border);
      --text-main: #ffffff;
      --text-muted: #a1a1aa;
      --input-bg: #000000;
      --input-border: #27272a;
      --primary: #a78bfa;
      --primary-glow: rgba(167, 139, 250, 0.3);
      --success: #4ade80;
      --success-glow: rgba(74, 222, 128, 0.3);
      --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
      --panel-bg: rgba(255, 255, 255, 0.05);
    }

    /* --- RESET & LAYOUT BASE --- */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: var(--font-main);
    }

    body {
      background: var(--bg-gradient);
      min-height: 100vh;
      color: var(--text-main);
      padding: 30px 20px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      transition: background 0.4s, color 0.4s;
      overflow-x: hidden;
    }

    .wrapper {
      max-width: 1440px;
      width: 100%;
    }

    /* --- PREMIUM FINTECH MONOLITHIC NAVIGATION HEADER --- */
    .calc-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--card-bg);
      border: 1px solid var(--calc-border);
      border-radius: var(--radius-md);
      padding: 14px 24px;
      margin-bottom: 30px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      animation: slideDown 0.5s ease-out;
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .calc-header h1 {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.5px;
      background: linear-gradient(45deg, var(--primary), var(--secondary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .header-controls {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .icon-btn {
      width: 38px;
      height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--panel-bg);
      border: 1px solid var(--input-border);
      color: var(--text-main);
      border-radius: 12px;
      cursor: pointer;
      text-decoration: none;
      font-size: 15px;
      transition: var(--transition-smooth);
    }

    .icon-btn:hover {
      transform: scale(1.05);
      border-color: var(--accent-color);
      color: var(--accent-color);
      background: var(--primary-glow);
    }

    .icon-btn:active {
      transform: scale(0.95);
    }

    /* --- SLIDING HISTORY SIDEBAR PANEL --- */
    .history-sidebar {
      position: fixed;
      top: 0;
      right: -380px;
      width: 360px;
      height: 100vh;
      background: var(--card-bg);
      border-left: 1px solid var(--card-border);
      box-shadow: -10px 0 30px rgba(0,0,0,0.1);
      z-index: 9999;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      transition: var(--transition-smooth);
    }

    .history-sidebar.open {
      right: 0;
    }

    .history-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 2px solid var(--panel-bg);
      padding-bottom: 12px;
    }

    .history-header h2 {
      font-size: 18px;
      font-weight: 800;
      color: var(--primary);
    }

    .history-logs {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding-right: 4px;
    }

    .log-card {
      background: var(--panel-bg);
      border: 1px solid var(--input-border);
      border-radius: var(--radius-sm);
      padding: 12px;
      font-size: 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      cursor: pointer;
      transition: var(--transition);
    }

    .log-card:hover {
      border-color: var(--primary);
      background: var(--card-bg);
    }

    .log-meta {
      display: flex;
      justify-content: space-between;
      color: var(--text-muted);
      font-weight: 700;
      font-size: 10px;
    }

    /* --- FIXED 3-COLUMN EQUAL-HEIGHT GRID SYSTEM --- */
    .terminal-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 24px;
      align-items: stretch;
    }

    .section-card {
      background: var(--card-bg);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow);
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      transition: var(--transition);
      animation: fadeIn 0.5s ease-out;
      height: 100%;
    }

    .section-card:hover {
      box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
    }

    .section-title {
      font-size: 15px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.75px;
      color: var(--primary);
      border-bottom: 2px solid var(--primary-glow);
      padding-bottom: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    /* --- CONFIGURATOR CONTROLS & FORM FIELDS --- */
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    label {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-main);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .input-container {
      position: relative;
      display: flex;
      align-items: center;
    }

    .prefix {
      position: absolute;
      left: 16px;
      font-weight: 600;
      color: var(--text-muted);
      font-size: 16px;
    }

    input[type="number"], select {
      width: 100%;
      padding: 12px 14px 12px 34px;
      font-size: 15px;
      font-weight: 600;
      background: var(--input-bg);
      border: 2px solid var(--input-border);
      border-radius: var(--radius-sm);
      color: var(--text-main);
      outline: none;
      transition: var(--transition);
      appearance: none;
    }

    select {
      padding-left: 14px;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
      background-repeat: no-repeat;
      background-position: right 14px center;
      background-size: 16px;
      cursor: pointer;
    }

    input:focus, select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 4px var(--primary-glow);
    }

    .segmented-control {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      background: var(--panel-bg);
      padding: 5px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--input-border);
    }

    .segmented-control input[type="radio"] {
      display: none;
    }

    .segmented-control label {
      padding: 10px;
      text-align: center;
      cursor: pointer;
      border-radius: 8px;
      text-transform: none;
      letter-spacing: normal;
      transition: var(--transition);
      color: var(--text-muted);
      font-weight: 700;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 6px;
    }

    .segmented-control input[type="radio"]:checked + label {
      background: var(--card-bg);
      color: var(--primary);
      box-shadow: 0 4px 12px var(--shadow);
    }

    .checkbox-container {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--panel-bg);
      padding: 14px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      user-select: none;
      transition: var(--transition);
      font-size: 13px;
      font-weight: 600;
      border: 1px solid transparent;
    }
    .checkbox-container:hover {
      border-color: var(--input-border);
    }

    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      cursor: pointer;
      accent-color: var(--primary);
    }

    /* --- ANALYTICS METRICS DISPLAY --- */
    .stat-box {
      background: var(--panel-bg);
      border-left: 4px solid var(--secondary);
      padding: 14px;
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      transition: var(--transition);
    }

    .stat-box.gross {
      border-left-color: var(--success);
      background: var(--success-glow);
    }

    .stat-box p {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .stat-box h3 {
      font-size: 20px;
      font-weight: 800;
      color: var(--text-main);
    }

    /* --- DYNAMIC SVG DONUT RING CHART --- */
    .chart-container {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 10px 0;
      background: var(--panel-bg);
      border-radius: var(--radius-md);
      position: relative;
    }

    .donut-chart-svg {
      transform: rotate(-90deg);
      transition: var(--transition);
    }

    .donut-segment {
      transition: stroke-dasharray 0.5s ease-in-out;
    }

    .chart-overlay-text {
      position: absolute;
      text-align: center;
      display: flex;
      flex-direction: column;
    }
    .chart-overlay-text .pct {
      font-size: 20px;
      font-weight: 800;
    }
    .chart-overlay-text .lbl {
      font-size: 10px;
      color: var(--text-muted);
      text-transform: uppercase;
      font-weight: 600;
    }

    .math-explanation {
      background: var(--panel-bg);
      border: 1px dashed var(--input-border);
      border-radius: var(--radius-sm);
      padding: 12px;
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-main);
    }

    .words-box {
      background: var(--primary-glow);
      border-radius: 8px;
      padding: 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--primary);
      text-transform: capitalize;
    }

    /* --- DIGITAL TAX INVOICE RECEIPT COMPONENT --- */
    .invoice-box {
      border: 1px solid var(--input-border);
      padding: 24px;
      background: #ffffff;
      color: #0f172a !important;
      border-radius: var(--radius-sm);
      position: relative;
      overflow: hidden;
      box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    }

    .invoice-watermark {
      position: absolute;
      top: -10px;
      right: -25px;
      font-size: 11px;
      font-weight: 900;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      color: white;
      padding: 6px 28px;
      transform: rotate(45deg);
      transform-origin: center;
      letter-spacing: 1px;
    }

    .invoice-header-banner {
      text-align: center;
      margin-bottom: 16px;
      border-bottom: 2px solid #0f172a;
      padding-bottom: 8px;
    }

    .invoice-header-banner h2 {
      font-size: 18px;
      font-weight: 800;
      letter-spacing: 1.5px;
      color: #0f172a;
    }

    .invoice-party-row {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: 15px;
      margin-bottom: 16px;
      font-size: 11px;
      line-height: 1.5;
    }

    .party-block h4 {
      font-size: 9px;
      text-transform: uppercase;
      color: #64748b;
      margin-bottom: 2px;
      letter-spacing: 0.5px;
    }

    .party-block p {
      color: #0f172a;
    }

    .invoice-meta-block {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
      text-align: right;
    }

    .invoice-status-badge {
      display: inline-block;
      padding: 3px 9px;
      border-radius: 50px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      background: rgba(16, 185, 129, 0.12);
      color: #10b981;
      border: 1px solid rgba(16, 185, 129, 0.25);
    }

    .invoice-badge-slab {
      display: inline-block;
      padding: 2px 6px;
      background: rgba(79, 70, 229, 0.08);
      color: #4f46e5;
      border-radius: 6px;
      font-weight: 700;
      font-size: 10px;
    }

    .invoice-table-wrapper {
      overflow-x: auto;
      margin: 12px 0;
    }

    .invoice-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 11px;
    }

    .invoice-table th {
      background: #f8fafc;
      padding: 8px 6px;
      font-weight: 700;
      text-align: right;
      border: 1px solid #cbd5e1;
      color: #475569;
    }
    .invoice-table th:first-child, .invoice-table td:first-child {
      text-align: left;
    }

    .invoice-table td {
      padding: 8px;
      border: 1px solid #cbd5e1;
      color: #0f172a;
    }

    .amount-highlight-card {
      background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
      color: white;
      border-radius: var(--radius-sm);
      padding: 12px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }

    .amount-highlight-card .lbl {
      font-size: 10px;
      text-transform: uppercase;
      font-weight: 700;
      letter-spacing: 1px;
      opacity: 0.9;
    }

    .amount-highlight-card .val {
      font-size: 20px;
      font-weight: 800;
    }

    .invoice-words-strip {
      font-size: 10px;
      font-weight: 700;
      color: #475569;
      background: #f1f5f9;
      padding: 10px;
      border-radius: 6px;
      border-left: 3px solid #cbd5e1;
      margin-bottom: 5px;
      text-transform: capitalize;
    }

    /* --- SYSTEM BUTTON LAYOUTS --- */
    .action-btn {
      width: 100%;
      padding: 13px;
      font-size: 14px;
      font-weight: 700;
      border: none;
      border-radius: var(--radius-sm);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: var(--transition);
      background: var(--primary);
      color: white;
    }

    .action-btn.secondary {
      background: var(--success);
    }

    .action-btn:hover {
      filter: brightness(1.1);
      transform: translateY(-1px);
    }

    .share-section {
      text-align: center;
      border-top: 1px solid var(--input-border);
      padding-top: 14px;
    }
    .share-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 10px;
      letter-spacing: 0.5px;
    }
    .share-buttons {
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .share-btn {
      padding: 6px 12px;
      font-size: 12px;
      font-weight: 600;
      border-radius: 8px;
      background: var(--panel-bg);
      color: var(--text-main);
      border: 1px solid var(--input-border);
      cursor: pointer;
      transition: var(--transition);
    }
    .share-btn:hover {
      background: var(--input-bg);
      border-color: var(--primary);
    }

    .rand-btn {
      background: var(--primary-glow);
      color: var(--primary);
      border: 1px solid var(--primary);
      padding: 4px 8px;
      font-size: 11px;
      font-weight: 700;
      border-radius: 6px;
      cursor: pointer;
      transition: var(--transition);
    }
    .rand-btn:hover {
      background: var(--primary);
      color: white;
    }

    /* --- CLEAN STANDARD FINTECH FOOTER --- */
    footer {
      margin-top: 40px;
      font-size: 13px;
      color: var(--text-muted);
      font-weight: 600;
      border-top: 1px solid var(--card-border);
      padding: 24px 0;
      width: 100%;
      text-align: center;
    }

    footer a {
      color: var(--primary);
      text-decoration: none;
      font-weight: 700;
    }
    footer a:hover {
      text-decoration: underline;
    }

    /* --- DEEP ANIMATION PIPELINES --- */
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } }

    /* --- STAGE PRINT STYLESHEET PROFILE --- */
    @media print {
      body { background: white !important; color: black !important; padding: 0 !important; }
      .calc-header { display: none !important; }
      .terminal-grid { grid-template-columns: 1fr !important; }
      .section-card, form, footer, .chart-container, .share-section, .stat-box, .action-btn {
        display: none !important;
      }
      .section-card:last-child { display: block !important; border: none !important; box-shadow: none !important; padding: 0 !important; width: 100% !important; }
      .invoice-box { border: none !important; box-shadow: none !important; padding: 0 !important; width: 100% !important; }
      .invoice-table th { background: #f1f5f9 !important; color: black !important; }
      .invoice-table td { border-bottom: 1px solid #cbd5e1 !important; color: black !important; }
      .amount-highlight-card { background: #0f172a !important; color: white !important; }
    }

    /* --- VIEWPORT RESPONSIVENESS ADAPTERS --- */
    @media (max-width: 1200px) {
      .terminal-grid {
        grid-template-columns: 1fr 1fr;
      }
      .section-card:last-child {
        grid-column: span 2;
      }
    }

    @media (max-width: 768px) {
      .calc-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
      }
      .terminal-grid {
        grid-template-columns: 1fr;
      }
      .section-card:last-child {
        grid-column: span 1;
      }
    }
