/* ==========================================================================
   Syner Academy - tutorial provider management system
   Self-hosted stylesheet (no external CDN required)
   ========================================================================== */

:root {
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-light: #dbeafe;
  --accent: #f59e0b;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }

/* ---------- layout ---------- */
.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }
.row.center { align-items: center; }
.grid { display: grid; gap: 1.25rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.spacer { flex: 1; }

/* ---------- header / nav ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.nav a { padding: .45rem .7rem; border-radius: 6px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--brand-light); color: var(--brand-dark); }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .6rem; cursor: pointer; }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .4rem; display: none; z-index: 60;
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: block; width: 100%; text-align: left; padding: .5rem .6rem;
  border-radius: 6px; color: var(--ink); background: none; border: 0;
  font: inherit; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg); text-decoration: none; }
.dropdown-header { padding: .5rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; font-size: .85rem; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head {
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.card-body { padding: 1.25rem; }
.card-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--line); background: #fbfdff; }
.course-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.course-card .thumb {
  height: 140px; background: linear-gradient(135deg, var(--brand), #60a5fa);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.4rem; text-align: center; padding: 1rem;
}
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card .body { padding: 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.course-card .foot {
  padding: .85rem 1.1rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
}
.meta { color: var(--muted); font-size: .875rem; display: flex; gap: .85rem; flex-wrap: wrap; }
.title-link { color: var(--ink); font-weight: 600; }
.title-link:hover { color: var(--brand); text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.warning { background: var(--warning); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-pending, .badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #cffafe; color: #0e7490; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-muted { background: #e2e8f0; color: #475569; }
.pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--line); font-size: .8rem; color: var(--muted);
}
.pill.mode-in_person { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.pill.mode-online { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.pill.mode-hybrid { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.pill.mode-self_paced { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.pill.mode-corporate { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8fafc; font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: #fbfdff; }
.table-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ---------- forms ---------- */
.form-row { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=date], input[type=time], input[type=datetime-local],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-light); border-color: var(--brand);
}
textarea { min-height: 90px; resize: vertical; }
.helptext { display: block; color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.errorlist { list-style: none; padding: 0; margin: .35rem 0 0; color: var(--danger); font-size: .85rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.checkbox, .radio { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.checkbox input, .radio input { width: auto; }
.field-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.field-box > legend, .fieldset-title {
  font-weight: 700; padding: 0 .4rem; margin: 0 0 .5rem; color: var(--brand-dark);
}

/* ---------- alerts / messages ---------- */
.messages { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.alert { padding: .75rem 1rem; border-radius: 8px; border-left: 4px solid; background: #fff; box-shadow: var(--shadow); }
.alert.success { border-color: var(--success); background: #f0fdf4; }
.alert.error { border-color: var(--danger); background: #fef2f2; }
.alert.warning { border-color: var(--warning); background: #fffbeb; }
.alert.info { border-color: var(--info); background: #ecfeff; }
.notice { background: var(--brand-light); border-left: 4px solid var(--brand); padding: .75rem 1rem; border-radius: 8px; margin: 1rem 0; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(120deg, var(--brand-dark), var(--brand) 55%, #3b82f6); color: #fff; padding: 3.5rem 0; }
.hero h1 { color: #fff; font-size: 2.4rem; max-width: 22ch; }
.hero p { color: #dbeafe; max-width: 60ch; font-size: 1.05rem; }
.hero .btn.secondary { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn.secondary:hover { background: rgba(255,255,255,.25); }
section { padding: 2.5rem 0; }
.section-head { text-align: center; max-width: 62ch; margin: 0 auto 1.75rem; }
.section-head p { color: var(--muted); }

/* ---------- stats ---------- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; text-align: center; box-shadow: var(--shadow); }
.stat .value { font-size: 1.9rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-top: .25rem; }

/* ---------- progress ---------- */
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.progress.success > span { background: var(--success); }
.progress.warning > span { background: var(--warning); }

/* ---------- backoffice ---------- */
.backoffice { display: grid; grid-template-columns: 235px 1fr; gap: 1.5rem; padding: 1.5rem 0 3rem; }
.side-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; height: fit-content; position: sticky; top: 84px; }
.side-nav h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: .9rem .5rem .35rem; }
.side-nav a { display: block; padding: .45rem .6rem; border-radius: 6px; color: var(--ink); font-size: .92rem; }
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.kpi .value { font-size: 1.7rem; font-weight: 800; color: var(--ink); }
.kpi .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi.accent .value { color: var(--brand); }
.kpi.success .value { color: var(--success); }
.kpi.warning .value { color: var(--warning); }
.kpi.danger .value { color: var(--danger); }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-light);
  color: var(--brand-dark); display: grid; place-items: center; font-weight: 700;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 74px; height: 74px; font-size: 1.4rem; }
.avatar.xl { width: 110px; height: 110px; font-size: 2rem; }
.stars { color: var(--accent); letter-spacing: .05em; }
.stars-empty { color: #cbd5e1; }
.avatar-card { display: flex; gap: .85rem; align-items: center; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { font-size: 2.2rem; display: block; margin-bottom: .5rem; }
.site-footer { background: #0f172a; color: #cbd5e1; padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.site-footer h4 { color: #fff; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; }
.breadcrumb { font-size: .88rem; color: var(--muted); padding: .85rem 0; }
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .9rem; }
.pagination span.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .85rem; color: var(--muted); }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.timeline { border-left: 2px solid var(--line); padding-left: 1rem; display: grid; gap: .75rem; }
.timeline-item { position: relative; padding-bottom: .5rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.42rem; top: .45rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brand); border: 2px solid #fff;
}
.accordion details { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .85rem; margin-bottom: .5rem; background: #fff; }
.accordion summary { cursor: pointer; font-weight: 600; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login-card { width: min(430px, 100%); }
.mode-callout { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.mode-callout .item { border: 1px solid var(--line); border-radius: 8px; padding: .8rem; background: #fff; }
.mode-callout .item .icon { font-size: 1.4rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .backoffice { grid-template-columns: 1fr; }
  .side-nav { position: static; }
}
@media (max-width: 720px) {
  .nav { display: none; width: 100%; }
  .nav.open { display: flex; flex-direction: column; align-items: stretch; padding-bottom: .5rem; }
  .burger { display: inline-block; }
  .site-header .container { flex-wrap: wrap; padding: .5rem 0; }
  .hero h1 { font-size: 1.8rem; }
  h1 { font-size: 1.55rem; }
  .card { padding: 1rem; }
  table { font-size: .85rem; }
}

@media print {
  .site-header, .site-footer, .no-print, .side-nav { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
