:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #3b82f6;
  --accent-soft: #dbeafe;
  --success: #166534;
  --success-bg: #dcfce7;
  --error: #991b1b;
  --error-bg: #fee2e2;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code { word-break: break-word; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(180deg, #eff6ff, #f8fafc); }
.login-card { width: min(100%, 430px); background: var(--panel); border-radius: 24px; box-shadow: var(--shadow); padding: 2rem; }
.login-brand { font-size: .85rem; font-weight: 700; letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }

.app-shell { min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-size: 1.25rem; font-weight: 800; }
.subtitle { color: var(--muted); font-size: .92rem; }
.topbar-right { display: flex; gap: .75rem; align-items: center; }
.user-pill, .badge { background: #eef2ff; color: #3730a3; padding: .45rem .75rem; border-radius: 999px; font-size: .85rem; }
.nav-tabs { display: flex; flex-wrap: wrap; gap: .5rem; padding: .8rem 1rem 0; }
.nav-link { padding: .75rem 1rem; border-radius: 999px; color: var(--muted); }
.nav-link.active, .nav-link:hover { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.container { padding: 1rem; max-width: 1350px; margin: 0 auto; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.page-grid { display: grid; grid-template-columns: 1.5fr .95fr; gap: 1rem; }
.hero-grid, .card-grid, .media-grid { display: grid; gap: 1rem; }
.hero-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1rem; }
.hero-card { background: var(--panel); border-radius: 24px; padding: 1.25rem; box-shadow: var(--shadow); transition: transform .15s ease; }
.hero-card:hover, .card-link:hover .info-card { transform: translateY(-2px); }
.hero-icon { font-size: 2rem; }
.hero-stat { margin-top: .75rem; color: var(--muted); font-size: .95rem; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.info-card { background: linear-gradient(180deg, #fff, #fbfdff); border: 1px solid #eef2f7; border-radius: 18px; padding: 1rem; min-height: 160px; transition: transform .15s ease; }
.card-title-row { display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.wrap { flex-wrap: wrap; }
.inline-search, .toolbar-form { display: flex; flex-wrap: wrap; gap: .65rem; }
.detail-grid, .two-col, .grid-2, .grid-3 { display: grid; gap: .9rem; }
.detail-grid, .two-col { grid-template-columns: 1fr 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid textarea { grid-column: span 2; }
.stack-md > * + *, .stack-lg > * + * { margin-top: .9rem; }
.stack-lg > * + * { margin-top: 1rem; }
.nice-list { padding-left: 1.2rem; color: var(--muted); }
.muted { color: var(--muted); }
.note-box, .hint-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.alert { border-radius: 16px; padding: .9rem 1rem; margin-bottom: 1rem; }
.alert-success { color: var(--success); background: var(--success-bg); }
.alert-error { color: var(--error); background: var(--error-bg); }
.btn { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 14px; padding: .82rem 1rem; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-light { background: #eff6ff; color: #1e3a8a; }
input, textarea, select { width: 100%; border: 1px solid #dbe1ea; border-radius: 14px; padding: .85rem .95rem; background: #fff; font: inherit; color: inherit; }
textarea { resize: vertical; }
label span { display: block; font-size: .92rem; margin-bottom: .35rem; color: var(--muted); }
.file-label { display: block; }
.tiny-icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; margin-right: .35rem; object-fit: contain; }
.detail-list { display: grid; gap: .85rem; }
.detail-list div { display: grid; gap: .2rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.detail-list dt { font-size: .88rem; color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; }
.media-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.media-card { border: 1px solid var(--line); border-radius: 16px; padding: .75rem; background: #fff; }
.media-card img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; }
.file-preview { border-radius: 12px; background: #eef2ff; color: #3730a3; display: grid; place-items: center; aspect-ratio: 4/3; font-weight: 800; }

@media (max-width: 900px) {
  .page-grid, .detail-grid, .two-col, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .section-head { align-items: flex-start; flex-direction: column; }
}

	  .stack-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    gap: .4rem;
}

.form-row label {
    font-weight: 600;
    font-size: .95rem;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: .8rem .9rem;
    border: 1px solid #d6dbe3;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    box-sizing: border-box;
}

.media-card-body {
    padding-top: .5rem;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    border-radius: 12px;
    background: #f3f5f8;
    font-weight: 700;
    color: #4a5568;
}
	  
	  .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

.icon-btn:hover {
    transform: translateY(-1px);
}

.upload-box {
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fafafa;
}

.upload-box.is-hidden {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.media-card--file {
    overflow: hidden;
    border: 1px solid #e6eaf0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.media-preview-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.media-preview-image,
.pdf-preview-wrap,
.file-type-tile {
    width: 100%;
    height: 180px;
    display: block;
}

.media-preview-image {
    object-fit: cover;
    background: #f3f4f6;
}

.pdf-preview-wrap {
    position: relative;
    background: #f8fafc;
    overflow: hidden;
}

.pdf-preview {
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
    background: #fff;
}

.pdf-preview-overlay {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.86);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.file-type-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.file-type-icon {
    font-size: 2rem;
    line-height: 1;
}

.file-type-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
    letter-spacing: 0.04em;
}

.media-card-body {
    padding: 0.9rem;
}

.media-title {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.96rem;
}

.media-link {
    display: inline-block;
    font-size: 0.9rem;
    color: #2563eb;
    text-decoration: none;
    word-break: break-word;
}

.media-link:hover {
    text-decoration: underline;
}

.media-notes {
    margin-top: 0.45rem;
    font-size: 0.88rem;
}

@media (max-width: 640px) {
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-preview-image,
    .pdf-preview-wrap,
    .file-type-tile {
        height: 145px;
    }
}