:root {
  --brand-start: #1b74ac;
  --brand-end: #17918f;
  --brand-dark: #0f2b38;
  --brand-dark-2: #163f4f;
  --bg: #f5f4f0;
  --text: #232220;
  --text-muted: #6b6a66;
  --border: #e4e2db;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}
a { color: inherit; }

.brand-gradient { background: linear-gradient(135deg, var(--brand-start), var(--brand-end)); }
.brand-text {
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.container { max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }
.container-sm { max-width: 420px; margin: 0 auto; padding: 0 20px 60px; }

h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
p.subtitle { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; margin-bottom: 20px; }
.metric { background: #fff; border-radius: 10px; padding: 14px 16px; border: 1px solid var(--border); }
.metric .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.metric .value { font-size: 22px; font-weight: 600; }
.metric .value.danger { color: #a32d2d; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid #eeece6; vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.al_dia { background: #e2f2ee; color: #0f6b56; }
.badge.proximo { background: #faeeda; color: #633806; }
.badge.vencido { background: #fcebeb; color: #791f1f; }
.badge.pendiente { background: #faeeda; color: #633806; }
.badge.confirmado { background: #e2f2ee; color: #0f6b56; }
.badge.rechazado { background: #fcebeb; color: #791f1f; }

label { display: block; font-size: 13px; color: #4a4944; margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid #d6d4cb;
  font-size: 16px; background: #fff;
}
input:focus, select:focus { outline: none; border-color: var(--brand-end); box-shadow: 0 0 0 3px rgba(23,145,143,0.12); }

button, .btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end)); color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: opacity .15s;
}
button:hover, .btn:hover { opacity: .88; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid #d6d4cb; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: #a32d2d; }
.btn-block { width: 100%; text-align: center; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.error { background: #fcebeb; color: #791f1f; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.success { background: #e2f2ee; color: #0f6b56; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-muted); font-size: 13px; }
form.inline { display: inline; }

.pay-option { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.pay-option h3 { margin: 0 0 6px; font-size: 15px; }
.pay-option p { margin: 0 0 10px; font-size: 13px; color: var(--text-muted); }
code.data { background: var(--bg); padding: 3px 7px; border-radius: 4px; font-size: 13px; }

.brand-header {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 28px 0 20px;
}
.brand-header img { width: 40px; height: 40px; border-radius: 10px; }
.brand-header .brand-name { font-size: 17px; font-weight: 700; letter-spacing: .2px; }

.status-hero {
  border-radius: var(--radius); padding: 22px 20px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
}
.status-hero.vencido { background: linear-gradient(135deg, #a32d2d, #6f1d1d); }
.status-hero.proximo { background: linear-gradient(135deg, #b5750e, #7a4d08); }
.status-hero .plan-label { font-size: 12px; opacity: .85; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.status-hero h2 { color: #fff; font-size: 19px; margin-bottom: 6px; }
.status-hero .details { font-size: 13px; opacity: .9; }

.top-nav {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-dark-2));
  color: #fff; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.top-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.top-nav img { width: 28px; height: 28px; border-radius: 7px; }
.top-nav button, .top-nav .btn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }
.top-nav button:hover, .top-nav .btn:hover { background: rgba(255,255,255,.2); opacity: 1; }

.list-cards { display: flex; flex-direction: column; gap: 10px; }
.list-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.list-card .main { font-weight: 500; font-size: 14px; }
.list-card .sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

@media (max-width: 640px) {
  .container { padding: 0 14px 50px; }
  .card { padding: 16px; border-radius: 10px; }
  h1 { font-size: 18px; }

  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr {
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
  }
  table.responsive td {
    border-bottom: none; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
    font-size: 14px;
  }
  table.responsive td::before {
    content: attr(data-label); color: var(--text-muted); font-size: 12px; font-weight: 500;
  }
  table.responsive td:empty { display: none; }

  .metrics { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .metric { padding: 10px; }
  .metric .value { font-size: 17px; }
  .metric .label { font-size: 10.5px; }

  .top-bar { align-items: flex-start; }
}
