/* ==========================================================================
   FalconTech Admin Theme
   Sits on top of Bootstrap 4 and restyles every admin page.
   ========================================================================== */

:root {
    --brand: #587498;
    --brand-600: #4a6384;
    --brand-700: #3c5170;
    --brand-50: #eef2f8;
    --brand-100: #dde5f0;
    --accent: #e96850;
    --accent-600: #d9573f;
    --accent-50: #fdeeeb;

    --sidebar-bg: #16213a;
    --sidebar-bg-2: #1c2a48;
    --sidebar-text: #a9b4cc;
    --sidebar-text-strong: #ffffff;
    --sidebar-muted: #5f6d8b;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-w: 264px;

    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e6eaf2;
    --text: #1e293b;
    --text-2: #475569;
    --muted: #8a94a8;

    --success: #16a34a;
    --success-50: #e9f8ef;
    --danger: #dc3545;
    --danger-50: #fdecee;
    --warning: #f59e0b;
    --warning-50: #fef5e6;
    --info: #0ea5e9;
    --info-50: #e7f6fd;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 6px 16px -4px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18);
    --topbar-h: 68px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Montserrat', var(--font);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }

body.adm {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.adm a { color: var(--brand); transition: color .15s; }
.adm a:hover { color: var(--brand-700); text-decoration: none; }
.adm h1, .adm h2, .adm h3, .adm h4, .adm h5, .adm h6 {
    font-family: var(--font-display);
    color: var(--text);
    font-weight: 700;
    letter-spacing: -.01em;
}
.adm ::selection { background: var(--brand-100); }
.adm img { max-width: 100%; }

/* ---------- Sidebar ---------- */
.adm-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.adm-brand:hover { text-decoration: none; }
.adm-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.adm-brand-logo img { width: 30px; height: 30px; object-fit: contain; }
.adm-brand-logo span { font-family: var(--font-display); font-weight: 800; color: var(--brand); }
.adm-brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    line-height: 1.15;
}
.adm-brand-name small {
    display: block;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    color: var(--sidebar-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.adm-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .12) transparent;
}
.adm-nav::-webkit-scrollbar { width: 6px; }
.adm-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.adm-nav-section {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 18px 12px 8px;
}
.adm-nav-section:first-child { padding-top: 6px; }

.adm-nav a.adm-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.adm-nav a.adm-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    opacity: .85;
}
.adm-nav a.adm-nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-strong);
}
.adm-nav a.adm-nav-link.is-active {
    background: linear-gradient(90deg, rgba(233, 104, 80, .95), rgba(233, 104, 80, .78));
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(233, 104, 80, .7);
}
.adm-nav a.adm-nav-link.is-active i { opacity: 1; }
.adm-nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
}
.adm-nav a.is-active .adm-nav-badge { background: rgba(255, 255, 255, .25); }

.adm-sidebar-foot {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.adm-sidebar-foot a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}
.adm-sidebar-foot a:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.adm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

/* ---------- Main / Topbar ---------- */
.adm-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.adm-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.adm-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.adm-page-heading { min-width: 0; }
.adm-page-heading h1 {
    font-size: 19px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adm-crumbs {
    font-size: 12.5px;
    color: var(--muted);
}
.adm-crumbs a { color: var(--muted); }
.adm-crumbs a:hover { color: var(--brand); }
.adm-crumbs i { font-size: 9px; margin: 0 6px; }

.adm-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.adm-icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--text-2);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all .15s;
}
.adm-icon-btn:hover { color: var(--brand); border-color: var(--brand-100); background: var(--brand-50); }

.adm-user { position: relative; }
.adm-user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    color: var(--text);
    font: inherit;
    transition: box-shadow .15s;
}
.adm-user-toggle:hover, .adm-user-toggle:focus { box-shadow: 0 0 0 4px var(--brand-50); outline: none; }
.adm-user-toggle::after { display: none; }
.adm-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.adm-user-name { font-weight: 600; font-size: 13.5px; line-height: 1.1; text-align: left; }
.adm-user-name small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }

.adm .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: 14px;
    min-width: 210px;
}
.adm .dropdown-item,
.adm .dropdown-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
}
.adm .dropdown-item i { width: 16px; color: var(--muted); }
.adm .dropdown-item:hover, .adm .dropdown-item:focus { background: var(--brand-50); color: var(--brand-700); }
.adm .dropdown-item.text-danger:hover { background: var(--danger-50); color: var(--danger) !important; }
.adm .dropdown-item.text-danger i { color: inherit; }
.adm .dropdown-divider { margin: 6px 0; border-color: var(--border); }
.adm-dropdown-head { padding: 10px 12px 8px; }
.adm-dropdown-head strong { display: block; font-size: 14px; }
.adm-dropdown-head span { font-size: 12.5px; color: var(--muted); }

.adm-content {
    flex: 1;
    padding: 28px;
    width: 100%;
    max-width: 1480px;
}

.adm-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 28px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.adm-footer a { color: var(--text-2); font-weight: 500; }

/* ---------- Cards ---------- */
.adm .card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--surface);
    margin-bottom: 24px;
    overflow: hidden;
}
.adm .card.px-2.py-3 { padding: 20px !important; }
.adm .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
}
.adm .card-header strong,
.adm .card-header .card-title,
.adm .card-header h4,
.adm .card-header h5 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}
.adm .card-body { padding: 22px; }
.adm .card-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 16px 22px; }
.adm .card-title { font-family: var(--font-display); font-weight: 700; }
.adm .header-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.adm .secondary-header:empty { display: none; }
.adm .secondary-header .alert { margin: 0; }
.adm .box-title { font-size: 17px; margin: 0; }
.adm .card.bg-dark, .adm .card.bg-info, .adm .card.bg-primary, .adm .card.bg-warning { border: 0; }

/* ---------- Buttons ---------- */
.adm .btn {
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    padding: 9px 18px;
    border-width: 1px;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
}
.adm .btn:focus { box-shadow: 0 0 0 4px var(--brand-100); }
.adm .btn-sm { font-size: 12.5px; padding: 6px 12px; border-radius: 8px; gap: 6px; }
.adm .btn-lg { font-size: 15px; padding: 12px 24px; }
.adm .btn:hover { transform: translateY(-1px); }
.adm .btn:active { transform: none; }

.adm .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(88, 116, 152, .6); }
.adm .btn-primary:hover, .adm .btn-primary:focus, .adm .btn-primary:not(:disabled):not(.disabled):active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }

/* btn-dark is only used for "Back" links — render as a quiet secondary button */
.adm .btn-dark { background: var(--surface); border-color: #d9dfe9; color: var(--text-2); }
.adm .btn-dark::before { content: '\f060'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 12px; }
.adm .btn-dark:hover, .adm .btn-dark:focus, .adm .btn-dark:not(:disabled):not(.disabled):active { background: var(--surface-2); border-color: #c5cedc; color: var(--text); }

/* Form submit buttons (legacy markup uses btn-info) — make them the primary action */
.adm input[type=submit].btn, .adm input[type=submit].btn-info {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px -4px rgba(88, 116, 152, .6);
    margin-left: 6px;
}
.adm input[type=submit].btn:hover, .adm input[type=submit].btn:focus { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.adm .form-group:has(> input[type=submit]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}
.adm .form-group:has(> input[type=submit]) input[type=submit] { margin-left: 0; }

.adm .btn-info { background: var(--brand-50); border-color: var(--brand-50); color: var(--brand-700); }
.adm .btn-info:hover, .adm .btn-info:focus, .adm .btn-info:not(:disabled):not(.disabled):active { background: var(--brand); border-color: var(--brand); color: #fff; }

.adm .btn-danger { background: var(--danger-50); border-color: var(--danger-50); color: var(--danger); }
.adm .btn-danger:hover, .adm .btn-danger:focus, .adm .btn-danger:not(:disabled):not(.disabled):active { background: var(--danger); border-color: var(--danger); color: #fff; }

.adm .btn-success { background: var(--success); border-color: var(--success); }
.adm .btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.adm .btn-secondary:hover, .adm .btn-secondary:focus { background: var(--surface-2); border-color: #cfd6e3; color: var(--text); }
.adm .btn-outline-dark { border-color: var(--border); color: var(--text); }
.adm .btn-outline-dark:hover { background: var(--text); border-color: var(--text); color: #fff; }

/* "Add new" buttons were w-25 blocks — make them natural width */
.adm .btn.w-25 { width: auto !important; }
.adm a.btn.ml-auto { float: right; }
.adm .card > a.btn.ml-auto { align-self: flex-end; margin-top: 0 !important; margin-bottom: 18px !important; float: none; }

/* ---------- Forms ---------- */
.adm label, .adm .form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 6px;
}
.adm .form-group { margin-bottom: 20px; }
.adm .form-control {
    height: auto;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #d9dfe9;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14.5px;
    transition: border-color .15s, box-shadow .15s;
}
.adm textarea.form-control { min-height: 110px; }
.adm .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-50);
}
.adm .form-control::placeholder { color: #a8b1c2; }
.adm .form-control[readonly], .adm .form-control:disabled { background: var(--surface-2); }
.adm select.form-control {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 38px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.adm input[type=file].form-control,
.adm .form-control-file {
    padding: 8px;
    min-height: 0;
    border-style: dashed;
    background: var(--surface-2);
    cursor: pointer;
    font-size: 13.5px;
    width: 100%;
    border: 1px dashed #cdd5e1;
    border-radius: var(--radius-sm);
}
.adm input[type=file]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}
.adm input[type=file]::file-selector-button:hover { background: var(--brand-700); }
.adm .text-danger { font-size: 12.5px; }
.adm .form-group .text-danger { display: inline-block; margin-top: 6px; }
.adm .form-check-input { accent-color: var(--brand); }
.adm input[type=checkbox], .adm input[type=radio] { accent-color: var(--brand); }
.adm form .btn[type=submit], .adm form input[type=submit].btn { min-width: 140px; }

/* ---------- Tables ---------- */
.adm .table-responsive { border-radius: var(--radius-sm); }
.adm .table {
    color: var(--text);
    margin-bottom: 0;
    font-size: 14px;
}
.adm .card > .table, .adm .card > table.display { width: 100% !important; }
.adm .card > .dataTables_wrapper, .adm-table-scroll { overflow-x: auto; }
.adm .table thead th,
.adm .table .thead-light th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}
.adm .table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-top: 1px solid var(--border);
}
.adm .table tbody tr { transition: background .12s; }
.adm .table tbody tr:hover { background: #f9fbfe; }
.adm .table-bordered, .adm .table-bordered td, .adm .table-bordered th { border-color: var(--border); }
.adm .table td img {
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.adm .table td .btn { margin: 2px; }

/* ---------- DataTables ---------- */
.adm .dataTables_wrapper { padding-top: 4px; font-size: 13.5px; color: var(--text-2); }
.adm .dataTables_wrapper .dataTables_length,
.adm .dataTables_wrapper .dataTables_filter { margin-bottom: 14px; }
.adm .dataTables_wrapper .dataTables_length select,
.adm .dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d9dfe9;
    border-radius: 8px;
    padding: 6px 10px;
    background: var(--surface);
    outline: none;
}
.adm .dataTables_wrapper .dataTables_filter input { min-width: 220px; margin-left: 8px; }
.adm .dataTables_wrapper .dataTables_filter input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.adm table.dataTable { border-collapse: collapse !important; }
.adm table.dataTable thead th, .adm table.dataTable thead td { border-bottom: 1px solid var(--border); }
.adm table.dataTable.no-footer { border-bottom: 1px solid var(--border); }
.adm .dataTables_wrapper .dataTables_info { padding-top: 16px; color: var(--muted); }
.adm .dataTables_wrapper .dataTables_paginate { padding-top: 12px; }
.adm .dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    color: var(--text-2) !important;
    padding: 5px 12px !important;
    margin-left: 4px !important;
}
.adm .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--brand-50) !important;
    border-color: var(--brand-100) !important;
    color: var(--brand-700) !important;
}
.adm .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.adm .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}
.adm .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .45; }

/* ---------- Pagination (Laravel) ---------- */
.adm .pagination { gap: 4px; flex-wrap: wrap; margin: 8px 0 0; }
.adm .page-link {
    border: 1px solid var(--border);
    border-radius: 8px !important;
    color: var(--text-2);
    padding: 7px 13px;
    font-weight: 500;
}
.adm .page-link:hover { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.adm .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.adm nav[role=navigation] p.small { color: var(--muted); }

/* ---------- Alerts ---------- */
.adm .alert {
    border: 0;
    border-radius: 12px;
    padding: 14px 44px 14px 48px;
    position: relative;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}
.adm .alert::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 18px;
    top: 14px;
}
.adm .alert-success { background: var(--success-50); color: #166534; border-left: 4px solid var(--success); }
.adm .alert-success::before { content: '\f058'; color: var(--success); }
.adm .alert-danger { background: var(--danger-50); color: #9f1239; border-left: 4px solid var(--danger); }
.adm .alert-danger::before { content: '\f06a'; color: var(--danger); }
.adm .alert-info { background: var(--info-50); color: #075985; border-left: 4px solid var(--info); }
.adm .alert-info::before { content: '\f05a'; color: var(--info); }
.adm .alert-warning { background: var(--warning-50); color: #92400e; border-left: 4px solid var(--warning); }
.adm .alert-warning::before { content: '\f071'; color: var(--warning); }
.adm .alert ul { margin: 0; padding-left: 0; }
.adm .alert .close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 4px 8px; opacity: .5; text-shadow: none; }
.adm .alert .close:hover { opacity: 1; }
.adm .w-25 > .alert { min-width: 300px; }
.adm .w-25.mr-auto { width: auto !important; }
.adm-flash { margin-bottom: 22px; }

/* ---------- Badges ---------- */
.adm .badge { font-weight: 600; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; }

/* ---------- Summernote / CKEditor ---------- */
.adm .note-editor.note-frame {
    border: 1px solid #d9dfe9;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.adm .note-editor .note-toolbar {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 8px;
}
.adm .note-editor .note-btn {
    border-color: var(--border);
    background: var(--surface);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 13px;
}
.adm .note-editor .note-btn:hover { background: var(--brand-50); }
.adm .note-editor .note-statusbar { background: var(--surface-2); }
.adm .ck.ck-editor__main > .ck-editor__editable { min-height: 220px; }
.adm .ck.ck-toolbar { border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important; background: var(--surface-2) !important; }
.adm .ck.ck-editor__main > .ck-editor__editable:not(.ck-focused) { border-color: #d9dfe9 !important; }
.adm .ck-rounded-corners .ck.ck-editor__main > .ck-editor__editable { border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; }

/* ---------- Modal ---------- */
.adm .modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.adm .modal-header, .adm .modal-footer { border-color: var(--border); padding: 18px 22px; }
.adm .modal-body { padding: 22px; }

/* ---------- Dashboard ---------- */
.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 30px 32px;
    margin-bottom: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 20%, rgba(233, 104, 80, .55), transparent 42%),
        radial-gradient(circle at 70% 120%, rgba(255, 255, 255, .15), transparent 45%),
        linear-gradient(120deg, #2d3f5e 0%, var(--brand) 100%);
    box-shadow: 0 18px 40px -18px rgba(45, 63, 94, .7);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.dash-hero::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, .06);
}
.dash-hero h2 { color: #fff; font-size: 26px; margin: 0 0 6px; }
.dash-hero p { margin: 0; opacity: .85; max-width: 520px; }
.dash-hero-date {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .75;
    margin-bottom: 8px;
}
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.dash-hero-actions .btn { background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(6px); }
.dash-hero-actions .btn:hover { background: #fff; color: var(--brand-700); }
.dash-hero-actions .btn.btn-light { background: #fff; color: var(--brand-700); }
.dash-hero-actions .btn.btn-light:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text) !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.stat-card::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 18px;
    font-size: 12px;
    color: var(--muted);
    opacity: 0;
    transform: translateX(-6px);
    transition: all .18s;
}
.stat-card:hover::after { opacity: 1; transform: none; }
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }

.tone-blue   .stat-icon, .tone-blue.stat-icon   { background: var(--brand-50); color: var(--brand); }
.tone-orange .stat-icon, .tone-orange.stat-icon { background: var(--accent-50); color: var(--accent); }
.tone-green  .stat-icon, .tone-green.stat-icon  { background: var(--success-50); color: var(--success); }
.tone-violet .stat-icon, .tone-violet.stat-icon { background: #f1ecfe; color: #7c3aed; }
.tone-sky    .stat-icon, .tone-sky.stat-icon    { background: var(--info-50); color: var(--info); }
.tone-amber  .stat-icon, .tone-amber.stat-icon  { background: var(--warning-50); color: #d97706; }
.tone-pink   .stat-icon, .tone-pink.stat-icon   { background: #fdecf5; color: #db2777; }
.tone-slate  .stat-icon, .tone-slate.stat-icon  { background: #eef1f5; color: #475569; }

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 22px;
}
.dash-panel { display: flex; flex-direction: column; }
.dash-panel .card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-panel .card-header a { font-size: 13px; font-weight: 600; }
.dash-panel .card-body { padding: 8px 22px 12px; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item .adm-avatar { width: 38px; height: 38px; font-size: 14px; }
.activity-body { flex: 1; min-width: 0; }
.activity-top { display: flex; justify-content: space-between; gap: 10px; }
.activity-name { font-weight: 600; font-size: 14px; }
.activity-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.activity-text {
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    margin-right: 6px;
}
.activity-tag.orange { background: var(--accent-50); color: var(--accent-600); }

.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 0 10px; }
.quick-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text) !important;
    font-weight: 600;
    font-size: 13.5px;
    transition: all .15s;
}
.quick-link:hover { border-color: var(--brand-100); background: var(--brand-50); transform: translateY(-2px); }
.quick-link .stat-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }

.empty-state { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty-state i { font-size: 28px; margin-bottom: 10px; opacity: .5; }

/* ---------- Login ---------- */
body.adm-auth {
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}
.auth-art {
    position: relative;
    overflow: hidden;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 80% 15%, rgba(233, 104, 80, .6), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .12), transparent 45%),
        linear-gradient(135deg, #16213a 0%, #2d3f5e 55%, var(--brand) 100%);
}
.auth-art::before, .auth-art::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .1);
}
.auth-art::before { width: 520px; height: 520px; right: -180px; bottom: -180px; }
.auth-art::after { width: 340px; height: 340px; right: -90px; bottom: -90px; }
.auth-art-logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 18px; position: relative; z-index: 1; }
.auth-art-logo .adm-brand-logo { width: 44px; height: 44px; }
.auth-art-logo .adm-brand-logo img { width: 34px; height: 34px; }
.auth-art h1 { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.15; margin: 0 0 16px; color: #fff; position: relative; z-index: 1; }
.auth-art p { opacity: .8; max-width: 420px; font-size: 15.5px; margin: 0; position: relative; z-index: 1; }
.auth-art-foot { font-size: 13px; opacity: .6; position: relative; z-index: 1; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 0 0 6px; }
.auth-form .auth-sub { color: var(--muted); margin: 0 0 32px; }
.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; font-weight: 600; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.auth-input { position: relative; }
.auth-input i.lead-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.auth-input input {
    width: 100%;
    height: 50px;
    padding: 0 46px 0 42px;
    border: 1px solid #d9dfe9;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.auth-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.auth-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
}
.auth-toggle:hover { background: var(--surface-2); color: var(--text); }
.auth-submit {
    width: 100%;
    height: 50px;
    margin-top: 10px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 10px 24px -10px rgba(60, 81, 112, .9);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(60, 81, 112, .9); }
.auth-error {
    background: var(--danger-50);
    color: #9f1239;
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 22px;
}
.auth-error div + div { margin-top: 4px; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.auth-back:hover { color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
    .adm-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .adm-main { margin-left: 0; }
    .adm-menu-btn { display: grid; place-items: center; }
    body.nav-open .adm-sidebar { transform: none; }
    body.nav-open .adm-backdrop { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }
    .adm .col-md-10.offset-md-1 { flex: 0 0 100%; max-width: 100%; margin-left: 0; }

    body.adm-auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

@media (max-width: 767.98px) {
    .adm-topbar { padding: 0 16px; gap: 12px; }
    .adm-content { padding: 18px 16px; }
    .adm-footer { padding: 16px; justify-content: center; text-align: center; }
    .adm-user-name, .adm-topbar .adm-icon-btn.hide-sm { display: none; }
    .adm-user-toggle { padding: 3px; }
    .adm-crumbs { display: none; }
    .adm .card-body, .adm .card-header { padding: 16px; }
    .adm .card.px-2.py-3 { padding: 14px !important; }
    .dash-hero { padding: 24px 20px; }
    .dash-hero h2 { font-size: 22px; }
    .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
    .stat-value { font-size: 22px; }
    .dash-panel .card-body { padding: 4px 16px 10px; }
    .adm .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; margin: 6px 0 0; }
    .adm .dataTables_wrapper .dataTables_length, .adm .dataTables_wrapper .dataTables_filter { float: none; text-align: left; }
}
