/**********************************************************************************
  FRS.CSS -- poore project ka stylesheet, v2 (redesigned)
  ------------------------------------------------------------------------------
  Design language: navy/indigo brand, soft shadows, rounded cards, subtle
  gradients, generous whitespace. Mobile-first responsive -- sidebar collapses
  to a slide-out drawer under 900px, grids stack to single column.
**********************************************************************************/

:root {
    --frs-navy: #1F3864;
    --frs-navy-light: #2c4a7c;
    --frs-navy-dark: #142544;
    --frs-indigo: #4C5FD5;
    --frs-red: #D64550;
    --frs-red-bg: #FDEDEE;
    --frs-green: #1F9D5A;
    --frs-green-bg: #E9F9EF;
    --frs-amber: #DB9E1F;
    --frs-amber-bg: #FDF4E3;
    --frs-border: #e6e9f0;
    --frs-bg: #f2f4f9;
    --frs-card: #ffffff;
    --frs-text: #1c2333;
    --frs-text-muted: #6b7280;
    --frs-radius: 12px;
    --frs-radius-sm: 8px;
    --frs-shadow: 0 1px 3px rgba(20,30,60,.06), 0 8px 24px rgba(20,30,60,.05);
    --frs-shadow-lift: 0 10px 30px rgba(20,30,60,.12);
    --sidebar-w: 250px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Tahoma, Arial, sans-serif;
    font-size: 14px;
    color: var(--frs-text);
    background: var(--frs-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--frs-navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; }

/* ============ SHELL / LAYOUT ============ */
.frs-shell { display: flex; min-height: 100vh; }

.frs-sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--frs-navy) 0%, var(--frs-navy-dark) 100%);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
    overflow-y: auto;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform .25s ease;
}

.frs-sidebar-brand {
    font-size: 22px;
    font-weight: 800;
    padding: 22px 22px 18px;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.frs-sidebar-brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #6b8fd6, #4C5FD5);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 900; color: #fff;
    box-shadow: 0 4px 10px rgba(76,95,213,.4);
}

.frs-sidebar-close {
    display: none;
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: #fff; font-size: 20px; cursor: pointer;
    opacity: .8;
}

.frs-nav { display: flex; flex-direction: column; padding: 6px 12px; gap: 1px; }
.frs-nav-group {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.4);
    padding: 16px 10px 6px;
}
.frs-nav a {
    color: rgba(255,255,255,.88);
    padding: 9px 12px;
    font-size: 13.5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: background .15s ease;
}
.frs-nav a:hover { background: rgba(255,255,255,.09); text-decoration: none; }
.frs-nav a.active { background: rgba(255,255,255,.14); font-weight: 600; }
.frs-nav a.active .frs-nav-icon { opacity: 1; }
.frs-nav-icon {
    width: 17px; height: 17px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
    opacity: .75;
}

.frs-sidebar-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(10,15,30,.5);
    z-index: 150;
}

.frs-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-w);
}

.frs-topbar {
    background: var(--frs-card);
    border-bottom: 1px solid var(--frs-border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.frs-topbar-left { display: flex; align-items: center; gap: 14px; }
.frs-hamburger {
    display: none;
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--frs-navy); padding: 4px;
}
.frs-topbar-user {
    font-weight: 600; color: var(--frs-navy);
    display: flex; align-items: center; gap: 8px;
}
.frs-topbar-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--frs-navy-light), var(--frs-indigo));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}

.frs-content { padding: 26px; max-width: 1440px; width: 100%; margin: 0 auto; }
.frs-content-anon { display: flex; min-height: 100vh; width: 100%; }

/* ============ AUTH / LOGIN ============ */
.frs-auth-brand {
    flex: 1.1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    color: #fff;
    background: linear-gradient(135deg, var(--frs-navy) 0%, var(--frs-indigo) 100%);
}
.frs-auth-brand::before, .frs-auth-brand::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.07);
}
.frs-auth-brand::before { width: 420px; height: 420px; top: -160px; right: -140px; }
.frs-auth-brand::after { width: 260px; height: 260px; bottom: -120px; left: -60px; background: rgba(255,255,255,.05); }
.frs-auth-brand-mark {
    position: relative;
    width: 56px; height: 56px; border-radius: 14px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 900; margin-bottom: 26px;
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.frs-auth-brand h1 { position: relative; font-size: 30px; margin: 0 0 10px; color: #fff; }
.frs-auth-brand p { position: relative; font-size: 14.5px; color: rgba(255,255,255,.82); max-width: 380px; line-height: 1.6; margin: 0; }
.frs-auth-brand-features { position: relative; list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.frs-auth-brand-features li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.85); }
.frs-auth-brand-features svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.frs-auth-panel {
    width: 440px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 40px; background: var(--frs-card);
}
.frs-auth-card { width: 100%; max-width: 320px; }
.frs-auth-card h2 { font-size: 22px; margin: 0 0 4px; color: var(--frs-navy); }
.frs-auth-card .frs-muted { margin-bottom: 26px; font-size: 13px; }
.frs-auth-card .frs-field { margin-bottom: 16px; }
.frs-auth-card .btn-primary { width: 100%; justify-content: center; padding: 11px 18px; margin-top: 6px; }

@media (max-width: 860px) {
    .frs-auth-brand { display: none; }
    .frs-auth-panel { width: 100%; }
}

.frs-inline-form { display: inline; }
.frs-link-button {
    background: none; border: none; color: var(--frs-navy);
    cursor: pointer; font-size: 13px; text-decoration: underline;
}

/* ============ PAGE HEADER ============ */
.frs-page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.frs-page-header h1 { font-size: 21px; margin: 0; color: var(--frs-navy); }
.frs-muted { color: var(--frs-text-muted); font-size: 12.5px; }
.frs-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 11px 20px;
    border-radius: var(--frs-radius-sm);
    border: none;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--frs-navy-light), var(--frs-navy));
    color: #fff;
    box-shadow: 0 4px 12px rgba(31,56,100,.28);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(31,56,100,.38); text-decoration: none; }
.btn-secondary { background: #eef0f5; color: #333; }
.btn-secondary:hover { background: #e2e5ee; text-decoration: none; }
.btn-export-excel { background: var(--frs-green); color: #fff; }
.btn-export-print { background: #4b5563; color: #fff; }
.btn-export-size { background: #6b7280; color: #fff; }
.btn-export-pdf { background: #b91c1c; color: #fff; }

/* ============ FORMS ============ */
.form-control {
    width: 100%;
    min-height: 42px;
    padding: 11px 14px;
    border: 1.5px solid var(--frs-border);
    border-radius: var(--frs-radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s ease;
}
.form-control:focus { outline: none; border-color: var(--frs-indigo); box-shadow: 0 0 0 3px rgba(76,95,213,.12); }
.form-control:disabled { background: #f0f1f3; color: #888; }

.frs-form { max-width: 920px; }
.frs-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px 18px;
    margin-bottom: 10px;
}
.frs-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.frs-field label { font-size: 12.5px; font-weight: 600; color: #444; }
.frs-field-wide { grid-column: 1 / -1; }
.frs-field-checkbox label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.frs-field-hint { font-size: 11px; color: var(--frs-text-muted); }
.frs-field-error { font-size: 11.5px; color: var(--frs-red); min-height: 14px; }
.frs-field-divider {
    grid-column: 1 / -1;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    color: var(--frs-navy); border-bottom: 2px solid var(--frs-navy);
    padding-bottom: 5px; margin: 10px 0 4px; letter-spacing: .4px;
}
.req { color: var(--frs-red); }

.frs-form-actions { display: flex; gap: 10px; margin-top: 20px; }

.frs-readonly-value {
    font-family: Consolas, monospace;
    font-weight: 700;
    text-align: right;
    padding: 8px 11px;
    background: var(--frs-bg);
    border-radius: var(--frs-radius-sm);
}
.frs-total-net { color: var(--frs-navy); font-size: 15px; }
.frs-readonly { background: #f0f1f3; }

.frs-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px 12px;
    border: 1.5px solid var(--frs-border);
    border-radius: var(--frs-radius-sm);
    padding: 14px;
    background: #fff;
}
.frs-checkbox-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ============ CARDS (dashboard, panels) ============ */
.frs-card {
    background: var(--frs-card);
    border-radius: var(--frs-radius);
    box-shadow: var(--frs-shadow);
    padding: 20px;
}

/* ============ GRID (FrsGrid) ============ */
.frs-grid { background: var(--frs-card); border-radius: var(--frs-radius); overflow: hidden; box-shadow: var(--frs-shadow); }
.frs-grid-toolbar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    padding: 14px; border-bottom: 1px solid var(--frs-border);
}
.frs-grid-toolbar .form-control { max-width: 280px; }
.frs-grid-table-wrap { overflow-x: auto; }
.frs-grid-table { width: 100%; border-collapse: collapse; margin: 0; min-width: 560px; }
.frs-grid-table th {
    background: var(--frs-navy); color: #fff;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
    padding: 11px 12px; text-align: left; white-space: nowrap;
}
.frs-grid-table td { padding: 10px 12px; border-bottom: 1px solid var(--frs-border); font-size: 13.5px; }
.frs-grid-table tbody tr:nth-child(even) { background: #f9fafc; }
.frs-grid-table tbody tr:hover { background: #eef1f9; }
.frs-grid-actions a { margin-right: 10px; font-size: 12.5px; font-weight: 600; }
.frs-link-danger { color: var(--frs-red); }

.frs-grid-pagination {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 12px 14px; font-size: 12.5px; color: var(--frs-text-muted);
}
.frs-grid-pager { display: flex; gap: 6px; align-items: center; }
.frs-grid-pager button {
    border: 1.5px solid var(--frs-border); background: #fff; border-radius: 6px;
    padding: 5px 10px; cursor: pointer; transition: background .15s ease;
}
.frs-grid-pager button:hover:not(:disabled) { background: var(--frs-bg); }
.frs-grid-pager button:disabled { opacity: .4; cursor: default; }

/* ============ BADGES ============ */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
}
.badge-success { background: var(--frs-green-bg); color: var(--frs-green); }
.badge-danger { background: var(--frs-red-bg); color: var(--frs-red); }
.badge-warning { background: var(--frs-amber-bg); color: var(--frs-amber); }
.badge-muted { background: #eee; color: #777; margin-left: 6px; }

/* ============ SELECTORS (Customer/Product/SearchableDropdown) ============ */
.frs-selector, .frs-inline-selector { position: relative; }
.frs-selector-input-wrap { position: relative; }
.frs-selector-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
    background: #fff; border: 1px solid var(--frs-border); border-radius: var(--frs-radius-sm);
    max-height: 260px; overflow-y: auto;
    box-shadow: var(--frs-shadow-lift);
}
.frs-selector-item { display: flex; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; }
.frs-selector-item:hover, .frs-selector-item.active { background: var(--frs-bg); }
.frs-selector-item-code { font-family: Consolas, monospace; color: #888; min-width: 60px; }
.frs-selector-item-price { margin-left: auto; font-family: Consolas, monospace; color: var(--frs-navy); }
.frs-selector-empty { padding: 10px 12px; color: #999; font-size: 12.5px; }
.frs-product-selector .frs-selector-input { min-width: 280px; }

/* ============ LINE ITEMS GRID (Invoice/Purchase/JV/Transfer/SO/PO/GRN) ============ */
.frs-invoice-scan-row { display: flex; gap: 14px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.frs-barcode-input { max-width: 220px; }

.frs-line-items-wrap { overflow-x: auto; border-radius: var(--frs-radius-sm); }
.frs-line-items-table { width: 100%; border-collapse: collapse; margin-top: 10px; min-width: 640px; }
.frs-line-items-table th {
    background: var(--frs-bg); color: var(--frs-navy); font-size: 11.5px; text-transform: uppercase;
    padding: 9px 10px; text-align: left; border-bottom: 2px solid var(--frs-border);
}
.frs-line-items-table td { padding: 6px 8px; border-bottom: 1px solid var(--frs-border); }
.frs-cell-input {
    width: 100%; border: 1px solid transparent; background: transparent;
    padding: 6px 7px; font-family: inherit; font-size: 13.5px; border-radius: 6px;
}
.frs-cell-input:focus { border-color: var(--frs-indigo); background: #fff; outline: none; }
.frs-cell-number { text-align: right; font-family: Consolas, monospace; }
.frs-empty-row { text-align: center; color: #999; padding: 24px !important; }

/* Current row indicator -- jis row me focus hai wo halka highlight ho, DataGridView jaisa */
.frs-line-items-table tbody tr.frs-row-active > td { background: rgba(76,95,213,.07); }
.frs-line-items-table tbody tr.frs-row-active > td:first-child { box-shadow: inset 3px 0 0 var(--frs-indigo); }

.frs-invoice-totals {
    display: flex; gap: 22px; flex-wrap: wrap;
    background: var(--frs-card); border-radius: var(--frs-radius); box-shadow: var(--frs-shadow);
    padding: 16px 20px; margin-top: 16px;
}
.frs-invoice-totals .frs-field { margin-bottom: 0; min-width: 130px; }
.frs-total-input { text-align: right; font-family: Consolas, monospace; }

/* ============ TREE (Chart of Accounts) ============ */
.frs-tree-container { background: var(--frs-card); border-radius: var(--frs-radius); box-shadow: var(--frs-shadow); padding: 14px 18px; overflow-x: auto; }
.frs-tree-root, .frs-tree-children { list-style: none; margin: 0; padding-left: 20px; }
.frs-tree-root { padding-left: 0; }
.frs-tree-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: default; }
.frs-tree-row:hover { background: var(--frs-bg); }
.frs-tree-toggle { width: 14px; font-size: 10px; color: var(--frs-navy); user-select: none; }
.frs-tree-label { font-size: 13.5px; }
.frs-tree-code { font-family: Consolas, monospace; color: #888; font-size: 11.5px; margin-right: 8px; }
.frs-tree-extra { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.frs-tree-extra .frs-link { font-size: 12px; }

/* ============ REPORTS ============ */
.frs-filter-panel {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
    background: var(--frs-card); border-radius: var(--frs-radius); box-shadow: var(--frs-shadow);
    padding: 18px; margin-bottom: 6px;
}
.frs-filter-panel .frs-field { margin-bottom: 0; min-width: 170px; }
.frs-date-range { display: flex; gap: 10px; flex-wrap: wrap; }
.frs-date-range label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #444; }

.frs-export-buttons { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }

.frs-report-table-wrap { overflow-x: auto; }
.frs-report-table { width: 100%; border-collapse: collapse; background: var(--frs-card); min-width: 640px; }
.frs-report-table th {
    background: var(--frs-navy); color: #fff; font-size: 11.5px;
    padding: 10px 11px; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.frs-report-table td { padding: 8px 11px; border-bottom: 1px solid var(--frs-border); font-size: 13px; }
.frs-report-table tbody tr:nth-child(even) { background: #f9fafc; }
.frs-row-warning { background: var(--frs-amber-bg) !important; }
.frs-total-row td { border-top: 2px solid var(--frs-navy); background: #eef1f9 !important; }

.frs-permission-matrix { width: 100%; border-collapse: collapse; margin-top: 10px; }
.frs-permission-matrix th, .frs-permission-matrix td {
    border: 1px solid var(--frs-border); padding: 8px 10px; font-size: 13px;
}
.frs-permission-matrix th { background: var(--frs-bg); color: var(--frs-navy); }

.frs-toolbar { margin-bottom: 14px; }

/* ============ DASHBOARD ============ */
.frs-dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--frs-radius);
    background: linear-gradient(135deg, var(--frs-navy) 0%, var(--frs-indigo) 100%);
    color: #fff;
    padding: 28px 30px;
    margin-bottom: 24px;
    box-shadow: var(--frs-shadow-lift);
}
.frs-dash-hero::before, .frs-dash-hero::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.frs-dash-hero::before { width: 220px; height: 220px; top: -110px; right: -40px; }
.frs-dash-hero::after { width: 140px; height: 140px; bottom: -80px; right: 120px; background: rgba(255,255,255,.06); }
.frs-dash-hero h1 { margin: 0; font-size: 23px; color: #fff; position: relative; }
.frs-dash-hero .frs-muted { color: rgba(255,255,255,.78); font-size: 13px; margin-top: 4px; position: relative; }

.frs-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.frs-stat-card {
    background: var(--frs-card);
    border-radius: var(--frs-radius);
    box-shadow: var(--frs-shadow);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
    animation: frs-rise .35s ease backwards;
}
.frs-stat-grid .frs-stat-card:nth-child(1) { animation-delay: .02s; }
.frs-stat-grid .frs-stat-card:nth-child(2) { animation-delay: .08s; }
.frs-stat-grid .frs-stat-card:nth-child(3) { animation-delay: .14s; }
.frs-stat-grid .frs-stat-card:nth-child(4) { animation-delay: .2s; }
.frs-stat-card:hover { transform: translateY(-3px); box-shadow: var(--frs-shadow-lift); }
.frs-stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--stat-accent, var(--frs-indigo));
}
.frs-stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    background: var(--stat-accent-bg, #EEF0FD); color: var(--stat-accent, var(--frs-indigo));
    transition: transform .15s ease;
}
.frs-stat-icon svg { width: 21px; height: 21px; }
.frs-stat-card:hover .frs-stat-icon { transform: scale(1.08) rotate(-4deg); }

@keyframes frs-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .frs-stat-card { animation: none; }
}
.frs-stat-label { font-size: 12px; color: var(--frs-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.frs-stat-value { font-size: 26px; font-weight: 800; color: var(--frs-text); margin-top: 4px; font-family: Consolas, monospace; }
.frs-stat-sub { font-size: 11.5px; color: var(--frs-text-muted); margin-top: 4px; }
.frs-stat-sub.up { color: var(--frs-green); }
.frs-stat-sub.down { color: var(--frs-red); }

.frs-dash-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
}
.frs-dash-card {
    background: var(--frs-card);
    border-radius: var(--frs-radius);
    box-shadow: var(--frs-shadow);
    padding: 20px 22px;
}
.frs-dash-card h3 {
    margin: 0 0 14px; font-size: 15px; color: var(--frs-navy);
    display: flex; justify-content: space-between; align-items: center;
}
.frs-dash-card h3 a { font-size: 12px; font-weight: 600; }

.frs-quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.frs-quick-actions a {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 14px; border-radius: var(--frs-radius-sm);
    background: var(--frs-bg); color: var(--frs-navy); font-weight: 600; font-size: 13px;
    transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
    min-height: 44px;
}
.frs-quick-actions a:hover { background: #e4e8f5; text-decoration: none; transform: translateY(-2px); box-shadow: var(--frs-shadow); }
.frs-quick-actions .icon {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--stat-accent-bg, #EEF0FD); color: var(--stat-accent, var(--frs-indigo));
}
.frs-quick-actions .icon svg { width: 17px; height: 17px; }

.frs-mini-list { list-style: none; margin: 0; padding: 0; }
.frs-mini-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--frs-border); font-size: 13px;
}
.frs-mini-list li:last-child { border-bottom: none; }
.frs-mini-list .amt { font-family: Consolas, monospace; font-weight: 700; color: var(--frs-navy); }

/* ============ SWITCH TOGGLE (System Parameters) ============ */
.frs-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.frs-switch input { opacity: 0; width: 0; height: 0; }
.frs-switch-track {
    position: absolute; inset: 0; background: #ccd1dc; border-radius: 24px; cursor: pointer;
    transition: background .2s ease;
}
.frs-switch-track::before {
    content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.frs-switch input:checked + .frs-switch-track { background: var(--frs-green); }
.frs-switch input:checked + .frs-switch-track::before { transform: translateX(20px); }

.frs-param-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 18px; border-bottom: 1px solid var(--frs-border);
}
.frs-param-row:last-child { border-bottom: none; }
.frs-param-title { font-weight: 600; font-size: 13.5px; }
.frs-param-desc { font-size: 12px; color: var(--frs-text-muted); margin-top: 2px; }

/* ============ PRINT ============ */
.frs-print-brand-footer { display: none; }
.frs-print-header { display: none; }

@media print {
    .frs-sidebar, .frs-topbar, .frs-page-actions, .frs-filter-panel,
    .frs-export-buttons, .frs-form-actions, form#filterForm, .frs-no-print {
        display: none !important;
    }
    .frs-main { margin-left: 0 !important; }
    body.frs-printing .frs-content { padding: 0; }
    .frs-report-table th { background: #1F3864 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .frs-print-header {
        display: flex; gap: 14px; align-items: center; border-bottom: 3px solid #1F3864; padding-bottom: 10px; margin-bottom: 14px;
    }
    .frs-print-header img { max-height: 64px; max-width: 140px; object-fit: contain; }
    .frs-print-header h2 { margin: 0 0 3px 0; font-size: 20px; color: #1F3864; }
    .frs-print-header p { margin: 0; font-size: 12px; color: #444; line-height: 1.5; }
    .frs-print-brand-footer {
        display: block; text-align: center; font-size: 10px; color: #555;
        margin-top: 20px; border-top: 1px solid #ccc; padding-top: 8px;
    }
}

/* Thermal receipt sizes -- table horizontal hi rehta hai (jaisa A4/A3 me),
   font/padding chhota kar dete hain. Ledger/report tables ke 10+ columns
   hote hain -- inhe zabardasti 2-3 inch me fix-width squeeze karne se
   header text letter-by-letter toot jata hai, isliye yahan width/table-layout
   force nahi karte, table apni natural width le kar print hoti hai
   (.frs-report-table-wrap ka overflow-x:auto screen pe scroll de deta hai).
   ponytail: 10+ column report thermal roll pe chhota/multi-page print hoga
   (physical width limit, koi CSS trick fix nahi karti) -- agar kisi report
   ko thermal pe genuinely chahiye ho, per-report "kaunse columns thermal pe
   dikhane hain" config add karna hoga tab. */
body[data-print-size="thermal2"] .frs-report-table,
body[data-print-size="thermal3"] .frs-report-table { min-width: 0; font-size: 8px; }
body[data-print-size="thermal2"] .frs-report-table th,
body[data-print-size="thermal2"] .frs-report-table td,
body[data-print-size="thermal3"] .frs-report-table th,
body[data-print-size="thermal3"] .frs-report-table td {
    padding: 1px 3px; white-space: nowrap;
}
body[data-print-size="a3"] .frs-report-table { min-width: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .frs-sidebar { transform: translateX(-100%); box-shadow: var(--frs-shadow-lift); }
    .frs-sidebar.open { transform: translateX(0); }
    .frs-sidebar-close { display: block; }
    .frs-sidebar-overlay.open { display: block; }

    .frs-main { margin-left: 0; }
    .frs-hamburger { display: block; }

    .frs-content { padding: 16px; }
    .frs-dash-grid { grid-template-columns: 1fr; }
    .frs-quick-actions { grid-template-columns: 1fr; }
    .frs-form-grid { grid-template-columns: 1fr; }
    .frs-checkbox-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .frs-page-header { flex-direction: column; align-items: flex-start; }
    .frs-dash-hero { padding: 20px; }
    .frs-dash-hero h1 { font-size: 19px; }
    .frs-dash-hero::before, .frs-dash-hero::after { display: none; }
    .frs-stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .frs-stat-value { font-size: 20px; }
    .frs-checkbox-list { grid-template-columns: 1fr; }
    .frs-invoice-totals { flex-direction: column; gap: 10px; }
    .btn { width: 100%; justify-content: center; }
    .frs-page-actions { width: 100%; }
    .frs-page-actions .btn { flex: 1; }
    .frs-param-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/**********************************************************************************
  V3 THEME -- modern look (upar ke rules ko override karta hai, isliye file ke aakhir me)
  Indigo/violet brand, glass topbar, pill nav, soft cards, clean tables, mobile-first.
**********************************************************************************/
:root {
    --frs-navy: #1e2a5a;
    --frs-navy-light: #3a4a9c;
    --frs-navy-dark: #121a3d;
    --frs-indigo: #5b5bf0;
    --frs-violet: #8b5cf6;
    --frs-bg: #f4f5fb;
    --frs-border: #e4e7f1;
    --frs-text: #172036;
    --frs-text-muted: #6a7389;
    --frs-radius: 16px;
    --frs-radius-sm: 10px;
    --frs-shadow: 0 1px 2px rgba(23,32,54,.04), 0 6px 20px rgba(23,32,54,.06);
    --frs-shadow-lift: 0 14px 36px rgba(60,60,160,.18);
    --frs-grad: linear-gradient(135deg, #4f46e5 0%, #7c5cf0 55%, #a06cf5 100%);
    --sidebar-w: 262px;
}
body {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 500px at 85% -10%, rgba(124,92,240,.10), transparent 60%), var(--frs-bg);
    background-attachment: fixed;
    line-height: 1.45;
}
a:hover { text-decoration: none; }
h1, h2, h3 { letter-spacing: -.01em; }
::selection { background: rgba(91,91,240,.22); }
:focus-visible { outline: 2px solid var(--frs-indigo); outline-offset: 2px; }

/* ---- sidebar ---- */
.frs-sidebar {
    background: radial-gradient(420px 260px at 0% 0%, rgba(139,92,246,.35), transparent 70%),
                linear-gradient(185deg, #1b2457 0%, #121a3d 60%, #0e1431 100%);
    box-shadow: 4px 0 24px rgba(10,14,40,.18);
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.frs-sidebar-brand { padding: 22px 20px 14px; }
.frs-sidebar-brand-mark { background: var(--frs-grad); box-shadow: 0 6px 16px rgba(124,92,240,.5); }
.frs-nav { padding: 4px 12px; gap: 2px; }
.frs-nav-group { color: rgba(255,255,255,.38); font-size: 10px; letter-spacing: 1.1px; padding: 18px 12px 6px; }
.frs-nav a {
    position: relative; color: rgba(255,255,255,.78); padding: 9px 12px; border-radius: 10px;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.frs-nav a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.frs-nav a.active {
    background: linear-gradient(90deg, rgba(139,92,246,.45), rgba(91,91,240,.18));
    color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.frs-nav a.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
    border-radius: 0 4px 4px 0; background: #c4b5fd;
}
.frs-nav-icon { opacity: .8; }

/* ---- topbar ---- */
.frs-topbar {
    background: rgba(255,255,255,.82);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid rgba(228,231,241,.9);
    padding: 10px 24px; min-height: 60px;
}
.frs-topbar-left { min-width: 0; }
.frs-topbar-title { font-size: 17px; font-weight: 700; color: var(--frs-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frs-hamburger {
    width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center;
    border: 1px solid var(--frs-border); background: #fff; color: var(--frs-navy);
}
.frs-hamburger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.frs-topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.frs-branch-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--frs-text-muted);
    background: #fff; border: 1px solid var(--frs-border); border-radius: 999px; padding: 4px 6px 4px 12px;
}
.frs-branch-chip:empty { display: none; }
.frs-branch-chip strong { color: var(--frs-navy); padding-right: 8px; }
.frs-branch-chip select {
    border: 0; background: rgba(91,91,240,.1); color: var(--frs-navy); font-weight: 600; font-size: 12.5px;
    border-radius: 999px; padding: 5px 8px; cursor: pointer; max-width: 150px;
}
.frs-usermenu { position: relative; }
.frs-usermenu > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
    padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--frs-border); background: #fff;
    font-weight: 600; color: var(--frs-navy); font-size: 13px; user-select: none;
}
.frs-usermenu > summary::-webkit-details-marker { display: none; }
.frs-usermenu > summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.frs-usermenu[open] > summary { box-shadow: 0 0 0 3px rgba(91,91,240,.15); }
.frs-usermenu-pop {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 300;
    background: #fff; border: 1px solid var(--frs-border); border-radius: 14px; padding: 8px; box-shadow: var(--frs-shadow-lift);
    animation: frs-rise .15s ease;
}
.frs-usermenu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--frs-border); margin-bottom: 6px; font-weight: 700; color: var(--frs-navy); }
.frs-usermenu-pop a, .frs-usermenu-pop button {
    display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
    color: var(--frs-text); font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.frs-usermenu-pop a:hover, .frs-usermenu-pop button:hover { background: rgba(91,91,240,.08); }
.frs-usermenu-pop .danger { color: var(--frs-red); }
.frs-topbar-avatar { background: var(--frs-grad); width: 32px; height: 32px; box-shadow: 0 3px 8px rgba(124,92,240,.4); }

.frs-content { padding: 28px; }

/* ---- page header / buttons / forms ---- */
.frs-page-header h1 { font-size: 22px; font-weight: 800; color: var(--frs-navy); }
.btn { border-radius: 11px; min-height: 42px; padding: 10px 20px; font-size: 14px; }
.btn-primary { background: var(--frs-grad); box-shadow: 0 6px 16px rgba(91,91,240,.35); }
.btn-primary:hover { box-shadow: 0 10px 22px rgba(91,91,240,.45); transform: translateY(-1px); filter: saturate(1.1); }
.btn-secondary { background: #fff; color: var(--frs-navy); border: 1px solid var(--frs-border); box-shadow: 0 1px 2px rgba(23,32,54,.05); }
.btn-secondary:hover { background: #f1f2fb; border-color: #d3d7ea; }
.btn-export-excel { background: linear-gradient(135deg,#22a565,#168a50); }
.btn-export-pdf { background: linear-gradient(135deg,#d9453f,#b42f2a); }
.btn-export-print, .btn-export-size { background: #475069; }
.form-control { border: 1.5px solid var(--frs-border); border-radius: var(--frs-radius-sm); background: #fbfcff; }
.form-control:hover { border-color: #ccd1e6; }
.form-control:focus { background: #fff; border-color: var(--frs-indigo); box-shadow: 0 0 0 4px rgba(91,91,240,.14); }
.frs-field label { color: #3b4460; letter-spacing: .01em; }
.frs-field-divider { color: var(--frs-navy); border-bottom: 0; background: linear-gradient(90deg, rgba(91,91,240,.12), transparent); padding: 7px 10px; border-radius: 8px; }

/* ---- cards, filter panel ---- */
.frs-card, .frs-dash-card, .frs-grid, .frs-filter-panel, .frs-invoice-totals, .frs-tree-container {
    border: 1px solid rgba(228,231,241,.9); border-radius: var(--frs-radius); box-shadow: var(--frs-shadow);
}
.frs-filter-panel { background: #fff; padding: 18px 20px; gap: 14px 18px; }
.frs-checkbox-list { border-radius: var(--frs-radius-sm); background: #fbfcff; }

/* ---- tables ---- */
.frs-grid-table th, .frs-report-table th {
    background: #f0f2fb; color: #3a4568; font-size: 11px; letter-spacing: .7px;
    border-bottom: 1px solid var(--frs-border); padding: 12px 13px;
}
.frs-grid-table td, .frs-report-table td { padding: 11px 13px; border-bottom: 1px solid #eef0f7; }
.frs-grid-table tbody tr:nth-child(even), .frs-report-table tbody tr:nth-child(even) { background: transparent; }
.frs-grid-table tbody tr, .frs-report-table tbody tr { transition: background .12s ease; }
.frs-grid-table tbody tr:hover, .frs-report-table tbody tr:hover { background: rgba(91,91,240,.05); }
.frs-report-table-wrap { border: 1px solid var(--frs-border); border-radius: var(--frs-radius); box-shadow: var(--frs-shadow); background: #fff; }
.frs-total-row td { background: #f0f2fb !important; border-top: 2px solid var(--frs-indigo); font-weight: 700; }
.frs-grid-actions a { color: var(--frs-indigo); }
.frs-grid-pager button { border-radius: 8px; }
.badge { padding: 4px 11px; border-radius: 999px; }

/* ---- dashboard ---- */
.frs-dash-hero {
    background: radial-gradient(520px 260px at 90% 0%, rgba(255,255,255,.22), transparent 65%), var(--frs-grad);
    border-radius: 20px; padding: 28px 30px; margin-bottom: 22px;
    box-shadow: 0 18px 40px rgba(91,91,240,.32);
    display: flex; justify-content: space-between; align-items: flex-end; gap: 18px 24px; flex-wrap: wrap;
}
.frs-dash-hero h1 { font-size: 26px; font-weight: 800; }
.frs-dash-hero-text { position: relative; min-width: 0; }
.frs-hero-filter { position: relative; z-index: 1; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.frs-hero-filter .frs-field { margin: 0; }
.frs-hero-filter label { color: rgba(255,255,255,.85); }
.frs-hero-filter .frs-muted { color: rgba(255,255,255,.7); }
.frs-hero-filter .frs-checkbox-list {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 0; border: 0; background: transparent; max-height: none !important; min-width: 0 !important; overflow: visible !important;
}
.frs-hero-filter .frs-checkbox-item {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
    background: rgba(255,255,255,.16); color: #fff; font-size: 12.5px; border: 1px solid rgba(255,255,255,.28); transition: background .15s ease;
}
.frs-hero-filter .frs-checkbox-item input { accent-color: #fff; }
.frs-hero-filter .frs-checkbox-item:has(input:checked) { background: #fff; color: var(--frs-navy); font-weight: 700; }
.frs-hero-filter .btn { background: #fff; color: var(--frs-navy); box-shadow: 0 6px 16px rgba(0,0,0,.18); min-height: 38px; padding: 8px 18px; }

.frs-stat-grid { gap: 16px; }
.frs-stat-card { border: 1px solid rgba(228,231,241,.9); border-radius: 18px; padding: 20px; }
.frs-stat-card::before { height: 0; }
.frs-stat-card::after {
    content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
    background: var(--stat-accent-bg, #EEF0FD); opacity: .9; transition: transform .25s ease;
}
.frs-stat-card:hover::after { transform: scale(1.25); }
.frs-stat-card > * { position: relative; z-index: 1; }
.frs-stat-icon { background: var(--stat-accent); color: #fff; border-radius: 12px; box-shadow: 0 8px 18px color-mix(in srgb, var(--stat-accent) 40%, transparent); }
.frs-stat-value { font-size: 28px; font-family: 'Segoe UI Variable Display', 'Segoe UI', sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.frs-stat-label { font-size: 11.5px; letter-spacing: .6px; }
.frs-dash-card h3 { font-size: 16px; }
.frs-mini-list li { padding: 12px 0; }
.frs-mini-list .amt { color: var(--frs-indigo); }
.frs-quick-actions a { background: #f6f7fd; border: 1px solid transparent; border-radius: 12px; }
.frs-quick-actions a:hover { background: #fff; border-color: var(--frs-border); }
.frs-quick-actions .icon { background: var(--stat-accent); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--stat-accent) 35%, transparent); }

/* ---- auth ---- */
.frs-auth-brand { background: radial-gradient(600px 400px at 100% 0%, rgba(255,255,255,.18), transparent 60%), var(--frs-grad); }
.frs-auth-card h2 { font-size: 26px; font-weight: 800; }
.frs-auth-card .btn-primary { border-radius: 12px; }

/* ---- scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: #c6cbe0 transparent; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
    .frs-content { padding: 22px; }
}
@media (max-width: 900px) {
    .frs-sidebar { width: min(86vw, 300px); }
    .frs-hamburger { display: inline-flex; }
    .frs-topbar { padding: 8px 14px; }
    .frs-topbar-title { font-size: 16px; }
    .frs-usermenu > summary .uname { display: none; }
    .frs-usermenu > summary { padding-right: 10px; }
    .frs-content { padding: 16px; }
    .frs-dash-hero { padding: 22px 20px; border-radius: 18px; }
    .frs-dash-hero h1 { font-size: 22px; }
    .frs-filter-panel { padding: 14px; }
    .frs-filter-panel .frs-field { min-width: calc(50% - 10px); flex: 1 1 calc(50% - 10px); }
}
@media (max-width: 600px) {
    .frs-branch-chip { padding-left: 8px; font-size: 11.5px; }
    .frs-branch-chip select { max-width: 72px; }
    .frs-topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
    .frs-topbar-left { gap: 8px; min-width: 0; flex: 1 1 auto; }
    .frs-topbar-left > * { min-width: 0; }
    .frs-branch-chip strong { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .frs-filter-panel .frs-field, .frs-date-range, .frs-date-range label { min-width: 100%; flex: 1 1 100%; width: 100%; }
    .frs-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .frs-stat-card { padding: 14px; border-radius: 16px; }
    .frs-stat-value { font-size: 21px; }
    .frs-stat-icon { width: 36px; height: 36px; margin-bottom: 8px; }
    .frs-dash-hero { flex-direction: column; align-items: stretch; }
    .frs-hero-filter { align-items: stretch; }
    .frs-hero-filter .btn { width: auto; }
    .frs-export-buttons .btn { flex: 1 1 calc(50% - 10px); }
    .frs-grid-toolbar .form-control { max-width: none; }
    .frs-quick-actions { grid-template-columns: 1fr 1fr; }
}
@media (hover: none) {
    .frs-nav a:hover, .frs-stat-card:hover, .btn-primary:hover { transform: none; }
}

button, input, select, textarea { font-family: inherit; }

/* ---- Responsive tables ----
   (1) Report tables bina wrapper wale pages me poora page side-ways scroll karte the: chhoti screen par table apne andar scroll kare.
   (2) table.frs-stack (chhoti master/list tables): phone par har row ek card, har cell ke saath uska heading (data-label, frs-core.js se). */
@media (max-width: 900px) {
    .frs-report-table:not(.frs-stack) th, .frs-report-table:not(.frs-stack) td { white-space: nowrap; }
}
@media (max-width: 720px) {
    table.frs-report-table.frs-stack { min-width: 0; display: block; background: transparent; max-width: none !important; }
    table.frs-stack thead { display: none; }
    table.frs-stack tbody, table.frs-stack tr, table.frs-stack td { display: block; width: 100%; }
    table.frs-stack tbody tr, table.frs-stack tbody tr:nth-child(even) { background: var(--frs-card, #fff); border: 1px solid var(--frs-border); border-radius: 10px; margin: 0 0 10px; padding: 6px 12px; }
    table.frs-stack td, table.frs-stack th { white-space: normal; }
    table.frs-stack td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 6px 0; border: 0; text-align: right !important; min-height: 28px; }
    table.frs-stack td::before { content: attr(data-label); flex: 0 0 auto; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--frs-muted, #6b7280); text-align: left; }
    table.frs-stack td[data-label=""]::before, table.frs-stack td:not([data-label])::before { content: none; }
    table.frs-stack td[colspan] { display: block; text-align: center !important; }
    table.frs-stack td[colspan]::before { content: none; }
    table.frs-stack td:last-child:not([data-label]), table.frs-stack td[data-label=""] { justify-content: flex-end; border-top: 1px solid var(--frs-border); margin-top: 4px; padding-top: 8px; }
}

/* ---- Professional / flat look (sab natures ke liye) ----
   Gradient buttons, glow shadows, decorative circles aur "template" jaisi chamak hata di; solid brand colour, halki border, kam shadow.
   Brand colour nature-theme se (--frs-navy) hi aata hai, isliye har company ka apna rang rehta hai. */
body { background: var(--frs-bg); }
.btn, .frs-field input, .frs-field select, .frs-field textarea, .form-control { border-radius: 8px; }
.btn { min-height: 38px; padding: 8px 16px; font-weight: 600; }
.btn-primary { background: var(--frs-navy); color: #fff; border: 1px solid var(--frs-navy); box-shadow: none; filter: none; }
.btn-primary:hover { background: var(--frs-navy-light); border-color: var(--frs-navy-light); box-shadow: none; transform: none; filter: none; }
.btn-secondary { box-shadow: none; }
.btn-sm { min-height: 30px; padding: 4px 11px; font-size: 12.5px; }
.frs-sidebar-brand-mark, .frs-topbar-avatar { background: var(--frs-navy); box-shadow: none; }
.frs-dash-hero { background: var(--frs-navy); box-shadow: none; border-radius: 12px; padding: 22px 26px; }
.frs-dash-hero::before, .frs-dash-hero::after, .frs-auth-brand::before, .frs-auth-brand::after, .frs-stat-card::before, .frs-stat-card::after { display: none; }
.frs-auth-brand { background: var(--frs-navy); }
.frs-stat-card { box-shadow: 0 1px 2px rgba(20,30,60,.06); border: 1px solid var(--frs-border); animation: none; }
.frs-stat-card:hover { transform: none; box-shadow: 0 1px 2px rgba(20,30,60,.06); }
.frs-card, .frs-filter-panel { box-shadow: 0 1px 2px rgba(20,30,60,.05); }
.frs-field-divider { background: #eef1f6; }
.btn-export-excel { background: #1f8a54; } .btn-export-pdf { background: #b3342f; }

/* ---- phone topbar: lamba page title / branch / user menu ek line me (page side-ways na khule) ---- */
@media (max-width: 600px) {
    .frs-topbar-left { min-width: 0; flex: 1 1 auto; }
    .frs-topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .frs-topbar-right { flex: 0 0 auto; min-width: 0; }
    .frs-usermenu .uname { display: none; }
}

/* ---- phone: inline fixed widths wale forms (min-width / flex-basis) screen se bahar na jayen ---- */
@media (max-width: 700px) {
    .frs-field[style*="min-width"] { min-width: 0 !important; width: 100%; }
    .frs-form-actions { flex-wrap: wrap; }
    .frs-card[style*="flex:"], div[style*="flex:1 1"], div[style*="flex:2 1"] { flex-basis: 100% !important; min-width: 0 !important; max-width: 100% !important; }
    .frs-form-grid { grid-template-columns: 1fr !important; }
}

/* JS (frs-core.js) har .frs-report-table ko is wrapper me daalta hai: chaura table apne andar scroll kare, page nahi */
.frs-table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) { .frs-table-scroll:has(> table.frs-stack) { overflow: visible; } }
