
/* =========================================================
   FirstMarket Readability v7
   Global typography upgrade without changing layout/colors
   ========================================================= */

:root{
  --fm-body-size: 16px;
  --fm-table-size: 15px;
  --fm-small-size: 14px;
  --fm-button-size: 15px;
  --fm-input-size: 16px;
  --fm-card-title-size: 18px;
  --fm-page-title-size: 28px;
  --fm-sidebar-size: 15px;
}

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body{
  font-size: var(--fm-body-size) !important;
  line-height: 1.75 !important;
}

/* General readable text */
p,
span,
label,
li,
td,
th,
small,
strong,
b,
a,
div,
section,
article{
  text-rendering: optimizeLegibility;
}

/* Prevent legacy tiny typography */
body :is(
  p, span, label, li, td, th, small,
  .text, .description, .desc, .subtitle, .sub,
  .muted, .helper, .hint, .meta, .caption,
  .card-sub, .card-desc, .row-sub, .item-sub,
  .sidebar span, .nav-item, .nav-title
){
  font-size: max(14px, 1em);
}

/* Tables */
table{
  font-size: var(--fm-table-size) !important;
}

table th{
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
}

table td{
  font-size: 15px !important;
  line-height: 1.7 !important;
}

.table-wrap,
.table-container,
.data-table{
  font-size: 15px !important;
}

/* Buttons */
button,
.btn,
.button,
.primary,
.secondary,
.ghost-btn,
.primary-btn,
.danger-btn,
.action-btn,
.admin-action,
.desktop-btn,
.pay-btn{
  font-size: var(--fm-button-size) !important;
  line-height: 1.4 !important;
  min-height: 42px;
}

/* Inputs */
input,
select,
textarea{
  font-size: var(--fm-input-size) !important;
  line-height: 1.5 !important;
}

input::placeholder,
textarea::placeholder{
  font-size: 14px !important;
}

/* Page titles */
h1,
.page-title,
.top-title h1,
.header h1,
.content h1{
  font-size: clamp(26px, 2.2vw, 32px) !important;
  line-height: 1.4 !important;
}

h2,
.section-title h2,
.card h2{
  font-size: clamp(20px, 1.8vw, 24px) !important;
  line-height: 1.45 !important;
}

h3{
  font-size: 19px !important;
  line-height: 1.5 !important;
}

h4,
.card-title,
.section-title strong,
.card-head strong,
.column-head strong{
  font-size: var(--fm-card-title-size) !important;
  line-height: 1.5 !important;
}

/* Sidebar / navigation */
.sidebar,
.sidebar .nav,
.sidebar .nav-item,
.sidebar a,
.nav-item,
.bottom-nav,
.bottom-nav a{
  font-size: var(--fm-sidebar-size) !important;
}

.sidebar .nav-title,
.nav-group-title{
  font-size: 14px !important;
}

.nav-badge,
.badge,
.status,
.status-pill{
  font-size: 13.5px !important;
  line-height: 1.35 !important;
}

/* Cards and lists */
.card,
.order-card,
.mission,
.tx,
.list-row,
.info,
.stat,
.kpi{
  font-size: 15px !important;
}

.card p,
.order-card p,
.mission p,
.tx p,
.info span,
.stat span,
.kpi span{
  font-size: 14px !important;
  line-height: 1.7 !important;
}

.card strong,
.order-card strong,
.mission strong,
.tx strong,
.info strong,
.stat strong,
.kpi strong{
  font-size: 16px !important;
}

/* Mobile: keep text readable */
@media (max-width: 700px){
  body{
    font-size: 16px !important;
  }

  table,
  table th,
  table td{
    font-size: 14.5px !important;
  }

  button,
  .btn,
  .button,
  .primary,
  .secondary,
  .ghost-btn,
  .primary-btn,
  .danger-btn,
  .action-btn,
  .admin-action{
    font-size: 15px !important;
    min-height: 44px;
  }

  input,
  select,
  textarea{
    font-size: 16px !important;
  }

  .sidebar,
  .nav-item,
  .bottom-nav,
  .bottom-nav a{
    font-size: 15px !important;
  }
}

/* Extra hard-stop for tiny legacy classes */
body [style*="font-size:6px"],
body [style*="font-size: 6px"],
body [style*="font-size:7px"],
body [style*="font-size: 7px"],
body [style*="font-size:8px"],
body [style*="font-size: 8px"],
body [style*="font-size:9px"],
body [style*="font-size: 9px"],
body [style*="font-size:10px"],
body [style*="font-size: 10px"],
body [style*="font-size:11px"],
body [style*="font-size: 11px"],
body [style*="font-size:12px"],
body [style*="font-size: 12px"]{
  font-size: 14px !important;
}
