/*
 * UP Khabar Express — Frontend Editorial Portal styles (/portal).
 * Dainik Bhaskar design system: red #D32F2F / dark #111827 / slate #F8FAFC.
 */

.up-portal { padding: 22px 0 46px; min-height: 70vh; }

.up-portal-shell { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Notices & toasts */
.up-notice {
	display: flex;
	align-items: center;
	gap: 8px;
	border-radius: var(--up-radius-sm);
	padding: 12px 16px;
	margin: 0 0 16px;
	font-weight: 700;
	font-size: 14.5px;
	line-height: 1.6;
}

.up-notice--err { background: #FEE2E2; color: #991B1B; border: 1.5px solid #FCA5A5; }
.up-notice--ok { background: var(--up-green-soft); color: var(--up-green); border: 1.5px solid #86EFAC; }
.up-notice--info { background: var(--up-blue-soft); color: var(--up-blue); border: 1.5px solid #93C5FD; }

#up-ke-toast {
	position: fixed;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%) translateY(20px);
	z-index: 999;
	max-width: min(520px, 92vw);
	padding: 13px 20px;
	border-radius: var(--up-radius-sm);
	background: var(--up-dark);
	color: #fff;
	font-weight: 700;
	font-size: 14.5px;
	box-shadow: var(--up-shadow-lg);
	opacity: 0;
	pointer-events: none;
	transition: all .25s ease;
}

#up-ke-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
#up-ke-toast.is-error { background: var(--up-red); }

/* Login card */
.up-login-wrap { display: flex; justify-content: center; padding: 34px 0; }

.up-login-card {
	width: 100%;
	max-width: 420px;
	background: var(--up-white);
	border-radius: var(--up-radius);
	border-top: 6px solid var(--up-red);
	box-shadow: var(--up-shadow-lg);
	padding: 30px 28px;
}

.up-login-brand { text-align: center; margin-bottom: 20px; }
.up-login-brand .up-brand-logo { font-size: 32px; }
.up-login-sub { color: var(--up-muted); font-size: 13.5px; font-weight: 600; margin: 8px 0 0; }

.up-login-note { text-align: center; color: var(--up-muted); font-size: 13.5px; margin: 16px 0 0; }
.up-login-note a { color: var(--up-red); font-weight: 700; }

/* Header */
.up-portal-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--up-white);
	border: 1px solid var(--up-line);
	border-left: 6px solid var(--up-red);
	border-radius: var(--up-radius);
	padding: 16px 20px;
	margin-bottom: 20px;
	box-shadow: var(--up-shadow);
}

.up-portal-head h1 { margin: 0; font-size: clamp(19px, 3vw, 24px); }
.up-portal-head p { margin: 4px 0 0; color: var(--up-muted); font-size: 13.5px; font-weight: 600; }
.up-portal-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Stats strip */
.up-stat-strip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin-bottom: 20px;
}

.up-stat {
	background: var(--up-white);
	border: 1px solid var(--up-line);
	border-radius: var(--up-radius);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	box-shadow: var(--up-shadow);
}

.up-stat-num { font-size: 24px; font-weight: 900; color: var(--up-dark); line-height: 1.2; }
.up-stat-label { font-size: 12.5px; font-weight: 700; color: var(--up-muted); }

.up-stat--wallet { background: var(--up-dark); border-color: var(--up-dark); }
.up-stat--wallet .up-stat-num { color: var(--up-yellow); }
.up-stat--wallet .up-stat-label { color: #D1D5DB; }

/* Panels & grid */
.up-portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; align-items: start; }

.up-panel {
	background: var(--up-white);
	border: 1px solid var(--up-line);
	border-radius: var(--up-radius);
	padding: 18px;
	box-shadow: var(--up-shadow);
}

.up-panel-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 17px;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--up-yellow);
}

.up-count-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	border-radius: 999px;
	background: var(--up-red);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	padding: 0 8px;
}

/* Forms */
.up-form { display: flex; flex-direction: column; gap: 12px; }

.up-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.up-field { display: flex; flex-direction: column; gap: 5px; }

.up-field > span { font-size: 13px; font-weight: 800; color: var(--up-dark-2); }

.up-field input, .up-field select, .up-field textarea,
.up-filters select, #up-ke-reject-reason {
	border: 2px solid var(--up-line);
	border-radius: var(--up-radius-sm);
	padding: 10px 12px;
	background: var(--up-slate);
	font-size: 15px;
	width: 100%;
	transition: border-color .15s ease;
}

.up-field input:focus, .up-field select:focus, .up-field textarea:focus, #up-ke-reject-reason:focus {
	border-color: var(--up-red);
	outline: none;
	background: #fff;
}

.up-field input[readonly], .up-field input[disabled] { background: #EAEFF5; color: var(--up-muted); }

.up-field textarea, #up-ke-reject-reason { resize: vertical; line-height: 1.7; }

.up-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.up-check input { width: 18px; height: 18px; accent-color: var(--up-red); }

.up-btn--block { width: 100%; }
.up-btn--lg { min-height: 48px; font-size: 16px; }
.up-btn--sm { min-height: 36px; padding: 4px 12px; font-size: 13px; border-radius: 6px; }
.up-btn--danger { background: #B91C1C; }
.up-btn--danger:hover { background: #991B1B; }
.up-btn--ok { background: var(--up-green); }
.up-btn--ok:hover { background: #166534; }

.up-hint { color: var(--up-muted); font-size: 13px; margin: 0; line-height: 1.6; }

/* Filters */
.up-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.up-filters select { width: auto; min-width: 150px; flex: 1; }

/* Tables */
.up-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.up-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }

.up-table th {
	text-align: left;
	background: var(--up-slate);
	border-bottom: 2px solid var(--up-line);
	padding: 10px 12px;
	font-size: 12.5px;
	font-weight: 800;
	color: var(--up-muted);
	white-space: nowrap;
}

.up-table td { padding: 10px 12px; border-bottom: 1px solid var(--up-line); vertical-align: middle; }
.up-table tr:hover td { background: #FDF6F6; }

.up-table small { display: block; color: var(--up-muted); font-size: 12px; font-weight: 600; }
.up-muted-sm { color: var(--up-muted); }
.up-empty-cell { color: var(--up-muted); font-weight: 600; padding: 18px 12px !important; text-align: center; }

.up-audit-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 220px; }

/* Review desk cards */
.up-desk-list { display: flex; flex-direction: column; gap: 12px; }

.up-desk-card {
	display: flex;
	gap: 12px;
	border: 1px solid var(--up-line);
	border-radius: var(--up-radius-sm);
	padding: 12px;
	transition: border-color .15s ease;
}

.up-desk-card:hover { border-color: #FCA5A5; }

.up-desk-thumb { flex: 0 0 96px; }
.up-desk-thumb img { border-radius: 6px; width: 96px; height: 72px; object-fit: cover; }
.up-desk-thumb-empty {
	width: 96px; height: 72px;
	border-radius: 6px;
	background: var(--up-slate);
	border: 1px dashed var(--up-line);
	display: flex; align-items: center; justify-content: center;
	font-size: 24px;
}

.up-desk-info { flex: 1; min-width: 0; }

.up-desk-title { margin: 0 0 4px; font-size: 15.5px; line-height: 1.45; }
.up-desk-title a { color: var(--up-dark); }
.up-desk-title a:hover { color: var(--up-red); }

.up-desk-meta { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--up-muted); font-weight: 600; }
.up-desk-geo { color: var(--up-red); font-weight: 800; }
.up-desk-excerpt { margin: 0 0 10px; font-size: 13.5px; color: #4B5563; line-height: 1.65; }

.up-desk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Ledger */
.up-ledger-list { display: flex; flex-direction: column; gap: 12px; max-height: 640px; overflow-y: auto; padding-right: 4px; }

.up-ledger-card { border: 1px solid var(--up-line); border-radius: var(--up-radius-sm); padding: 12px; }

.up-ledger-card.is-rejected { border-color: #FCA5A5; background: #FFF7F7; }

.up-ledger-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.up-ledger-head a { color: var(--up-dark); font-size: 14.5px; line-height: 1.5; }
.up-ledger-head a:hover { color: var(--up-red); }

.up-ledger-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--up-muted); font-weight: 700; }

.up-reject-box { align-items: flex-start; margin: 10px 0 0; }

/* Modal */
.up-modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 18px; }
.up-modal[hidden] { display: none; }

.up-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .62); backdrop-filter: blur(2px); }

.up-modal-card {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: #fff;
	border-top: 6px solid var(--up-red);
	border-radius: var(--up-radius);
	padding: 22px;
	box-shadow: var(--up-shadow-lg);
	animation: upModalIn .2s ease;
}

@keyframes upModalIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.up-modal-card h3 { margin: 0 0 8px; font-size: 18px; }

.up-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* Responsive */
@media (max-width: 640px) {
	.up-form-row { grid-template-columns: 1fr; }
	.up-desk-card { flex-direction: column; }
	.up-desk-thumb { flex-basis: auto; }
	.up-desk-thumb img, .up-desk-thumb-empty { width: 100%; height: 140px; }
	.up-audit-actions { min-width: 0; }
	.up-portal-head { flex-direction: column; align-items: flex-start; }
}

/* Wide management panels */
.up-panel--wide { width: 100%; margin-top: 20px; }

/* Ledger / management cell details */
.up-reject-sm {
  display: block;
  color: var(--up-red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  margin-top: 4px;
}
.up-paid-sm { display: block; color: var(--up-green); font-size: 12px; font-weight: 800; }
.up-views-cell { font-weight: 800; color: var(--up-dark); }
.up-nowrap { white-space: nowrap; }
.up-table tr.is-rejected td { background: #FFF7F7; }
.up-tehsil-hint { display: block; color: var(--up-muted); font-size: 12px; font-weight: 600; line-height: 1.55; margin-top: 6px; }

/* Edit modal */
.up-modal-card--edit { max-width: 640px; }
.up-modal-card--edit .up-form { margin-top: 10px; }

/* ==========================================================================
   v1.2 — Applications (पत्रकार आवेदन) review cards
   ========================================================================== */
.up-app-list { display: flex; flex-direction: column; gap: 14px; }

.up-app-card {
        border: 1px solid var(--up-line);
        border-radius: var(--up-radius-sm);
        padding: 14px;
        background: #fff;
        transition: border-color .15s ease;
}

.up-app-card:hover { border-color: #FCA5A5; }

.up-app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.up-app-id-block { display: flex; gap: 10px; align-items: center; min-width: 0; }

.up-avatar--sm { width: 48px; height: 48px; flex: 0 0 48px; border-width: 2px; }
.up-avatar--letter {
        background: var(--up-red);
        color: #fff;
        font-size: 20px;
        font-weight: 900;
        border-color: var(--up-red);
}

.up-app-name { margin: 0; font-size: 15.5px; line-height: 1.4; }

.up-app-details {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 6px 16px;
        margin: 12px 0 0;
        padding: 10px 12px;
        background: var(--up-slate);
        border-radius: var(--up-radius-sm);
}
.up-app-details div { display: flex; flex-direction: column; }
.up-app-details dt { font-size: 11.5px; font-weight: 800; color: var(--up-muted); }
.up-app-details dd { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--up-dark); word-break: break-all; }

.up-app-docs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.up-doc-chip {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border: 1.5px solid var(--up-blue);
        color: var(--up-blue);
        background: var(--up-blue-soft);
        border-radius: 999px;
        padding: 4px 12px;
        font-size: 12.5px;
        font-weight: 800;
}
.up-doc-chip:hover { background: #fff; }

.up-app-created { margin: 10px 0 0; color: var(--up-green); font-weight: 800; font-size: 13.5px; }

.up-app-pay {
        margin-top: 12px;
        border: 1.5px dashed #F59E0B;
        background: #FFFBEB;
        border-radius: var(--up-radius-sm);
        padding: 10px 12px;
}
.up-app-pay-label { display: block; font-size: 12.5px; font-weight: 800; color: #92400E; margin-bottom: 8px; }
.up-app-pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.up-app-pay-grid input {
        border: 2px solid #FDE68A;
        border-radius: 6px;
        padding: 8px 10px;
        font-size: 13.5px;
        background: #fff;
        width: 100%;
}
.up-app-pay-grid input:focus { border-color: var(--up-red); outline: none; }

.up-app-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ==========================================================================
   v1.2 — Advertisement rows (portal tables)
   ========================================================================== */
.up-ad-cell { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.up-ad-thumb { flex: 0 0 56px; }
.up-ad-thumb img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; border: 1px solid var(--up-line); }
.up-ad-thumb--pdf {
        width: 56px; height: 42px;
        display: flex; align-items: center; justify-content: center;
        background: var(--up-slate);
        border: 1px dashed var(--up-line);
        border-radius: 5px;
        font-size: 18px;
}
