:root {
    --admin-navy: #071f3d;
    --admin-blue: #1875df;
    --admin-blue-dark: #105eb8;
    --admin-gold: #ffb21c;
    --admin-page: #f4f7fb;
    --admin-surface: #ffffff;
    --admin-text: #172234;
    --admin-muted: #64748b;
    --admin-line: #dfe6ef;
    --admin-soft: #eef4fb;
    --admin-green: #168449;
    --admin-red: #c83d4d;
    --admin-shadow: 0 14px 40px rgba(7,31,61,.08);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--admin-text); background: var(--admin-page); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; line-height: 1.55; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.admin-shell { width: min(calc(100% - 40px), 1180px); margin-inline: auto; }
.admin-topbar { position: sticky; top: 0; z-index: 100; color: #fff; background: var(--admin-navy); box-shadow: 0 8px 25px rgba(7,31,61,.14); }
.admin-nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.admin-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.admin-brand img { width: 142px; height: 50px; padding: 5px; object-fit: contain; border-radius: 9px; background: #fff; }
.admin-brand span { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.2); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-links { display: flex; align-items: center; gap: 8px; }
.admin-links a, .logout-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 13px; border: 0; border-radius: 9px; color: #dbe8f5; background: transparent; text-decoration: none; font-size: 12px; font-weight: 700; }
.admin-links a:hover, .logout-button:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-main { padding: 38px 0 70px; }
.admin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.admin-page-head h1 { margin: 0; color: var(--admin-navy); font-size: clamp(26px, 4vw, 37px); letter-spacing: -.035em; }
.admin-page-head p { margin: 7px 0 0; color: var(--admin-muted); }
.admin-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 17px; border: 0; border-radius: 11px; font-weight: 800; text-decoration: none; transition: .2s ease; }
.admin-button-primary { color: #fff; background: var(--admin-blue); box-shadow: 0 10px 22px rgba(24,117,223,.22); }
.admin-button-primary:hover { background: var(--admin-blue-dark); transform: translateY(-1px); }
.admin-button-secondary { color: var(--admin-navy); background: var(--admin-soft); }
.admin-button-danger { color: #fff; background: var(--admin-red); }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 22px; border: 1px solid var(--admin-line); border-radius: 17px; background: var(--admin-surface); box-shadow: 0 8px 24px rgba(7,31,61,.04); }
.stat-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--admin-blue); background: #eaf3ff; font-size: 20px; }
.stat-card strong { display: block; color: var(--admin-navy); font-size: 27px; line-height: 1; }
.stat-card span { display: block; margin-top: 6px; color: var(--admin-muted); font-size: 12px; font-weight: 700; }
.admin-panel { overflow: hidden; border: 1px solid var(--admin-line); border-radius: 18px; background: var(--admin-surface); box-shadow: var(--admin-shadow); }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--admin-line); }
.panel-toolbar h2 { margin: 0; color: var(--admin-navy); font-size: 18px; }
.admin-search { position: relative; width: min(100%, 360px); }
.admin-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8a98aa; }
.admin-search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border: 1px solid var(--admin-line); border-radius: 10px; outline: none; background: #fbfcfe; }
.admin-search input:focus { border-color: var(--admin-blue); box-shadow: 0 0 0 3px rgba(24,117,223,.12); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 13px 18px; text-align: left; color: #7b8798; background: #f8fafc; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.admin-table td { padding: 17px 18px; border-top: 1px solid #eef2f6; vertical-align: middle; font-size: 13px; }
.admin-table tr:hover td { background: #fbfdff; }
.table-title { max-width: 440px; }
.table-title strong { display: block; color: var(--admin-navy); font-size: 13px; }
.table-title span { display: block; margin-top: 4px; color: var(--admin-muted); font-size: 11px; }
.table-actions { display: flex; justify-content: flex-end; gap: 7px; }
.icon-action { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--admin-line); border-radius: 10px; color: var(--admin-muted); background: #fff; text-decoration: none; }
.icon-action:hover { color: var(--admin-blue); border-color: #bcd6f5; background: #f4f8fd; }
.icon-action.danger:hover { color: var(--admin-red); border-color: #f0bec4; background: #fff5f6; }
.inline-form { display: inline; margin: 0; }
.empty-admin { padding: 60px 20px; text-align: center; }
.empty-admin i { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; color: var(--admin-blue); background: #eaf3ff; font-size: 24px; }
.empty-admin h3 { margin: 0 0 7px; color: var(--admin-navy); }
.empty-admin p { margin: 0; color: var(--admin-muted); }
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 13px 15px; border-radius: 11px; font-size: 13px; font-weight: 650; }
.alert-success { color: #116638; border: 1px solid #bee7cc; background: #edf9f1; }
.alert-error { color: #9f2634; border: 1px solid #f0c3c8; background: #fff2f3; }

.form-card { padding: 30px; border: 1px solid var(--admin-line); border-radius: 19px; background: var(--admin-surface); box-shadow: var(--admin-shadow); }
.form-section { padding: 0 0 27px; margin-bottom: 27px; border-bottom: 1px solid var(--admin-line); }
.form-section:last-of-type { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.form-section-head { margin-bottom: 18px; }
.form-section-head h2 { margin: 0; color: var(--admin-navy); font-size: 18px; }
.form-section-head p { margin: 5px 0 0; color: var(--admin-muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 7px; color: #40516a; font-size: 12px; font-weight: 800; }
.form-group input, .form-group select, .form-group textarea { width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid #ccd6e2; border-radius: 10px; color: var(--admin-text); background: #fff; outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--admin-blue); box-shadow: 0 0 0 3px rgba(24,117,223,.12); }
.help-text { display: block; margin-top: 7px; color: #7c899b; font-size: 10px; }
.upload-box { position: relative; display: grid; place-items: center; min-height: 138px; padding: 20px; text-align: center; border: 1.5px dashed #b8c6d8; border-radius: 13px; background: #f8fafc; }
.upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-box i { color: var(--admin-blue); font-size: 26px; }
.upload-box strong { display: block; margin-top: 8px; color: var(--admin-navy); font-size: 12px; }
.upload-box span { display: block; margin-top: 4px; color: var(--admin-muted); font-size: 10px; }
.current-image { display: flex; align-items: center; gap: 13px; margin-top: 12px; padding: 11px; border: 1px solid var(--admin-line); border-radius: 12px; background: #f9fbfd; }
.current-image img { width: 60px; height: 60px; object-fit: contain; border-radius: 9px; background: #fff; }
.current-image strong { display: block; color: var(--admin-navy); font-size: 11px; }
.current-image span { color: var(--admin-muted); font-size: 10px; word-break: break-all; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.note-editor.note-frame { border-color: #ccd6e2 !important; border-radius: 10px !important; overflow: hidden; }
.note-toolbar { background: #f7f9fc !important; border-color: var(--admin-line) !important; }
.note-editable { min-height: 380px; font-family: 'Plus Jakarta Sans', sans-serif; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .9fr) minmax(480px, 1.1fr); background: #fff; }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff; background: radial-gradient(circle at 75% 20%, rgba(255,178,28,.28), transparent 25%), linear-gradient(145deg, #06182e, #0b3d74); }
.login-visual::after { content: ''; position: absolute; width: 500px; height: 500px; right: -180px; bottom: -220px; border: 80px solid rgba(255,255,255,.06); border-radius: 50%; }
.login-logo { position: relative; z-index: 1; width: 220px; padding: 8px; border-radius: 13px; background: #fff; }
.login-message { position: relative; z-index: 1; max-width: 520px; }
.login-message span { color: var(--admin-gold); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-message h1 { margin: 13px 0; font-size: clamp(36px, 5vw, 58px); line-height: 1.08; letter-spacing: -.045em; }
.login-message p { color: #c7d8e9; font-size: 15px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #f7f9fc; }
.login-card { width: min(100%, 440px); padding: 36px; border: 1px solid var(--admin-line); border-radius: 20px; background: #fff; box-shadow: var(--admin-shadow); }
.login-card h2 { margin: 0; color: var(--admin-navy); font-size: 27px; }
.login-card > p { margin: 7px 0 25px; color: var(--admin-muted); font-size: 13px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--admin-muted); background: transparent; }
.login-card .admin-button { width: 100%; margin-top: 8px; }
.login-back { display: block; margin-top: 18px; text-align: center; color: var(--admin-muted); text-decoration: none; font-size: 11px; font-weight: 700; }

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

@media (max-width: 800px) {
    .admin-shell { width: min(calc(100% - 26px), 1180px); }
    .admin-brand span { display: none; }
    .admin-links .link-label { display: none; }
    .admin-page-head { align-items: flex-start; flex-direction: column; }
    .admin-stats { grid-template-columns: 1fr; }
    .panel-toolbar { align-items: stretch; flex-direction: column; }
    .admin-search { width: 100%; }
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table tr { position: relative; padding: 17px; border-top: 1px solid var(--admin-line); }
    .admin-table tr:first-child { border-top: 0; }
    .admin-table td { padding: 4px 0; border: 0; }
    .admin-table td[data-label]::before { content: attr(data-label) ': '; color: #7b8798; font-size: 10px; font-weight: 800; text-transform: uppercase; }
    .admin-table .actions-cell { padding-top: 12px; }
    .table-actions { justify-content: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full { grid-column: auto; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { min-height: 300px; padding: 32px 24px; }
    .login-logo { width: 170px; }
    .login-message h1 { font-size: 38px; }
    .login-panel { padding: 28px 16px; }
}

@media (max-width: 500px) {
    .admin-nav { min-height: 64px; }
    .admin-brand img { width: 118px; height: 42px; }
    .admin-main { padding-top: 25px; }
    .admin-page-head .admin-button { width: 100%; }
    .form-card { padding: 20px 15px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .admin-button { width: 100%; }
    .login-card { padding: 28px 20px; }
}
