/* ============================================================
   style.css — Aria Software · Módulo Fornecedores Standalone
   Paleta: sidebar #1a2e4a · accent #2563eb
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg  : #1a2e4a;
  --sidebar-w   : 260px;
  --accent      : #2563eb;
  --accent-hov  : #1d4ed8;
  --accent-light: #eff6ff;
  --success     : #16a34a;
  --danger      : #dc2626;
  --warning     : #d97706;
  --info        : #0891b2;
  --text-main   : #111827;
  --text-muted  : #6b7280;
  --border      : #e5e7eb;
  --card-bg     : #ffffff;
  --page-bg     : #f3f4f6;
  --radius      : 10px;
  --shadow      : 0 1px 4px rgba(0,0,0,.08);
  --shadow-md   : 0 4px 16px rgba(0,0,0,.13);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--page-bg);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; font-weight: 700;
}
.sidebar-logo-text { color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.2; }
.sidebar-logo-text span { display: block; font-size: .72rem; font-weight: 400; opacity: .6; }

.sidebar-user {
  padding: 14px 20px;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-section {
  padding: 20px 12px 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
}

.sidebar-nav { padding: 4px 12px; list-style: none; }
.sidebar-nav li + li { margin-top: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: all .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.sidebar-nav a svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.5); font-size: .83rem;
  text-decoration: none; padding: 8px 12px; border-radius: 7px;
  transition: all .15s;
}
.sidebar-footer a:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}
.page-wrapper {
  padding: 32px 36px;
  max-width: 1300px;
}

/* ── Tipografia de página ─────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--text-main); }
.page-header p  { color: var(--text-muted); font-size: .88rem; margin-top: 3px; }

.breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 5px; opacity: .5; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 15px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header strong { font-size: .95rem; }
.card-header span   { font-size: .82rem; color: var(--text-muted); }

/* ── KPIs ─────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-left: 4px solid transparent; }
.kpi.blue   { border-color: var(--accent); }
.kpi.red    { border-color: var(--danger); }
.kpi.orange { border-color: var(--warning); }
.kpi.green  { border-color: var(--success); }
.kpi .k-label { font-size: .74rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-value { font-size: 1.6rem; font-weight: 800; margin: 5px 0 2px; color: var(--text-main); line-height: 1; }
.kpi.red    .k-value { color: var(--danger); }
.kpi.orange .k-value { color: var(--warning); }
.kpi.green  .k-value { color: var(--success); }
.kpi .k-sub { font-size: .76rem; color: var(--text-muted); }

/* ── Tabela ───────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f3f4f6; padding: 10px 16px;
  text-align: left; font-size: .74rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 11px 16px; font-size: .87rem; color: var(--text-main); vertical-align: middle; }
tbody tr.row-vencido { background: #fff7ed; }
tbody tr.row-vencido:hover { background: #ffedd5; }
tbody tr.row-pago td { color: var(--text-muted); }

/* ── Badges ───────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.badge-active    { background: #dcfce7; color: var(--success); }
.badge-inactive  { background: #f3f4f6; color: var(--text-muted); }
.badge-pj        { background: #eff6ff; color: var(--accent); }
.badge-pf        { background: #fef3c7; color: var(--warning); }
.badge-pending   { background: #fef9c3; color: #92400e; }
.badge-overdue   { background: #fee2e2; color: var(--danger); }
.badge-paid      { background: #dcfce7; color: var(--success); }
.badge-cancelled { background: #f3f4f6; color: var(--text-muted); }

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: .88rem;
  font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hov); }
.btn-outline  { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-light); }
.btn-ghost    { background: none; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover  { background: #f3f4f6; }
.btn-sm { padding: 5px 12px; font-size: .8rem; border-radius: 6px; }
.btn-success-sm  { background: #dcfce7; color: var(--success);  border: none; cursor: pointer; padding: 5px 11px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.btn-warning-sm  { background: #fef3c7; color: var(--warning);  border: none; cursor: pointer; padding: 5px 11px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.btn-danger-sm   { background: #fee2e2; color: var(--danger);   border: none; cursor: pointer; padding: 5px 11px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.btn-info-sm     { background: #e0f2fe; color: var(--info);     border: none; cursor: pointer; padding: 5px 11px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.btn-success-sm:hover { background: #bbf7d0; }
.btn-warning-sm:hover { background: #fde68a; }
.btn-danger-sm:hover  { background: #fecaca; }
.btn-info-sm:hover    { background: #bae6fd; }

/* ── Filtros ──────────────────────────────────────────────── */
.filter-bar {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 18px;
  margin-bottom: 18px; display: flex; flex-wrap: wrap;
  gap: 10px; align-items: flex-end;
}
.filter-bar label { font-size: .76rem; color: var(--text-muted); display: block; margin-bottom: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.filter-bar input,
.filter-bar select { border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: .87rem; background: #fff; color: var(--text-main); }
.filter-bar input:focus,
.filter-bar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ── Formulários ──────────────────────────────────────────── */
.form-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.form-card-header { padding: 14px 22px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .9rem; color: var(--text-main); background: #f8fafc; display: flex; align-items: center; gap: 8px; }
.form-card-body { padding: 22px; }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.field-full { grid-column: 1 / -1; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label { font-size: .77rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.field-group input,
.field-group select,
.field-group textarea { border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; font-size: .9rem; color: var(--text-main); background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s; }
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field-group textarea { min-height: 90px; resize: vertical; }
.field-group input[readonly] { background: #f3f4f6; color: var(--text-muted); }

/* ── Flash ────────────────────────────────────────────────── */
.flash { padding: 13px 18px; border-radius: 8px; margin-bottom: 18px; font-size: .9rem; font-weight: 500; }
.flash-success { background: #dcfce7; color: var(--success); border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: var(--danger);  border: 1px solid #fecaca; }

/* ── Paginação ────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 5px; padding: 14px 18px; border-top: 1px solid var(--border); justify-content: flex-end; }
.pagination a, .pagination span { padding: 5px 11px; border-radius: 6px; font-size: .82rem; text-decoration: none; color: var(--text-muted); border: 1px solid var(--border); background: #fff; }
.pagination a:hover { background: var(--accent-light); color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* ── Modais ───────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 9000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; box-shadow: var(--shadow-md); overflow: hidden; animation: modalIn .18s ease; }
@keyframes modalIn { from { transform: translateY(12px); opacity:0 } to { transform:none; opacity:1 } }
.modal-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: #f3f4f6; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 12px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: #f9fafb; }
.mfield { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.mfield:last-child { margin-bottom: 0; }
.mfield label { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.mfield input, .mfield select, .mfield textarea { border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; font-size: .9rem; color: var(--text-main); background: #fff; width: 100%; }
.mfield input:focus, .mfield select:focus, .mfield textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.mfield input[readonly] { background: #f3f4f6; color: var(--text-muted); }
.mfield textarea { min-height: 70px; resize: vertical; }
.mrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-pill { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 11px 14px; margin-bottom: 16px; font-size: .85rem; color: #1e40af; display: flex; flex-direction: column; gap: 3px; }
.diff-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .8rem; font-weight: 700; }
.diff-pill.desconto  { background: #dcfce7; color: var(--success); }
.diff-pill.acrescimo { background: #fee2e2; color: var(--danger); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-state svg { width: 46px; height: 46px; opacity: .3; display: block; margin: 0 auto 12px; }
.empty-state p { font-size: .9rem; }
.empty-state a { color: var(--accent); }

/* ── Tab bar ──────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 5px; width: fit-content; }
.tab-bar a { padding: 7px 16px; border-radius: 7px; font-size: .87rem; font-weight: 600; text-decoration: none; color: var(--text-muted); transition: all .15s; }
.tab-bar a.active { background: var(--accent); color: #fff; }
.tab-bar a:not(.active):hover { background: var(--accent-light); color: var(--accent); }

/* ── Toast ────────────────────────────────────────────────── */
.toast-fixed { position: fixed; bottom: 24px; right: 24px; background: var(--text-main); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-md); z-index: 9999; transform: translateY(80px); opacity: 0; transition: all .25s ease; pointer-events: none; }
.toast-fixed.show { transform: none; opacity: 1; }

/* ── Toggle ───────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); background: #f8fafc; }
.toggle-label { font-size: .9rem; font-weight: 600; color: var(--text-main); }
.toggle-sub   { font-size: .78rem; color: var(--text-muted); }

/* ── Summary cards ────────────────────────────────────────── */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.summary-card .label { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.summary-card .value { font-size: 1.9rem; font-weight: 800; color: var(--text-main); margin-top: 5px; }
.summary-card .sub   { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }

/* ── Ações inline ─────────────────────────────────────────── */
.actions-cell { display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; }

/* ── Login ────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); }
.login-box { background: #fff; border-radius: 14px; padding: 40px; width: 100%; max-width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { width: 52px; height: 52px; background: var(--accent); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; font-weight: 800; margin-bottom: 10px; }
.login-logo h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.login-logo p  { font-size: .83rem; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .page-wrapper { padding: 20px 16px; }
  .mrow { grid-template-columns: 1fr; }
  .fields-grid { grid-template-columns: 1fr; }
}
