/* ==========================================================================
   Pietech admin console — brand: orange #FE6600 · navy #000065 · green #009933
   ========================================================================== */
:root {
    --a-orange: #fe6600;
    --a-navy: #000065;
    --a-night: #03032a;
    --a-green: #009933;
    --a-ink: #0a0a35;
    --a-muted: #686b8f;
    --a-line: #e4e6f0;
    --a-paper: #f5f6fb;
    --a-white: #fff;
    --a-red: #c2371b;
    --a-display: 'Poppins', system-ui, sans-serif;
    --a-sans: 'Inter', system-ui, sans-serif;
    --a-mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 var(--a-sans); color: var(--a-ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.overline { display: inline-block; font: 500 10.5px/1.4 var(--a-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--a-orange); }

/* Shell ------------------------------------------------------------------- */
.admin-body { background: var(--a-paper); }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 250px; display: flex; flex-direction: column; padding: 24px 16px; color: #e8e9f5; background: radial-gradient(circle at 0 100%, rgba(0, 153, 51, .25), transparent 50%), radial-gradient(circle at 100% 0, rgba(254, 102, 0, .2), transparent 45%), var(--a-night); }
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; font: 800 17px/1 var(--a-display); letter-spacing: .01em; }
.admin-brand b { color: var(--a-orange); }
.admin-brand small { display: block; margin-top: 4px; font: 500 9.5px var(--a-mono); letter-spacing: .14em; text-transform: uppercase; color: #39d06a; }
.sidebar-caption { margin: 36px 10px 10px; font: 500 10px var(--a-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 11px; font-weight: 500; color: rgba(255, 255, 255, .72); transition: background .2s, color .2s; }
.admin-nav a > span { width: 18px; text-align: center; font-size: 15px; color: rgba(255, 255, 255, .5); }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.active { background: var(--a-orange); color: #fff; box-shadow: 0 10px 24px -10px rgba(254, 102, 0, .8); }
.admin-nav a.active > span { color: #fff; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.sidebar-bottom > a { display: flex; gap: 10px; padding: 0 12px; font-size: 13px; color: rgba(255, 255, 255, .65); }
.sidebar-bottom > a:hover { color: #fff; }
.admin-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); font-size: 13px; font-weight: 600; }
.admin-user small { display: block; font-weight: 400; font-size: 11px; color: rgba(255, 255, 255, .5); }
.user-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--a-green); font: 700 14px var(--a-display); }
.admin-user form { margin-left: auto; }
.admin-user button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: rgba(255, 255, 255, .6); cursor: pointer; font-size: 16px; }
.admin-user button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.admin-main { margin-left: 250px; min-height: 100vh; }
.admin-topbar { position: sticky; top: 0; z-index: 5; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; background: rgba(245, 246, 251, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--a-line); }
.topbar-context { font: 500 11px var(--a-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--a-muted); }
.topbar-context span { color: var(--a-orange); margin: 0 6px; }
.live-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 153, 51, .1); color: #08752d; font-size: 12px; font-weight: 600; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-green); box-shadow: 0 0 0 3px rgba(0, 153, 51, .2); }
.admin-content { padding: 36px; max-width: 1240px; }
.admin-alert { margin-bottom: 22px; padding: 13px 16px; border-radius: 12px; background: rgba(0, 153, 51, .1); color: #08752d; font-weight: 500; }
.alert-error { background: rgba(194, 55, 27, .1); color: var(--a-red); }

/* Page heading & buttons ---------------------------------------------------- */
.page-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-title-row h1 { margin: 6px 0 4px; font: 700 30px/1.15 var(--a-display); letter-spacing: -.02em; }
.page-title-row p { margin: 0; color: var(--a-muted); }
.admin-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--a-orange); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 10px 24px -12px rgba(254, 102, 0, .9); transition: transform .2s, background .2s; }
.admin-button:hover { background: #ff7414; transform: translateY(-1px); }
.panel-link, .cancel-link { font-weight: 600; color: var(--a-navy); }
.panel-link:hover, .cancel-link:hover { color: var(--a-orange); }

/* Dashboard ------------------------------------------------------------------ */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.metric-grid article { position: relative; overflow: hidden; padding: 22px; border-radius: 18px; background: var(--a-white); border: 1px solid var(--a-line); }
.metric-grid article::after { content: ''; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 18px; transform: rotate(45deg); background: rgba(254, 102, 0, .08); }
.metric-grid article:nth-child(2)::after { background: rgba(0, 153, 51, .1); }
.metric-grid article:nth-child(3)::after { background: rgba(0, 0, 101, .08); }
.metric-grid span { font: 500 10.5px var(--a-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--a-muted); }
.metric-grid strong { display: block; margin: 8px 0 2px; font: 700 34px/1 var(--a-display); }
.metric-grid small { color: var(--a-muted); }
.admin-panel { border-radius: 18px; background: var(--a-white); border: 1px solid var(--a-line); overflow: hidden; margin-bottom: 22px; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--a-line); }
.panel-heading h2 { margin: 4px 0 0; font: 600 18px var(--a-display); }
.lead-row { display: grid; grid-template-columns: 40px 1fr auto 20px; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--a-line); transition: background .2s; }
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { background: var(--a-paper); }
.lead-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--a-navy); color: #fff; font: 700 14px var(--a-display); }
.lead-person strong { display: block; }
.lead-person small, .lead-date { color: var(--a-muted); font-size: 12.5px; }
.row-arrow { color: var(--a-orange); }
.empty-admin { padding: 42px 20px; text-align: center; color: var(--a-muted); }
.empty-admin span { font-size: 24px; color: var(--a-orange); }
.empty-admin strong { display: block; color: var(--a-ink); margin: 6px 0 2px; }
.empty-admin p { margin: 0; }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quick-links a { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 18px; background: var(--a-white); border: 1px solid var(--a-line); transition: border-color .2s, transform .2s, box-shadow .2s; }
.quick-links a:hover { border-color: rgba(254, 102, 0, .4); transform: translateY(-2px); box-shadow: 0 16px 30px -20px rgba(0, 0, 60, .3); }
.quick-links span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 11px; background: rgba(254, 102, 0, .1); color: var(--a-orange); font-size: 17px; }
.quick-links small { color: var(--a-muted); }

/* Tables ---------------------------------------------------------------------- */
.table-head, .table-row { display: grid; grid-template-columns: 2.2fr 1.4fr 1fr .8fr 1fr; align-items: center; gap: 14px; padding: 12px 22px; }
.table-head { background: var(--a-paper); border-bottom: 1px solid var(--a-line); font: 500 10px var(--a-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--a-muted); }
.table-row { border-bottom: 1px solid var(--a-line); }
.table-row:last-of-type { border-bottom: 0; }
.table-row small { display: block; color: var(--a-muted); font-size: 12px; }
.table-project { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table-project img, .table-placeholder { width: 44px; height: 44px; flex: none; border-radius: 11px; object-fit: cover; background: var(--a-paper); }
.table-placeholder { display: grid; place-items: center; background: var(--a-navy); color: #fff; font: 700 15px var(--a-display); }
.table-project strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 600; }
.status-pill.published { background: rgba(0, 153, 51, .12); color: #08752d; }
.status-pill.draft { background: rgba(104, 107, 143, .14); color: var(--a-muted); }
.division-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(254, 102, 0, .12); color: #c24e00; }
.division-pill.construction { background: rgba(0, 153, 51, .12); color: #08752d; }
.table-actions { display: flex; justify-content: flex-end; gap: 12px; }
.table-actions a, .table-actions button { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--a-navy); }
.table-actions button { color: var(--a-red); }
.table-actions a:hover { color: var(--a-orange); }
.lead-table-head, .lead-table-row { grid-template-columns: 1.6fr 2fr .9fr .8fr .8fr; }
.lead-message { margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.section-table-head, .section-table-row { grid-template-columns: 2.4fr 1fr 1fr .6fr .8fr 1fr; }
.key-chip { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--a-paper); font: 500 11.5px var(--a-mono); color: var(--a-navy); }
.pagination-wrap { padding: 16px 22px; }
.pagination-wrap nav { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination-wrap svg { width: 16px; height: 16px; }
.pagination-wrap nav > div:first-child { display: none; }
.pagination-wrap a, .pagination-wrap span[aria-current] span, .pagination-wrap span[aria-disabled] span { display: inline-flex; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; background: var(--a-paper); }
.pagination-wrap span[aria-current] span { background: var(--a-orange); color: #fff; }

.page-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.page-filter a { padding: 7px 14px; border-radius: 999px; background: var(--a-white); border: 1px solid var(--a-line); font-weight: 500; font-size: 13px; }
.page-filter a.active { background: var(--a-navy); border-color: var(--a-navy); color: #fff; }

/* Forms ---------------------------------------------------------------------- */
.admin-form { display: flex; flex-direction: column; gap: 18px; }
.form-section { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 18px; background: var(--a-white); border: 1px solid var(--a-line); }
.admin-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form label, .login-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; }
.admin-form input:not([type="checkbox"]), .admin-form select, .admin-form textarea, .login-form input:not([type="checkbox"]) { width: 100%; padding: 11px 13px; border: 1.5px solid var(--a-line); border-radius: 11px; background: var(--a-paper); font-weight: 400; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus, .login-form input:focus { border-color: var(--a-orange); background: #fff; box-shadow: 0 0 0 4px rgba(254, 102, 0, .12); }
.admin-form textarea { resize: vertical; }
.admin-form label small, .login-form label small { color: var(--a-red); font-weight: 500; }
.field-hint { font-weight: 400; font-size: 12px; color: var(--a-muted); }
.form-options { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-options > label:not(.check-field) { width: 200px; }
.check-field { flex-direction: row !important; align-items: center; gap: 10px !important; cursor: pointer; }
.check-field input, .remember-row input { width: 18px; height: 18px; accent-color: var(--a-orange); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 22px; }
.form-actions .field-hint { margin-right: auto; }
.help-card { padding: 18px 20px; border-radius: 14px; background: rgba(0, 0, 101, .04); border: 1px dashed rgba(0, 0, 101, .2); color: var(--a-muted); font-size: 13px; }
.help-card strong { color: var(--a-ink); }
.help-card code { font: 500 12px var(--a-mono); color: var(--a-navy); background: #fff; padding: 1px 6px; border-radius: 5px; }

/* Login ------------------------------------------------------------------------ */
.login-body { background: var(--a-paper); }
.login-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 40px 56px; color: #fff; background: radial-gradient(circle at 100% 0, rgba(254, 102, 0, .45), transparent 50%), radial-gradient(circle at 0 100%, rgba(0, 153, 51, .4), transparent 50%), var(--a-night); }
.login-art { position: relative; margin-top: auto; }
.login-art h1 { margin: 16px 0 0; font: 700 clamp(38px, 4.4vw, 58px)/1.05 var(--a-display); letter-spacing: -.03em; }
.login-art em { font-style: normal; color: var(--a-orange); }
.login-mark { position: absolute; right: -40px; bottom: 30px; width: 260px; opacity: .9; transform: rotate(12deg); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .4)); }
.login-footnote { display: block; margin-top: 60px; font: 500 10.5px var(--a-mono); letter-spacing: .14em; color: rgba(255, 255, 255, .45); }
.login-form-wrap { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(24px, 6vw, 90px); }
.back-link { position: absolute; top: 34px; font-weight: 600; color: var(--a-muted); }
.back-link:hover { color: var(--a-orange); }
.login-form { width: 100%; max-width: 400px; }
.login-form h2 { margin: 8px 0 4px; font: 700 32px var(--a-display); letter-spacing: -.02em; }
.login-form > p { margin: 0 0 28px; color: var(--a-muted); }
.login-form form { display: flex; flex-direction: column; gap: 16px; }
.remember-row { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 500 !important; }
.login-form .admin-button { height: 50px; margin-top: 6px; }
.login-security { display: block; margin-top: 26px; font: 500 10px var(--a-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--a-muted); }

/* Responsive ------------------------------------------------------------------- */
@media (max-width: 1000px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 210px; }
    .admin-main { margin-left: 210px; }
    .admin-content { padding: 26px 22px; }
    .table-head { display: none; }
    .table-row, .lead-table-row, .section-table-row { grid-template-columns: 1fr 1fr; }
    .table-row .table-project { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .admin-sidebar { position: static; width: auto; padding: 14px 16px; }
    .sidebar-caption, .sidebar-bottom { display: none; }
    .admin-nav { flex-direction: row; overflow-x: auto; margin-top: 12px; }
    .admin-nav a { flex: none; height: 38px; font-size: 13px; }
    .admin-main { margin-left: 0; }
    .admin-topbar { padding: 0 16px; }
    .page-title-row { flex-direction: column; align-items: flex-start; }
    .admin-field-grid, .quick-links { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .back-link { position: static; margin-bottom: 30px; }
}
