:root {
    --a-navy: #0f1d5c; --a-navy-2: #070f36; --a-green: #e41e26; --a-green-d: #c8161e; --a-blue: #1e3488;
    --a-bg: #f3f6fb; --a-card: #fff; --a-line: #e4e9f2; --a-text: #34445e; --a-muted: #8592a8;
    --a-danger: #d64545; --a-radius: 12px; --a-shadow: 0 4px 18px rgba(16, 44, 100, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; font-size: 14px; color: var(--a-text); background: var(--a-bg); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--a-navy); margin: 0; }
img { max-width: 100%; }

/* Layout */
.a-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.a-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--a-navy), var(--a-navy-2)); color: #c9d6ec; padding: 20px 14px 30px; }
.a-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.a-brand small { display: block; font-weight: 400; font-size: 11px; color: #9fb3d6; }
.a-brand .brand-logo { width: 38px; height: 38px; }
.a-nav-title { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #7f96c0; margin: 18px 12px 6px; }
.a-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; transition: background .2s, color .2s; }
.a-nav a i { font-size: 16px; width: 18px; text-align: center; }
.a-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-nav a.active { background: var(--a-green); color: #fff; box-shadow: 0 6px 16px rgba(228, 30, 38, .3); }
.a-nav .badge { margin-left: auto; }
.a-main { min-width: 0; display: flex; flex-direction: column; }
.a-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--a-line); }
.a-topbar .spacer { flex: 1; }
.a-menu-btn { display: none; border: 0; background: none; font-size: 24px; color: var(--a-navy); cursor: pointer; }
.a-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.a-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--a-navy); color: #fff; font-weight: 600; }
.a-content { padding: 28px; flex: 1; }
.a-page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.a-page-head h1 { font-size: 22px; }
.a-page-head p { margin: 4px 0 0; color: var(--a-muted); font-size: 13px; }
.a-crumbs { font-size: 12px; color: var(--a-muted); margin-bottom: 4px; }
.a-crumbs a:hover { color: var(--a-green-d); }

/* Cards */
.a-card { background: var(--a-card); border-radius: var(--a-radius); box-shadow: var(--a-shadow); border: 1px solid var(--a-line); }
.a-card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--a-line); }
.a-card-head h3 { font-size: 15px; }
.a-card-body { padding: 20px; }
.a-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.a-stat { display: flex; align-items: center; gap: 16px; padding: 20px; transition: transform .2s; }
.a-stat:hover { transform: translateY(-3px); }
.a-stat .ico { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--a-blue), var(--a-navy)); }
.a-stat:nth-child(even) .ico { background: linear-gradient(135deg, #f0434a, var(--a-green-d)); }
.a-stat b { display: block; font-size: 24px; color: var(--a-navy); line-height: 1.1; }
.a-stat span { font-size: 12.5px; color: var(--a-muted); }
.a-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.a-quick { display: grid; gap: 10px; }
.a-quick a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--a-line); border-radius: 10px; font-weight: 500; transition: all .2s; }
.a-quick a:hover { border-color: var(--a-green); color: var(--a-green-d); }
.a-quick i { font-size: 18px; color: var(--a-green-d); }

/* Buttons */
.a-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 8px; border: 1px solid transparent; font: 500 13px 'Poppins', sans-serif; cursor: pointer; transition: all .2s; white-space: nowrap; }
.a-btn-primary { background: var(--a-navy); color: #fff; }
.a-btn-primary:hover { background: var(--a-blue); }
.a-btn-green { background: var(--a-green); color: #fff; }
.a-btn-green:hover { background: var(--a-green-d); }
.a-btn-light { background: #fff; border-color: var(--a-line); color: var(--a-text); }
.a-btn-light:hover { border-color: var(--a-navy); }
.a-btn-danger { background: #fff; color: var(--a-danger); border-color: #f1c9c9; }
.a-btn-danger:hover { background: var(--a-danger); color: #fff; }
.a-btn-sm { padding: 6px 10px; font-size: 12px; }
.a-icon-btn { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* Tables */
.a-toolbar { display: flex; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--a-line); }
.a-search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 360px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 8px; background: #fafbfe; }
.a-search input { flex: 1; border: 0; background: none; outline: 0; padding: 9px 0; font: 13px 'Poppins', sans-serif; }
.a-table-wrap { overflow-x: auto; }
table.a-table { width: 100%; border-collapse: collapse; }
.a-table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--a-muted); padding: 12px 20px; background: #f8faff; border-bottom: 1px solid var(--a-line); }
.a-table td { padding: 12px 20px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tr:hover td { background: #fbfcff; }
.a-table .thumb { width: 52px; height: 42px; border-radius: 8px; object-fit: cover; background: #eef2f9; display: block; }
.a-table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.a-table .unread td { font-weight: 600; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: #e5f6e8; color: #217a30; }
.badge-gray { background: #eef1f6; color: #7a879c; }
.badge-red { background: #fde8e8; color: #c23a3a; }
.a-empty { text-align: center; padding: 50px 20px; color: var(--a-muted); }
.a-empty i { font-size: 38px; display: block; margin-bottom: 10px; color: #c3cde0; }
.a-pagination { padding: 14px 20px; border-top: 1px solid var(--a-line); }
.a-pagination .pagination { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; justify-content: flex-end; }
.a-pagination a, .a-pagination span { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--a-line); font-size: 13px; }
.a-pagination .active span { background: var(--a-navy); color: #fff; border-color: var(--a-navy); }
.a-pagination .disabled span { opacity: .4; }

/* Forms */
.a-form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px 20px; }
.a-field { grid-column: span 12; }
.a-field.col-3 { grid-column: span 3; } .a-field.col-4 { grid-column: span 4; } .a-field.col-6 { grid-column: span 6; } .a-field.col-8 { grid-column: span 8; }
.a-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--a-navy); margin-bottom: 6px; }
.a-input { width: 100%; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 8px; font: 13.5px 'Poppins', sans-serif; color: var(--a-text); background: #fff; outline: 0; transition: border-color .2s, box-shadow .2s; }
.a-input:focus { border-color: var(--a-blue); box-shadow: 0 0 0 3px rgba(52, 69, 180, .12); }
textarea.a-input { min-height: 110px; resize: vertical; }
.a-help { font-size: 11.5px; color: var(--a-muted); margin-top: 5px; }
.a-error { font-size: 12px; color: var(--a-danger); margin-top: 5px; }
.a-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; padding-top: 4px; }
.a-check input { display: none; }
.a-check .switch { position: relative; width: 40px; height: 22px; border-radius: 22px; background: #cfd7e6; transition: background .2s; flex: none; }
.a-check .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.a-check input:checked + .switch { background: var(--a-green); }
.a-check input:checked + .switch::after { transform: translateX(18px); }
.a-icon-input { display: flex; gap: 8px; align-items: center; }
.a-icon-input .preview { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 8px; background: #eef3fb; color: var(--a-navy); font-size: 20px; }
.a-upload { border: 2px dashed var(--a-line); border-radius: 10px; padding: 16px; text-align: center; background: #fafbfe; transition: border-color .2s; }
.a-upload:hover { border-color: var(--a-blue); }
.a-upload input[type=file] { width: 100%; font-size: 12.5px; }
.a-upload .current { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; text-align: left; }
.a-upload .current img { width: 90px; height: 70px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--a-line); }
.a-upload .new-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.a-upload .new-preview img { width: 70px; height: 56px; object-fit: cover; border-radius: 6px; }
.a-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-bottom: 12px; }
.a-gallery label { position: relative; display: block; cursor: pointer; }
.a-gallery img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; transition: all .2s; }
.a-gallery input { position: absolute; top: 6px; right: 6px; accent-color: var(--a-danger); }
.a-gallery input:checked + img { border-color: var(--a-danger); opacity: .4; }
.a-form-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--a-line); background: #fafbfe; border-radius: 0 0 var(--a-radius) var(--a-radius); position: sticky; bottom: 0; }
.a-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.a-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; background: #fff; border: 1px solid var(--a-line); font-weight: 500; font-size: 13px; }
.a-tabs a.active { background: var(--a-navy); color: #fff; border-color: var(--a-navy); }
.ql-toolbar.ql-snow { border-color: var(--a-line) !important; border-radius: 8px 8px 0 0; background: #fafbfe; }
.ql-container.ql-snow { border-color: var(--a-line) !important; border-radius: 0 0 8px 8px; font: 14px 'Poppins', sans-serif !important; }
.ql-editor { min-height: 180px; }
.a-color { display: flex; gap: 10px; align-items: center; }
.a-color input[type=color] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--a-line); border-radius: 8px; background: #fff; }

/* Alerts */
.a-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px; }
.a-alert-success { background: #e7f7ea; color: #1f7a30; border: 1px solid #c4e9cb; }
.a-alert-error { background: #fdecec; color: #b03030; border: 1px solid #f4cccc; }

/* Detail view */
.a-detail dt { font-size: 12px; font-weight: 600; color: var(--a-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 16px; }
.a-detail dt:first-child { margin-top: 0; }
.a-detail dd { margin: 4px 0 0; white-space: pre-line; }

/* Login */
.a-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.a-login-art { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 60px; color: #fff; background: linear-gradient(140deg, rgba(21, 30, 94, .92), rgba(52, 69, 180, .75)), url('https://images.unsplash.com/photo-1581093588401-fbb62a02f120?auto=format&fit=crop&w=1400&q=80') center / cover; }
.a-login-art h2 { color: #fff; font-size: 34px; line-height: 1.2; margin-bottom: 12px; }
.a-login-art p { color: #cfdcf2; max-width: 420px; margin: 0; }
.a-login-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.a-login-form form { width: 100%; max-width: 380px; }
.a-login-form h1 { font-size: 26px; margin: 22px 0 6px; }
.a-login-form .sub { color: var(--a-muted); margin: 0 0 28px; }
.a-login-form .a-input { padding: 12px 14px; }
.a-login-form .a-btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.a-login-logo { max-height: 56px; }

@media (max-width: 1100px) {
    .a-stats { grid-template-columns: repeat(2, 1fr); }
    .a-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .a-shell { grid-template-columns: 1fr; }
    .a-sidebar { position: fixed; z-index: 50; width: 260px; left: 0; transform: translateX(-100%); transition: transform .3s; }
    .a-sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .a-menu-btn { display: block; }
    .a-content { padding: 18px 16px; }
    .a-topbar { padding: 0 16px; }
    .a-field.col-3, .a-field.col-4, .a-field.col-6, .a-field.col-8 { grid-column: span 12; }
    .a-login { grid-template-columns: 1fr; }
    .a-login-art { display: none; }
}
@media (max-width: 520px) {
    .a-stats { grid-template-columns: 1fr; }
    .a-user span { display: none; }
}
.a-brand-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #fff; padding: 4px; }
.a-brand-icon img { width: 100%; height: 100%; object-fit: contain; }
