/* =========================================================
   MEU DOJO — SISTEMA VISUAL GLOBAL
   Todas as páginas devem reutilizar este padrão.
   ========================================================= */

:root {
    --md-red: #c91f28;
    --md-red-dark: #95171d;
    --md-red-soft: #fbeaec;
    --md-black: #151719;
    --md-sidebar: #171a1d;
    --md-bg: #f4f5f7;
    --md-surface: #ffffff;
    --md-text: #20242a;
    --md-muted: #707781;
    --md-border: #e1e4e8;
    --md-success: #168449;
    --md-warning: #bc7211;
    --md-danger: #c92b34;
    --md-radius: 14px;
    --md-shadow: 0 8px 28px rgba(20, 24, 30, .06);
    --md-sidebar-width: 250px;
    --md-header-height: 72px;
    --md-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--md-font); color: var(--md-text); background: var(--md-bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.auth-page { background: #101214; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 46%) 1fr; }
.auth-brand {
    position: relative; display: flex; align-items: center; justify-content: center; padding: 48px;
    color: white; overflow: hidden;
    background:
        radial-gradient(circle at 20% 10%, rgba(201,31,40,.35), transparent 24%),
        linear-gradient(135deg, #111315 0%, #202429 100%);
}
.auth-brand::after {
    content: "武"; position: absolute; right: -20px; bottom: -80px;
    font-size: 360px; font-weight: 900; color: rgba(255,255,255,.025);
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; }
.brand-mark { color: var(--md-red); font-size: 68px; line-height: 1; font-weight: 800; }
.brand-title { font-size: 44px; font-weight: 900; letter-spacing: -.04em; margin-top: 10px; }
.brand-subtitle { margin-top: 8px; color: #adb4bc; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
.auth-quote { margin-top: 70px; max-width: 360px; font-size: 22px; line-height: 1.45; color: #e7e9eb; }
.auth-panel { display: flex; align-items: center; justify-content: center; background: #f7f7f8; padding: 40px; }
.auth-panel-scroll { align-items: flex-start; overflow-y: auto; }
.auth-card { width: min(430px, 100%); }
.auth-card-wide { width: min(700px, 100%); }
.auth-card h1 { font-size: 36px; margin: 8px 0 10px; letter-spacing: -.035em; }
.eyebrow { color: var(--md-red); font-size: 12px; font-weight: 800; letter-spacing: .13em; margin: 0; }
.muted { color: var(--md-muted); line-height: 1.5; }

.form-stack { display: grid; gap: 16px; margin-top: 28px; }
.form-stack label, .app-form label { display: grid; gap: 7px; }
.form-stack label > span, .app-form label > span { font-size: 13px; font-weight: 700; }
input, select, textarea {
    width: 100%; border: 1px solid var(--md-border); background: white; border-radius: 10px;
    padding: 12px 13px; outline: none; color: var(--md-text); transition: .18s;
}
input:focus, select:focus, textarea:focus { border-color: var(--md-red); box-shadow: 0 0 0 3px rgba(201,31,40,.10); }
textarea { resize: vertical; }
.check-row { grid-template-columns: auto 1fr; align-items: center; }
.check-row input { width: auto; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 800; font-size: 14px; transition: .18s;
}
.btn-primary { background: var(--md-red); color: white; }
.btn-primary:hover { background: var(--md-red-dark); }
.btn-secondary { background: white; border-color: var(--md-border); color: var(--md-text); }
.btn-secondary:hover { border-color: #b7bdc5; }
.btn-ghost { background: transparent; color: var(--md-muted); }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 7px 11px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #a0a6ad; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--md-border); flex: 1; }
.auth-help { text-align: center; color: var(--md-muted); font-size: 12px; margin-top: 18px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: var(--md-sidebar-width); min-width: var(--md-sidebar-width); background: linear-gradient(180deg,#181b1e,#121416);
    color: white; min-height: 100vh; position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
    display: flex; flex-direction: column; box-shadow: 10px 0 30px rgba(0,0,0,.08);
}
.sidebar-brand { height: 82px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-logo { font-size: 34px; color: var(--md-red); font-weight: 900; }
.sidebar-brand strong { display: block; font-size: 21px; letter-spacing: -.02em; }
.sidebar-brand small { display: block; color: #8f969e; font-size: 9px; letter-spacing: .12em; margin-top: 2px; }

.sidebar-nav { padding: 16px 12px; display: grid; gap: 4px; overflow-y: auto; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 9px;
    color: #c8cdd2; font-size: 14px;
}
.sidebar-nav a:hover:not(.disabled) { background: rgba(255,255,255,.06); color: white; }
.sidebar-nav a.active { background: linear-gradient(135deg,var(--md-red),#df2a33); color: white; box-shadow: 0 8px 18px rgba(201,31,40,.22); }
.sidebar-nav a.disabled { opacity: .45; cursor: default; }
.nav-icon { width: 20px; text-align: center; color: #aeb4bb; font-weight: 800; }
.sidebar-nav a.active .nav-icon { color: white; }
.nav-section { margin: 18px 14px 6px; font-size: 10px; color: #737a82; letter-spacing: .12em; }
.sidebar-footer { margin-top: auto; padding: 22px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-school { font-weight: 800; margin-bottom: 8px; }
.sidebar-footer small { color: #858c94; font-style: italic; line-height: 1.5; }

.app-main { margin-left: var(--md-sidebar-width); width: calc(100% - var(--md-sidebar-width)); min-height: 100vh; display: flex; flex-direction: column; }
.navbar {
    height: var(--md-header-height); min-height: var(--md-header-height); display: flex; align-items: center; gap: 16px;
    padding: 0 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--md-border);
    position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
}
.menu-toggle { display: none; border: 0; background: transparent; font-size: 24px; }
.academy-chip { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.academy-avatar, .user-avatar {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto;
    background: var(--md-black); color: white; font-weight: 900;
}
.academy-avatar { background: var(--md-red-soft); color: var(--md-red); }
.academy-chip small, .user-meta small { display: block; font-size: 9px; letter-spacing: .08em; color: var(--md-muted); }
.academy-chip strong, .user-meta strong { display: block; margin-top: 2px; font-size: 13px; }
.navbar-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; }

.content { padding: 26px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-header h1 { margin: 5px 0 4px; font-size: 30px; letter-spacing: -.035em; }
.page-header p:not(.eyebrow) { margin: 0; color: var(--md-muted); }

.hero-card {
    min-height: 190px; border-radius: var(--md-radius); padding: 32px; color: white;
    display: flex; justify-content: space-between; overflow: hidden; position: relative;
    background:
        radial-gradient(circle at 80% 30%, rgba(255,255,255,.09), transparent 26%),
        linear-gradient(105deg,#202326 0%,#34393e 65%,#17191b 100%);
    box-shadow: var(--md-shadow);
}
.hero-card::before { content: ""; position: absolute; left: 0; top: 28px; bottom: 28px; width: 5px; background: var(--md-red); border-radius: 0 5px 5px 0; }
.hero-card h2 { max-width: 690px; font-size: 28px; line-height: 1.15; margin: 8px 0; }
.hero-card p { color: #c5cad0; }
.hero-kicker { color: #ff5961; font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.hero-kanji { font-size: 160px; line-height: 1; opacity: .11; font-weight: 900; align-self: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.metric-card { background: var(--md-surface); border: 1px solid var(--md-border); border-radius: var(--md-radius); padding: 20px; display: flex; gap: 14px; align-items: center; box-shadow: var(--md-shadow); }
.metric-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--md-red-soft); color: var(--md-red); font-weight: 900; font-size: 18px; }
.metric-card span { display: block; font-size: 12px; color: var(--md-muted); }
.metric-card strong { display: block; font-size: 27px; line-height: 1.2; margin-top: 2px; }
.metric-card small { color: var(--md-muted); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
.panel { background: white; border: 1px solid var(--md-border); border-radius: var(--md-radius); box-shadow: var(--md-shadow); padding: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-header h3 { margin: 0 0 4px; font-size: 17px; }
.panel-header p { margin: 0; color: var(--md-muted); font-size: 12px; }
.panel-header a { color: var(--md-red); font-size: 12px; font-weight: 800; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 11px 12px; color: var(--md-muted); font-size: 11px; background: #f7f8f9; border-bottom: 1px solid var(--md-border); }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #eceef1; font-size: 13px; vertical-align: middle; }
.data-table td small { display: block; color: var(--md-muted); margin-top: 3px; }
.data-table tr:last-child td { border-bottom: 0; }
.text-right { text-align: right !important; }

.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.badge-ativo { background: #e8f7ef; color: var(--md-success); }
.badge-inativo { background: #f1f2f4; color: #747b83; }
.badge-trancado { background: #fff2df; color: var(--md-warning); }

.roadmap-list { display: grid; gap: 9px; }
.roadmap-list > div { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; border-bottom: 1px solid #eceef1; padding: 11px 0; }
.roadmap-list span { color: var(--md-red); font-weight: 900; font-size: 11px; }
.roadmap-list strong { font-size: 13px; }
.roadmap-list em { font-style: normal; font-size: 10px; color: var(--md-muted); }

.filter-bar { display: grid; grid-template-columns: minmax(250px, 1fr) 190px auto; gap: 10px; margin-bottom: 16px; }
.section-label { margin: 24px 0 13px; padding-bottom: 8px; border-bottom: 1px solid var(--md-border); font-size: 11px; color: var(--md-red); font-weight: 900; letter-spacing: .1em; }
.section-label:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .col-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--md-border); margin-top: 24px; padding-top: 18px; }
.inline-form { display: inline; }
.link-action, .link-danger { border: 0; background: transparent; padding: 4px; font-size: 12px; font-weight: 800; }
.link-action { color: #4e5965; }
.link-danger { color: var(--md-danger); }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #eaf8f0; color: #13693c; border: 1px solid #ccebd9; }
.alert-danger { background: #fff0f1; color: #8f1d24; border: 1px solid #f4c8cb; }
.alert ul { margin: 8px 0 0 18px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--md-muted); }
.empty-state strong { display: block; color: var(--md-text); margin-bottom: 6px; }
.empty-state .btn { margin-top: 12px; }
.empty-state.compact { padding: 24px; }
.pagination-simple { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--md-border); font-size: 12px; }
.pagination-simple a { color: var(--md-red); font-weight: 800; }
.pagination-simple span { color: #a2a7ad; }

.app-footer { padding: 16px 26px; border-top: 1px solid var(--md-border); color: var(--md-muted); font-size: 11px; background: white; display: flex; gap: 12px; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    :root { --md-sidebar-width: 250px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .app-main { margin-left: 0; width: 100%; }
    .menu-toggle { display: block; }
    .user-meta { display: none; }
    .academy-chip { min-width: 0; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { min-height: 260px; padding: 36px 24px; }
    .brand-title { font-size: 34px; }
    .auth-quote { margin-top: 30px; font-size: 17px; }
    .auth-panel { padding: 28px 18px; }
}

@media (max-width: 620px) {
    .content { padding: 18px 14px; }
    .navbar { padding: 0 14px; }
    .academy-chip small { display: none; }
    .academy-chip strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .metric-grid { grid-template-columns: 1fr; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header .btn { width: 100%; }
    .hero-card { min-height: 170px; padding: 24px; }
    .hero-kanji { display: none; }
    .hero-card h2 { font-size: 23px; }
    .filter-bar { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .col-2 { grid-column: span 1; }
    .panel { padding: 15px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
}
