/* Admin panel — QEC AUST */

:root {
    --a-primary: #3d315b;
    --a-primary-dark: #2a2240;
    --a-accent: #c06c84;
    --a-gold: #d4af37;
    --a-bg: #f4f3f7;
    --a-surface: #ffffff;
    --a-border: #e2e0ea;
    --a-text: #33303d;
    --a-muted: #6b7280;
    --a-radius: 9px;
    --a-sidebar: 262px;
    --a-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

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

body {
    margin: 0; font-family: var(--a-font); font-size: 15px; line-height: 1.6;
    background: var(--a-bg); color: var(--a-text); -webkit-font-smoothing: antialiased;
}
a { color: var(--a-primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; color: var(--a-primary-dark); line-height: 1.3; }
h1 { font-size: 1.42rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

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

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

.sidebar {
    width: var(--a-sidebar); flex: none; background: var(--a-primary-dark);
    color: rgba(255, 255, 255, .75); display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 40;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 11px; padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-brand img { height: 40px; width: auto; background: #fff; border-radius: 7px; padding: 3px; }
.sidebar-brand .t { color: #fff; font-weight: 700; font-size: .92rem; line-height: 1.25; }
.sidebar-brand .s { font-size: .72rem; color: rgba(255, 255, 255, .55); }

.sidebar-group {
    font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
    color: rgba(255, 255, 255, .38); padding: 18px 20px 7px;
}
.sidebar-nav { list-style: none; margin: 0; padding: 0 0 20px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 11px; padding: 9px 20px;
    color: rgba(255, 255, 255, .76); font-size: .875rem;
    border-left: 3px solid transparent; transition: all .14s;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, .1); color: #fff; border-left-color: var(--a-gold); font-weight: 600; }
.sidebar-nav .icon { width: 16px; height: 16px; opacity: .85; }
.sidebar-nav .pill {
    margin-left: auto; background: var(--a-accent); color: #fff;
    font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}

.main { flex: 1; margin-left: var(--a-sidebar); min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--a-surface); border-bottom: 1px solid var(--a-border);
    padding: 0 26px; height: 62px; display: flex; align-items: center;
    justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 30;
}
.topbar h1 { margin: 0; font-size: 1.08rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle { display: none; background: var(--a-primary); color: #fff; border: 0; width: 38px; height: 34px; border-radius: 6px; cursor: pointer; }

.content { padding: 26px; flex: 1; }

/* ----------------------------------------------------------------- cards */

.panel { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius); margin-bottom: 22px; }
.panel-head {
    padding: 15px 20px; border-bottom: 1px solid var(--a-border);
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-body { padding: 20px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tile {
    background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius);
    padding: 18px 20px; display: flex; align-items: center; gap: 15px;
}
.tile-icon {
    width: 44px; height: 44px; border-radius: 11px; flex: none;
    background: linear-gradient(135deg, var(--a-primary), var(--a-accent)); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.tile-icon .icon { width: 21px; height: 21px; }
.tile-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--a-primary-dark); }
.tile-label { font-size: .8rem; color: var(--a-muted); margin-top: 4px; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.grid th {
    text-align: left; padding: 11px 16px; background: #faf9fc; color: var(--a-muted);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .7px; font-weight: 700;
    border-bottom: 1px solid var(--a-border); white-space: nowrap;
}
table.grid td { padding: 11px 16px; border-bottom: 1px solid var(--a-border); vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #faf9fc; }
table.grid .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* --------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 7px; border: 1px solid transparent;
    font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--a-primary); color: #fff; }
.btn-primary:hover { background: var(--a-primary-dark); color: #fff; }
.btn-accent { background: var(--a-accent); color: #fff; }
.btn-accent:hover { background: #a85870; }
.btn-outline { background: #fff; border-color: var(--a-border); color: #4b4658; }
.btn-outline:hover { border-color: var(--a-primary); color: var(--a-primary); }
.btn-danger { background: #fff; border-color: #f0c4cd; color: #b3243b; }
.btn-danger:hover { background: #fdecef; }
.btn-sm { padding: 6px 11px; font-size: .78rem; }
.btn-icon { padding: 6px; width: 31px; height: 31px; }
.btn-icon .icon { width: 15px; height: 15px; }

/* ----------------------------------------------------------------- forms */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 22px; }
.field { margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: #45405a; margin-bottom: 6px; }
.field .req { color: var(--a-accent); }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=number],
.field input[type=date], .field input[type=password], .field textarea, .field select, .field input[type=file] {
    width: 100%; padding: 9px 12px; font-family: inherit; font-size: .9rem;
    border: 1px solid var(--a-border); border-radius: 7px; background: #fff; color: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field textarea.html { min-height: 300px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84rem; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 0; border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(61, 49, 91, .12);
}
.field .help { font-size: .77rem; color: var(--a-muted); margin-top: 5px; }
.field .error { color: #b3243b; font-size: .78rem; margin-top: 5px; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #e6889b; }
.switch { display: flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 600; color: #45405a; }
.switch input { width: 18px; height: 18px; accent-color: var(--a-primary); }

.filebox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filebox .preview {
    width: 74px; height: 74px; border-radius: 8px; border: 1px solid var(--a-border);
    overflow: hidden; background: #faf9fc; display: flex; align-items: center; justify-content: center; flex: none;
}
.filebox .preview img { width: 100%; height: 100%; object-fit: cover; }
.filebox .preview .icon { width: 26px; height: 26px; color: #c3bed2; }
.filebox .meta { flex: 1; min-width: 200px; }

.form-actions {
    display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--a-border);
    background: #faf9fc; border-radius: 0 0 var(--a-radius) var(--a-radius); flex-wrap: wrap;
}

/* ---------------------------------------------------------------- alerts */

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; }
.alert .icon { width: 17px; height: 17px; margin-top: 2px; }
.alert-success { background: #e6f4ec; color: #14653a; border: 1px solid #bfe3ce; }
.alert-error { background: #fdecef; color: #a01c33; border: 1px solid #f6c7d0; }
.alert-info { background: #eef1f9; color: #33417a; border: 1px solid #ccd5ee; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-yes { background: #e6f4ec; color: #14653a; }
.badge-no { background: #f0eef4; color: #6b6580; }
.badge-soft { background: rgba(61, 49, 91, .08); color: var(--a-primary); }

.empty { text-align: center; padding: 48px 20px; color: var(--a-muted); }
.empty .icon { width: 36px; height: 36px; color: #c9c4d6; margin: 0 auto 12px; }

.search { display: flex; gap: 8px; }
.search input { padding: 8px 12px; border: 1px solid var(--a-border); border-radius: 7px; font-family: inherit; font-size: .85rem; min-width: 210px; }

/* ------------------------------------------------------------ pagination */

.pagination { display: flex; list-style: none; gap: 5px; padding: 16px 20px; margin: 0; justify-content: center; flex-wrap: wrap; }
.pagination li { margin: 0; }
.pagination .page-link, .pagination .page-item span, .pagination .page-item a {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
    padding: 0 10px; border: 1px solid var(--a-border); border-radius: 7px;
    background: #fff; color: #4b4658; font-size: .84rem; text-decoration: none;
}
.pagination .page-item.active .page-link { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.pagination .page-item.disabled .page-link { opacity: .45; }
.pagination svg { width: 13px; height: 13px; }

/* ----------------------------------------------------------------- login */

.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(135deg, var(--a-primary-dark) 0%, var(--a-primary) 55%, #7a5670 100%);
}
.login-card {
    width: 100%; max-width: 410px; background: #fff; border-radius: 14px;
    box-shadow: 0 24px 60px rgba(20, 14, 34, .38); overflow: hidden;
}
.login-head { text-align: center; padding: 30px 30px 20px; }
.login-head img { height: 78px; width: auto; margin: 0 auto 14px; }
.login-head h1 { font-size: 1.16rem; margin-bottom: .2em; }
.login-head p { font-size: .84rem; color: var(--a-muted); margin: 0; }
.login-body { padding: 0 30px 26px; }
.login-foot {
    padding: 14px 30px; background: #faf9fc; border-top: 1px solid var(--a-border);
    text-align: center; font-size: .8rem; color: var(--a-muted);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.show { transform: translateX(0); }
    .main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
}
