@import url('');
:root {
  --navy: #132c43;
  --navy-2: #1c3c56;
  --blue: #25617d;
  --gold: #e3a33e;
  --ink: #1c2b38;
  --muted: #70808e;
  --line: #e2e8ed;
  --surface: #ffffff;
  --bg: #f3f6f8;
  --green: #2d806a;
  --red: #b94b45;
  --shadow: 0 12px 34px rgba(20, 46, 67, .08);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.app-shell { min-height: 100vh; }
.loading-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.loader { width: 24px; height: 24px; border: 3px solid #dce5eb; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px max(24px, calc((100vw - 1440px) / 2)); background: var(--navy); color: #fff; box-shadow: 0 4px 18px rgba(10, 30, 45, .14); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); flex: 0 0 auto; }
.brand-mark svg { width: 28px; height: 28px; }
.brand-title { font-weight: 800; letter-spacing: .07em; font-size: 13px; line-height: 1.2; }
.brand-subtitle { color: #b8c8d4; font-size: 11px; margin-top: 4px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.user-pill { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; border: 1px solid rgba(255,255,255,.19); border-radius: 999px; color: #edf3f7; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); font-weight: 800; background: #f1c16f; }
.user-name { font-size: 12px; font-weight: 650; }
.user-role { display: block; color: #b9c8d3; font-size: 10px; }
.layout { max-width: 1440px; margin: 0 auto; padding: 26px 28px 50px; display: grid; grid-template-columns: 238px minmax(0,1fr); gap: 26px; }
.sidebar { align-self: start; position: sticky; top: 88px; padding: 16px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 4px 18px rgba(18,45,65,.03); }
.side-label { color: #96a2ac; font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: .12em; padding: 7px 11px 10px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 11px; margin: 2px 0; color: #536473; border: 0; background: transparent; border-radius: 10px; text-align: left; font-weight: 650; font-size: 13px; }
.nav-link:hover { background: #f2f6f8; color: var(--navy); }
.nav-link.active { background: #eaf1f5; color: var(--navy); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.side-note { margin: 18px 5px 2px; padding: 13px; border-radius: 12px; background: #f6f8f9; color: #7b8a95; font-size: 11px; }
.main { min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 3px 0 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; color: var(--blue); font-size: 10px; font-weight: 800; }
h1 { color: var(--navy); font-size: clamp(23px, 3vw, 30px); line-height: 1.2; margin: 5px 0 7px; letter-spacing: -.035em; }
.page-desc { margin: 0; color: var(--muted); max-width: 730px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; font-size: 12px; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); background: var(--navy-2); }
.btn.secondary { color: var(--navy); background: #fff; border-color: #d9e2e8; }
.btn.secondary:hover { background: #f5f8fa; }
.btn.gold { background: var(--gold); color: #2d2a20; }
.btn.gold:hover { background: #efb34f; }
.btn.ghost { color: #d8e3ea; background: transparent; border-color: rgba(255,255,255,.18); }
.btn.ghost:hover { background: rgba(255,255,255,.08); }
.btn.danger { background: #fff; color: var(--red); border-color: #efd5d3; }
.btn.small { min-height: 30px; padding: 6px 10px; font-size: 11px; }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.stat-card { padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-number { color: var(--navy); font-size: 25px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin-top: 5px; }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: #eaf2f6; font-size: 18px; }
.stat-card:nth-child(2) .stat-icon { color: #946b24; background: #fbf3e4; }
.stat-card:nth-child(3) .stat-icon { color: #39836f; background: #e9f4f0; }
.stat-card:nth-child(4) .stat-icon { color: #8068a1; background: #f1edf7; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 18px rgba(18,45,65,.025); }
.filter-panel { padding: 14px; margin-bottom: 18px; }
.filter-row { display: grid; grid-template-columns: minmax(220px, 1.8fr) repeat(3, minmax(130px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { color: #506170; font-weight: 700; font-size: 11px; }
.input, .select, .textarea { width: 100%; border: 1px solid #dce4e9; border-radius: 9px; background: #fff; color: var(--ink); padding: 10px 11px; outline: none; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: #78a4b9; box-shadow: 0 0 0 3px rgba(45,111,143,.10); }
.textarea { min-height: 90px; resize: vertical; }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 37px; }
.search-icon { position: absolute; left: 12px; top: 10px; color: #83919c; font-size: 16px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 22px 2px 12px; }
.results-head h2 { margin: 0; font-size: 16px; color: var(--navy); }
.results-count { font-size: 11px; color: var(--muted); }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.resource-card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 15px; display: flex; flex-direction: column; min-height: 218px; transition: .17s ease; }
.resource-card:hover { border-color: #c7d6df; box-shadow: var(--shadow); transform: translateY(-2px); }
.resource-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.file-icon { width: 43px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: #edf3f6; color: #416d83; font-size: 20px; flex: 0 0 auto; }
.file-icon.video { color: #9a6c27; background: #fbf3e5; }
.file-icon.image { color: #43806e; background: #eaf4ef; }
.file-icon.pdf { color: #b6534d; background: #fbefed; }
.level { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #f1f4f6; color: #647582; font-size: 10px; font-weight: 750; white-space: nowrap; }
.resource-title { color: var(--navy); font-size: 14px; font-weight: 800; line-height: 1.35; margin: 13px 0 7px; overflow-wrap: anywhere; }
.resource-desc { color: #74838f; font-size: 11px; line-height: 1.55; margin: 0 0 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.resource-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.meta-chip { max-width: 100%; padding: 4px 7px; border-radius: 6px; background: #f4f7f8; color: #74838d; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid #edf1f3; }
.date-text { color: #9aa5ad; font-size: 10px; }
.card-actions { display: flex; gap: 6px; }
.icon-btn { border: 1px solid #e1e7eb; border-radius: 7px; background: #fff; color: #5c6d79; min-width: 30px; height: 29px; font-size: 13px; }
.icon-btn:hover { background: #f1f5f7; color: var(--navy); }
.icon-btn.del:hover { color: var(--red); background: #fff5f4; }
.empty-state { text-align: center; padding: 55px 20px; border: 1px dashed #ccd7de; background: rgba(255,255,255,.6); border-radius: 15px; grid-column: 1 / -1; }
.empty-icon { font-size: 35px; margin-bottom: 10px; }
.empty-state h3 { color: var(--navy); margin: 0 0 6px; font-size: 16px; }
.empty-state p { color: var(--muted); margin: 0 auto 15px; max-width: 420px; font-size: 12px; }
.footer-note { color: #9aa5ad; text-align: center; font-size: 10px; margin-top: 27px; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 15% 10%, #294a62 0, transparent 34%), linear-gradient(145deg, #10263a, #1c4359); }
.auth-card { width: min(100%, 470px); background: #fff; padding: 33px; border-radius: 20px; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.auth-brand .brand-mark { background: var(--navy); width: 51px; height: 51px; }
.auth-card h1 { font-size: 24px; margin: 0 0 8px; }
.auth-card .lead { color: var(--muted); font-size: 12px; margin: 0 0 22px; }
.auth-form { display: grid; gap: 13px; }
.auth-foot { color: #9ba7b0; font-size: 10px; text-align: center; margin-top: 20px; }
.alert { padding: 10px 12px; border-radius: 9px; background: #fff3ed; color: #a84b36; font-size: 12px; margin-bottom: 12px; }
.dialog { width: min(94vw, 550px); max-height: 90vh; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(9,28,42,.28); overflow: auto; }
.dialog-wide { width: min(94vw, 760px); }
.dialog-detail { width: min(94vw, 850px); }
.dialog::backdrop { background: rgba(11,28,42,.62); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 19px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.dialog-head h2 { margin: 0; color: var(--navy); font-size: 18px; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.close-btn { border: 0; background: #f1f4f6; color: #526473; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; }
.dialog-body { padding: 20px 22px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-help { color: #87949d; font-size: 10px; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; margin-top: 17px; border-top: 1px solid #edf1f3; }
.file-input { padding: 9px; background: #f8fafb; border: 1px dashed #cad6dd; border-radius: 9px; width: 100%; font-size: 11px; }
.preview-frame { width: 100%; height: min(66vh, 650px); border: 1px solid var(--line); border-radius: 10px; background: #f2f5f7; }
.preview-image { max-width: 100%; max-height: 68vh; display: block; margin: 0 auto; object-fit: contain; }
.preview-video { width: 100%; max-height: 68vh; background: #111; border-radius: 10px; }
.detail-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; }
.info-box { padding: 10px 12px; background: #f5f8f9; border-radius: 9px; }
.info-label { color: #84929c; text-transform: uppercase; font-size: 9px; letter-spacing: .08em; font-weight: 800; }
.info-value { margin-top: 3px; color: #344957; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px 9px; text-align: left; border-bottom: 1px solid #edf1f3; vertical-align: middle; }
th { color: #71818d; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.role-tag { display: inline-block; padding: 4px 7px; border-radius: 6px; background: #eef3f6; color: #526c7b; font-size: 10px; font-weight: 750; }
.role-admin { background: #fbf1df; color: #8e6729; }
.category-list { display: grid; gap: 8px; }
.category-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #f7f9fa; border-radius: 9px; }
.category-item span { font-weight: 650; font-size: 12px; }
.toast-area { position: fixed; z-index: 99; right: 18px; top: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { background: #17384d; color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(9,28,42,.22); font-size: 12px; animation: slidein .2s ease; }
.toast.error { background: #a9443f; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav { display: none; }
@media (max-width: 1100px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-row { grid-template-columns: 1.5fr 1fr 1fr; }
  .filter-row .formation-field { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; }
  .brand-mark { width: 37px; height: 37px; }
  .brand-title { font-size: 11px; }
  .brand-subtitle { font-size: 9px; }
  .user-pill { padding: 4px; border: 0; }
  .user-name, .user-role { display: none; }
  .top-actions .btn { min-height: 32px; padding: 7px 9px; font-size: 10px; }
  .layout { display: block; padding: 18px 14px 35px; }
  .sidebar { position: static; display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 7px; margin-bottom: 18px; border-radius: 12px; }
  .side-label, .side-note { display: none; }
  .nav-link { width: auto; flex: 0 0 auto; padding: 8px 10px; font-size: 11px; white-space: nowrap; }
  .nav-icon { width: auto; }
  .page-heading { display: block; }
  .page-heading .actions-row { margin-top: 14px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .stat-card { padding: 12px; }
  .stat-number { font-size: 22px; }
  .stat-icon { width: 34px; height: 34px; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-row .search-field { grid-column: 1 / -1; }
  .filter-row .formation-field { grid-column: 1 / -1; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { min-height: 195px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .dialog-body { padding: 16px; }
  .dialog-head { padding: 16px; }
  .detail-info { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 25px 21px; }
}
@media (max-width: 390px) {
  .brand-subtitle { display: none; }
  .top-actions { gap: 4px; }
  .stats-grid { gap: 7px; }
  .stat-card { gap: 6px; }
  .stat-label { font-size: 10px; }
  .filter-row { grid-template-columns: 1fr; }
  .filter-row .search-field, .filter-row .formation-field { grid-column: auto; }
}
