/*
 * tim-media.css — mengikuti design token resmi tema IAI Yapnas Jeneponto
 * (lihat assets/css/main.css tema: warna, radius, shadow, font sama persis).
 */

:root {
	--iaiy-primary: #F97316;
	--iaiy-primary-dark: #C2410C;
	--iaiy-secondary: #1B4332;
	--iaiy-secondary-alt: #2D6A4F;
	--iaiy-text: #1F2937;
	--iaiy-muted: #6B7280;
	--iaiy-bg-soft: #FFF7ED;
	--iaiy-border: #E5E7EB;
	--iaiy-radius: 14px;
	--iaiy-shadow: 0 10px 30px rgba(0, 0, 0, .08);
	--iaiy-font-heading: 'Poppins', sans-serif;
	--iaiy-font-body: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body.tm-body {
	margin: 0;
	font-family: var(--iaiy-font-body);
	color: var(--iaiy-text);
	background: var(--iaiy-bg-soft);
	line-height: 1.6;
	min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--iaiy-font-heading); margin: 0 0 .4em; line-height: 1.3; color: var(--iaiy-secondary); }
p { margin: 0 0 1em; }
a { color: var(--iaiy-primary-dark); }
img { max-width: 100%; display: block; }

/* ---------- layout auth (login / daftar) ---------- */

.tm-auth-wrap {
	min-height: 100vh;
	display: flex;
	align-items: stretch;
}

.tm-auth-side {
	flex: 1 1 38%;
	background: linear-gradient(160deg, var(--iaiy-secondary-alt), var(--iaiy-secondary));
	color: #fff;
	padding: 56px 48px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 18px;
}

.tm-auth-side .tm-badge {
	display: inline-block;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: .06em;
	padding: 6px 14px;
	border-radius: 999px;
	width: fit-content;
}

.tm-auth-side h1 { color: #fff; font-size: 30px; max-width: 380px; }
.tm-auth-side p { color: rgba(255, 255, 255, .82); max-width: 360px; }

.tm-auth-side ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tm-auth-side li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255, 255, 255, .9); font-size: 14.5px; }
.tm-auth-side li svg { flex: none; margin-top: 2px; }

.tm-auth-main {
	flex: 1 1 62%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
	background: #fff;
}

.tm-auth-card {
	width: 100%;
	max-width: 440px;
}

.tm-auth-card.tm-wide { max-width: 720px; }

.tm-auth-card .tm-eyebrow { color: var(--iaiy-primary-dark); font-weight: 700; font-size: 13px; letter-spacing: .04em; margin-bottom: 6px; }
.tm-auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.tm-auth-card .tm-sub { color: var(--iaiy-muted); margin-bottom: 28px; }

/* ---------- form ---------- */

.tm-field { margin-bottom: 18px; }
.tm-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--iaiy-text); }
.tm-field .tm-hint { font-size: 12.5px; color: var(--iaiy-muted); margin-top: 5px; }
.tm-field .tm-error { font-size: 12.5px; color: #DC2626; margin-top: 5px; display: none; }
.tm-field.has-error .tm-error { display: block; }
.tm-field.has-error input, .tm-field.has-error select, .tm-field.has-error textarea { border-color: #DC2626 !important; }

.tm-input, .tm-select, .tm-textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--iaiy-border);
	border-radius: 10px;
	font-size: 14.5px;
	font-family: inherit;
	color: var(--iaiy-text);
	background: #fff;
	transition: .15s;
}

.tm-input:focus, .tm-select:focus, .tm-textarea:focus {
	outline: none;
	border-color: var(--iaiy-primary);
	box-shadow: 0 0 0 3px rgba(249, 115, 22, .14);
}

.tm-input[readonly] { background: var(--iaiy-bg-soft); color: var(--iaiy-secondary); font-weight: 600; }
.tm-textarea { resize: vertical; min-height: 90px; }

.tm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.tm-pw-wrap { position: relative; }
.tm-pw-toggle {
	position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
	background: none; border: 0; color: var(--iaiy-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 6px;
}

.tm-pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tm-pw-rules li { font-size: 12px; color: var(--iaiy-muted); display: flex; align-items: center; gap: 5px; }
.tm-pw-rules li::before { content: '○'; font-size: 10px; color: var(--iaiy-border); }
.tm-pw-rules li.ok { color: #166534; }
.tm-pw-rules li.ok::before { content: '●'; color: #16A34A; }

/* ---------- tombol ---------- */

.tm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 13px 24px; border-radius: 10px; font-weight: 700; font-size: 14.5px;
	border: 0; cursor: pointer; transition: .15s; font-family: inherit; text-decoration: none;
}

.tm-btn-primary { background: var(--iaiy-primary); color: #fff; width: 100%; }
.tm-btn-primary:hover { background: var(--iaiy-primary-dark); }
.tm-btn-primary:disabled { background: #FCD9B8; cursor: not-allowed; }

.tm-btn-secondary { background: var(--iaiy-secondary); color: #fff; }
.tm-btn-secondary:hover { background: var(--iaiy-secondary-alt); }

.tm-btn-ghost { background: transparent; border: 1.5px solid var(--iaiy-border); color: var(--iaiy-text); }
.tm-btn-ghost:hover { border-color: var(--iaiy-primary); color: var(--iaiy-primary-dark); }

.tm-btn-danger { background: #FEE2E2; color: #991B1B; }
.tm-btn-danger:hover { background: #FCA5A5; }

.tm-btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.tm-btn-block { width: 100%; }

.tm-link-row { text-align: center; margin-top: 20px; font-size: 14px; color: var(--iaiy-muted); }

.tm-alert {
	border-radius: 10px; padding: 13px 16px; font-size: 13.5px; margin-bottom: 18px;
	display: flex; gap: 10px; align-items: flex-start;
}
.tm-alert-error { background: #FEE2E2; color: #991B1B; }
.tm-alert-success { background: #DCFCE7; color: #166534; }
.tm-alert-info { background: var(--iaiy-bg-soft); color: var(--iaiy-primary-dark); }

/* ---------- dashboard shell ---------- */

.tm-shell { display: flex; min-height: 100vh; }

.tm-sidebar {
	width: 268px; flex: none; background: var(--iaiy-secondary); color: #fff;
	display: flex; flex-direction: column; padding: 24px 18px;
}

.tm-sidebar .tm-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 18px; }
.tm-sidebar .tm-brand strong { display: block; font-family: var(--iaiy-font-heading); color: #fff; font-size: 14.5px; line-height: 1.3; }
.tm-sidebar .tm-brand span { display: block; font-size: 11.5px; color: rgba(255,255,255,.65); }
.tm-sidebar .tm-brand .tm-logo-mark {
	width: 38px; height: 38px; border-radius: 10px; background: var(--iaiy-primary);
	display: flex; align-items: center; justify-content: center; font-family: var(--iaiy-font-heading);
	font-weight: 800; color: #fff; flex: none;
}

.tm-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tm-nav button {
	display: flex; align-items: center; gap: 11px; text-align: left; background: none; border: 0;
	color: rgba(255,255,255,.78); padding: 11px 12px; border-radius: 10px; font-size: 14px; font-weight: 600;
	cursor: pointer; font-family: inherit; transition: .15s;
}
.tm-nav button .tm-nav-num {
	width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.1); color: #fff;
	display: flex; align-items: center; justify-content: center; font-size: 11.5px; flex: none;
}
.tm-nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.tm-nav button.active { background: var(--iaiy-primary); color: #fff; }
.tm-nav button.active .tm-nav-num { background: rgba(255,255,255,.25); }

.tm-sidebar .tm-user-box {
	border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; margin-top: 12px;
	display: flex; align-items: center; gap: 10px;
}
.tm-sidebar .tm-user-avatar {
	width: 36px; height: 36px; border-radius: 50%; background: var(--iaiy-secondary-alt);
	display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 13px; flex: none;
}
.tm-sidebar .tm-user-meta { flex: 1; min-width: 0; }
.tm-sidebar .tm-user-meta strong { display: block; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-sidebar .tm-user-meta span { font-size: 11.5px; color: rgba(255,255,255,.6); }
.tm-logout-btn { background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 6px; flex: none; }
.tm-logout-btn:hover { color: #fff; }

.tm-main { flex: 1; min-width: 0; padding: 32px 36px 60px; }
.tm-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.tm-topbar h1 { font-size: 22px; margin: 0; }
.tm-topbar p { margin: 4px 0 0; color: var(--iaiy-muted); font-size: 14px; }

.tm-view { display: none; }
.tm-view.active { display: block; }

.tm-card { background: #fff; border: 1px solid var(--iaiy-border); border-radius: var(--iaiy-radius); box-shadow: var(--iaiy-shadow); padding: 26px; margin-bottom: 22px; }
.tm-card h3 { font-size: 16.5px; display: flex; align-items: center; gap: 9px; }
.tm-card h3 .tm-step-dot {
	width: 24px; height: 24px; border-radius: 7px; background: var(--iaiy-bg-soft); color: var(--iaiy-primary-dark);
	font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none;
}
.tm-card .tm-card-desc { color: var(--iaiy-muted); font-size: 13.5px; margin-bottom: 18px; }

/* ---------- upload gambar ---------- */

.tm-upload-box {
	border: 1.5px dashed var(--iaiy-border); border-radius: 12px; padding: 22px; text-align: center;
	background: var(--iaiy-bg-soft); cursor: pointer; transition: .15s;
}
.tm-upload-box:hover { border-color: var(--iaiy-primary); }
.tm-upload-box svg { color: var(--iaiy-primary-dark); margin-bottom: 8px; }
.tm-upload-box .tm-upload-title { font-weight: 700; color: var(--iaiy-secondary); font-size: 14.5px; }
.tm-upload-box .tm-upload-sub { font-size: 12.5px; color: var(--iaiy-muted); margin-top: 3px; }
.tm-upload-preview { margin-top: 16px; border-radius: 12px; overflow: hidden; border: 1px solid var(--iaiy-border); display: none; }
.tm-upload-preview img { width: 100%; max-height: 280px; object-fit: cover; }
.tm-upload-preview .tm-upload-preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #fff; font-size: 12.5px; color: var(--iaiy-muted); }

/* ---------- preview artikel ---------- */

.tm-article-preview {
	border: 1px solid var(--iaiy-border); border-radius: 12px; overflow: hidden;
}
.tm-article-preview .tm-article-cover { width: 100%; height: 260px; object-fit: cover; background: var(--iaiy-bg-soft); }
.tm-article-preview .tm-article-body { padding: 26px 28px; }
.tm-article-preview .tm-article-kicker { color: var(--iaiy-primary-dark); font-weight: 700; font-size: 12.5px; letter-spacing: .04em; margin-bottom: 10px; }
.tm-article-preview h2 { font-size: 24px; margin-bottom: 10px; }
.tm-article-preview .tm-article-meta { color: var(--iaiy-muted); font-size: 13px; margin-bottom: 18px; }
.tm-article-preview .tm-article-content { color: var(--iaiy-text); font-size: 15px; white-space: pre-wrap; }
.tm-article-empty { padding: 40px 20px; text-align: center; color: var(--iaiy-muted); font-size: 14px; }

/* ---------- tabel ---------- */

.tm-table-wrap { overflow-x: auto; border: 1px solid var(--iaiy-border); border-radius: var(--iaiy-radius); }
table.tm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
table.tm-table th {
	background: var(--iaiy-bg-soft); color: var(--iaiy-secondary); text-align: left; font-weight: 700;
	padding: 12px 14px; border-bottom: 1px solid var(--iaiy-border); white-space: nowrap;
}
table.tm-table td { padding: 12px 14px; border-bottom: 1px solid var(--iaiy-border); vertical-align: top; color: var(--iaiy-text); }
table.tm-table tbody tr:last-child td { border-bottom: 0; }
table.tm-table tbody tr:hover { background: #FAFAF9; }
.tm-table-empty { text-align: center; color: var(--iaiy-muted); padding: 34px 14px !important; }

.tm-badge-status {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
	font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tm-badge-status .dot { width: 6px; height: 6px; border-radius: 50%; }

.tm-cancel-reason { font-size: 12px; color: #991B1B; margin-top: 4px; max-width: 220px; }

.tm-actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- modal ---------- */

.tm-modal-overlay {
	position: fixed; inset: 0; background: rgba(17, 24, 39, .55); display: none;
	align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.tm-modal-overlay.active { display: flex; }
.tm-modal {
	background: #fff; border-radius: var(--iaiy-radius); box-shadow: var(--iaiy-shadow); width: 100%; max-width: 440px; padding: 26px;
}
.tm-modal h3 { font-size: 17px; margin-bottom: 6px; }
.tm-modal p.tm-sub { color: var(--iaiy-muted); font-size: 13.5px; margin-bottom: 16px; }
.tm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- toast ---------- */

.tm-toast-stack { position: fixed; top: 20px; right: 20px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; }
.tm-toast {
	background: #1F2937; color: #fff; padding: 13px 18px; border-radius: 10px; font-size: 13.5px;
	box-shadow: var(--iaiy-shadow); max-width: 320px; display: flex; gap: 10px; align-items: flex-start;
	animation: tmToastIn .18s ease-out;
}
.tm-toast.tm-toast-success { background: #14532D; }
.tm-toast.tm-toast-error { background: #7F1D1D; }
@keyframes tmToastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- stat mini ---------- */

.tm-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.tm-stat-card { background: #fff; border: 1px solid var(--iaiy-border); border-radius: var(--iaiy-radius); padding: 18px 20px; }
.tm-stat-card .tm-stat-num { font-family: var(--iaiy-font-heading); font-size: 26px; font-weight: 800; color: var(--iaiy-secondary); }
.tm-stat-card .tm-stat-label { font-size: 12.5px; color: var(--iaiy-muted); margin-top: 2px; }

/* ---------- responsif ---------- */

@media (max-width: 980px) {
	.tm-auth-side { display: none; }
	.tm-grid-2 { grid-template-columns: 1fr; }
	.tm-stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
	.tm-shell { flex-direction: column; }
	.tm-sidebar { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; overflow-x: auto; }
	.tm-sidebar .tm-brand { border: 0; padding: 0; margin: 0 14px 0 0; }
	.tm-nav { flex-direction: row; flex: none; }
	.tm-nav button span.tm-nav-label { white-space: nowrap; }
	.tm-sidebar .tm-user-box { display: none; }
	.tm-main { padding: 22px 16px 50px; }
}

@media (max-width: 560px) {
	.tm-auth-main { padding: 24px 14px; }
	.tm-card { padding: 18px; }
}
