
/* =========================================================
   SAWANA.LK 2.0 - GLOBAL APPLICATION STYLES
   Dark / Light Theme
   Responsive Admin Layout
   Toast Notifications
   Confirmation Modal
========================================================= */

/* =========================================================
   1. THEME VARIABLES
========================================================= */

:root {
    color-scheme: dark;

    --bg: #0c1019;
    --panel: #141b29;
    --panel2: #1b2535;
    --text: #f2f5fa;
    --muted: #98a5b8;
    --line: #293447;
    --accent: #a78bfa;
    --accent2: #6ee7d8;

    --success: #22c55e;
    --success-bg: #123323;
    --danger: #ef4444;
    --danger-bg: #3b1d26;
    --warning: #f59e0b;
    --warning-bg: #3c2d16;
    --info: #38bdf8;
    --info-bg: #132f42;

    --shadow: 0 18px 60px #0004;
    --radius: 14px;
    --radius-sm: 9px;
    --transition: .2s ease;
}

html[data-theme="light"] {
    color-scheme: light;

    --bg: #f4f6fb;
    --panel: #ffffff;
    --panel2: #edf1f8;
    --text: #182033;
    --muted: #667085;
    --line: #dce2ed;
    --accent: #6d4ce6;
    --accent2: #087f76;

    --success: #15803d;
    --success-bg: #e7f8ed;
    --danger: #dc2626;
    --danger-bg: #feecec;
    --warning: #b45309;
    --warning-bg: #fff4dc;
    --info: #0369a1;
    --info-bg: #e6f5fc;

    --shadow: 0 18px 50px #26334b12;
}

/* =========================================================
   2. RESET / BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        "Noto Sans Sinhala",
        sans-serif;
    font-size: 14px;
    line-height: 1.55;
    transition:
        background var(--transition),
        color var(--transition);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    opacity: .85;
}

img {
    max-width: 100%;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* =========================================================
   3. SCROLLBAR
========================================================= */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* =========================================================
   4. TOP BAR
========================================================= */

.topbar {
    min-height: 64px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    background: var(--panel);
    border-bottom: 1px solid var(--line);

    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
}

.topbar small {
    color: var(--muted);
}

.brand,
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text);
}

.brand img,
.logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 9px;
}


/* =========================================================
   SAWANA.LK - BRAND MARK & TOP NAVIGATION FIX
========================================================= */

.brand {
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent, #7c5cff);
    color: #ffffff;
    font-size: 23px;
    font-weight: 900;
    line-height: 1;
}

.brand-dot {
    color: var(--accent, #7c5cff);
}

.brand small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--muted);
}


/* =========================================================
   THEME TOGGLE BUTTON
========================================================= */

.theme-toggle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-size: 19px;
    cursor: pointer;
    transition: background .2s ease,
                border-color .2s ease,
                transform .2s ease;
}

.theme-toggle:hover {
    background: var(--panel-2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
/* =========================================================
   SAWANA.LK — MINIMAL FOOTER
========================================================= */
/* Footer - Left & Right Alignment */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
    padding: 16px 22px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--line);
}

.footer span:first-child {
    text-align: center;
}

.footer span:last-child {
    text-align: left;
    margin-left: auto;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .footer {
        flex-wrap: wrap;
        gap: 6px;
        padding: 14px 12px;
    }
}


/* =========================================================
   5. MAIN CONTAINER
========================================================= */

.container,
.page-container {
    width: min(1500px, calc(100% - 40px));
    margin: 24px auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.page-header h1,
.page-title {
    margin: 0;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.page-subtitle {
    color: var(--muted);
    margin-top: 4px;
    font-size: 13px;
}

/* =========================================================
   6. CARDS / PANELS
========================================================= */

.card,
.panel,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    padding: 20px;
}

.panel {
    padding: 18px;
}

.card-header,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-title,
.panel-title {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
}

.card-description {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

/* =========================================================
   7. STATISTICS
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 17px;
    position: relative;
    overflow: hidden;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.stat-value {
    font-size: 25px;
    font-weight: 850;
    margin-top: 7px;
    letter-spacing: -.6px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--panel2);
    color: var(--accent);
}

/* =========================================================
   8. SIDEBAR
========================================================= */

.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 245px;
    flex: 0 0 245px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 16px 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar a,
.sidebar button {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    font-size: 13px;
    font-weight: 650;
    transition: var(--transition);
}

.sidebar a:hover,
.sidebar button:hover,
.sidebar a.active {
    background: var(--panel2);
    color: var(--text);
}

.sidebar a.active {
    color: var(--accent);
}

.sidebar-section {
    margin: 18px 12px 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-content {
    flex: 1;
    min-width: 0;
    padding: 22px;
}

/* =========================================================
   9. BUTTONS
========================================================= */

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 36px;
    padding: 8px 14px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: var(--panel2);
    color: var(--text);

    font-size: 12px;
    font-weight: 750;
    text-decoration: none;

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
    opacity: .95;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text);
}

.btn-sm {
    min-height: 29px;
    padding: 5px 9px;
    font-size: 11px;
}

.btn-lg {
    min-height: 44px;
    padding: 11px 20px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

/* =========================================================
   10. FORMS
========================================================= */

.form-group {
    margin-bottom: 16px;
}

.form-label,
label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 39px;
    padding: 9px 11px;

    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;

    color: var(--text);
    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: .8;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

.form-help,
.help-text {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* =========================================================
   11. TABLES
========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 11px;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--panel2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .55px;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    font-size: 12px;
    color: var(--text);
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: color-mix(in srgb, var(--panel2) 55%, transparent);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* =========================================================
   12. BADGES / STATUS
========================================================= */

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 4px 9px;
    border-radius: 30px;

    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;

    background: var(--panel2);
    color: var(--muted);
}

.badge-success,
.status-published {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger,
.status-rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning,
.status-pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* =========================================================
   13. ALERTS / FLASH MESSAGES
========================================================= */

.notice,
.alert,
.sm-alert {
    padding: 12px 15px;
    margin: 0 0 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel2);
    color: var(--text);
    font-size: 12px;
}

.notice.success,
.alert-success,
.sm-alert.success {
    background: var(--success-bg);
    border-color: color-mix(in srgb, var(--success) 35%, var(--line));
    color: var(--success);
}

.notice.error,
.alert-danger,
.sm-alert.error {
    background: var(--danger-bg);
    border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
    color: var(--danger);
}

.notice.warning,
.alert-warning,
.sm-alert.warning {
    background: var(--warning-bg);
    border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
    color: var(--warning);
}

.notice.info,
.alert-info,
.sm-alert.info {
    background: var(--info-bg);
    border-color: color-mix(in srgb, var(--info) 35%, var(--line));
    color: var(--info);
}

/* =========================================================
   14. PAGINATION
========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.pagination a,
.pagination span {
    min-width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
}

.pagination .active,
.pagination a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* =========================================================
   15. FILTERS / TOOLBAR
========================================================= */

.toolbar,
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.search-box {
    width: min(320px, 100%);
}

/* =========================================================
   16. MODAL BASE
========================================================= */

.modal-backdrop,
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;
    background: #0009;
    backdrop-filter: blur(5px);
}

.modal,
.modal-content {
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;

    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* =========================================================
   17. GLOBAL TOAST NOTIFICATIONS
========================================================= */

#sawanaToastContainer {
    position: fixed;
    top: 82px;
    right: 22px;
    z-index: 20000;

    width: min(390px, calc(100vw - 32px));

    display: flex;
    flex-direction: column;
    gap: 10px;

    pointer-events: none;
}

.sawana-toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    width: 100%;
    padding: 13px 14px;

    background: var(--panel);
    color: var(--text);

    border: 1px solid var(--line);
    border-left: 4px solid var(--info);
    border-radius: 12px;

    box-shadow: var(--shadow);

    pointer-events: auto;
    animation: sawanaToastIn .25s ease both;
}

.sawana-toast.success {
    border-left-color: var(--success);
}

.sawana-toast.error {
    border-left-color: var(--danger);
}

.sawana-toast.warning {
    border-left-color: var(--warning);
}

.sawana-toast.info {
    border-left-color: var(--info);
}

.sawana-toast-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;

    display: grid;
    place-items: center;

    border-radius: 50%;
    background: var(--panel2);

    font-size: 13px;
    font-weight: 900;
}

.sawana-toast.success .sawana-toast-icon {
    color: var(--success);
}

.sawana-toast.error .sawana-toast-icon {
    color: var(--danger);
}

.sawana-toast.warning .sawana-toast-icon {
    color: var(--warning);
}

.sawana-toast.info .sawana-toast-icon {
    color: var(--info);
}

.sawana-toast-content {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.sawana-toast-close {
    flex: 0 0 25px;
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);

    font-size: 17px;
    line-height: 1;
}

.sawana-toast-close:hover {
    background: var(--panel2);
    color: var(--text);
}

@keyframes sawanaToastIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes sawanaToastOut {
    to {
        opacity: 0;
        transform: translateX(18px);
    }
}

.sawana-toast.removing {
    animation: sawanaToastOut .2s ease forwards;
}

/* =========================================================
   18. GLOBAL CONFIRMATION POPUP
========================================================= */

.sawana-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 21000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background: #000a;
    backdrop-filter: blur(6px);

    animation: sawanaModalFade .18s ease;
}

.sawana-confirm-box {
    width: min(420px, 100%);
    padding: 24px;

    background: var(--panel);
    color: var(--text);

    border: 1px solid var(--line);
    border-radius: 17px;

    box-shadow: var(--shadow);

    animation: sawanaModalIn .22s ease;
}

.sawana-confirm-icon {
    width: 49px;
    height: 49px;

    display: grid;
    place-items: center;

    margin-bottom: 15px;

    border-radius: 14px;
    background: var(--panel2);

    color: var(--accent);
    font-size: 22px;
    font-weight: 900;
}

.sawana-confirm-overlay[data-type="danger"] .sawana-confirm-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.sawana-confirm-overlay[data-type="warning"] .sawana-confirm-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.sawana-confirm-overlay[data-type="success"] .sawana-confirm-icon {
    background: var(--success-bg);
    color: var(--success);
}

.sawana-confirm-title {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
}

.sawana-confirm-message {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.sawana-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 23px;
}

.sawana-confirm-actions button {
    min-height: 37px;
    padding: 8px 15px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: var(--panel2);
    color: var(--text);

    font-size: 12px;
    font-weight: 800;
}

.sawana-confirm-actions button:hover {
    filter: brightness(1.08);
}

.sawana-confirm-actions .sawana-confirm-ok {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.sawana-confirm-overlay[data-type="danger"] .sawana-confirm-ok {
    background: var(--danger);
    border-color: var(--danger);
}

.sawana-confirm-overlay[data-type="success"] .sawana-confirm-ok {
    background: var(--success);
    border-color: var(--success);
}

@keyframes sawanaModalFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sawanaModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   19. EMPTY STATES
========================================================= */

.empty-state {
    padding: 45px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 35px;
    margin-bottom: 12px;
}

.empty-state h3 {
    color: var(--text);
    font-size: 16px;
    margin: 0 0 6px;
}

.empty-state p {
    margin: 0;
    font-size: 12px;
}

/* =========================================================
   20. CODE / PREVIEW / AUDIO
========================================================= */

pre,
code {
    font-family: Consolas, Monaco, monospace;
}

pre {
    max-width: 100%;
    overflow: auto;
    padding: 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    font-size: 12px;
}

audio {
    width: 100%;
    max-width: 330px;
    height: 35px;
}

/* =========================================================
   21. UTILITY CLASSES
========================================================= */

.text-muted {
    color: var(--muted) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.fw-bold {
    font-weight: 800 !important;
}

.small {
    font-size: 11px !important;
}

.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 15px !important; }
.mt-4 { margin-top: 20px !important; }

.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }

.d-flex {
    display: flex !important;
}

.align-center {
    align-items: center !important;
}

.justify-between {
    justify-content: space-between !important;
}

.gap-1 { gap: 5px !important; }
.gap-2 { gap: 10px !important; }
.gap-3 { gap: 15px !important; }

.w-100 {
    width: 100% !important;
}

.hidden {
    display: none !important;
}

/* =========================================================
   22. RESPONSIVE DESIGN
========================================================= */

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: 215px;
        flex-basis: 215px;
    }

    .sidebar-content {
        padding: 17px;
    }
}

@media (max-width: 760px) {
    .topbar {
        padding: 10px 14px;
    }

    .container,
    .page-container {
        width: calc(100% - 24px);
        margin: 15px auto;
    }

    .admin-layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        padding: 9px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar a,
    .sidebar button {
        width: auto;
        padding: 8px 10px;
        font-size: 11px;
    }

    .sidebar-section {
        width: 100%;
        margin: 9px 8px 3px;
    }

    .sidebar-content {
        padding: 14px 10px;
    }

    .page-header h1,
    .page-title {
        font-size: 19px;
    }

    .card,
    .panel {
        padding: 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    #sawanaToastContainer {
        top: 72px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .toolbar,
    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .sawana-confirm-box {
        padding: 19px;
    }

    .sawana-confirm-actions {
        flex-direction: column-reverse;
    }

    .sawana-confirm-actions button {
        width: 100%;
    }

    th,
    td {
        padding: 9px 10px;
    }
}
/* =========================================================
   SAWANA.LK — FINAL BRANDING & GLOBAL NAVIGATION
   Supports existing dark/light theme variables
========================================================= */

/* ---------- BRAND / LOGO ---------- */

.topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
    color: var(--text);
    text-decoration: none;
    font-size: 19px;
    font-weight: 850;
    letter-spacing: -0.5px;
}

.topbar .brand-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #ffffff !important;

    font-size: 23px;
    font-weight: 900;
    line-height: 1;

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.20);
}

.topbar .brand > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar .brand-dot {
    color: var(--accent2) !important;
    font-weight: 900;
}

.topbar .brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

/* Uploaded logo */

.topbar .brand img,
.topbar .brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 11px;
}

/* ---------- TOP NAVIGATION ---------- */

.topbar {
    min-height: 70px;
    padding: 10px 24px;
    gap: 20px;

    background: var(--panel);
    border-bottom: 1px solid var(--line);

    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.topbar nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 8px 13px;

    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;

    font-size: 13px;
    font-weight: 650;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.topbar nav a:hover {
    background: var(--panel2);
    color: var(--text);
    transform: translateY(-1px);
}

/* ---------- DARK / LIGHT THEME BUTTON ---------- */

.topbar .theme-toggle,
#themeToggle {
    width: 42px;
    height: 42px;
    min-width: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;

    background: var(--panel2);
    color: var(--text);

    font-size: 20px;
    line-height: 1;
    cursor: pointer;

    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.08);

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.topbar .theme-toggle:hover,
#themeToggle:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: rotate(12deg);
}

.topbar .theme-toggle:focus-visible,
#themeToggle:focus-visible {
    outline: 3px solid var(--accent2);
    outline-offset: 3px;
}



/* ---------- LIGHT THEME POLISH ---------- */

html[data-theme="light"] .topbar {
    box-shadow: 0 3px 14px rgba(20, 30, 50, 0.05);
}

html[data-theme="light"] .brand-mark {
    box-shadow: 0 4px 12px rgba(40, 50, 80, 0.14);
}

html[data-theme="light"] .theme-toggle {
    box-shadow: 0 2px 7px rgba(20, 30, 50, 0.07);
}

html[data-theme="light"] .footer {
    box-shadow: 0 -3px 14px rgba(20, 30, 50, 0.025);
}

/* ---------- MOBILE RESPONSIVE ---------- */

@media (max-width: 760px) {

    .topbar {
        padding: 10px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .topbar .brand {
        font-size: 17px;
    }

    .topbar .brand-mark {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 21px;
    }

    .topbar nav {
        width: 100%;
        justify-content: flex-start;
        gap: 5px;
    }

    .topbar nav a {
        min-height: 35px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .topbar .theme-toggle,
    #themeToggle {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

@media (max-width: 420px) {

    .topbar {
        padding: 9px 11px;
    }

    .topbar nav a {
        padding: 6px 8px;
        font-size: 11px;
    }

    .footer {
        font-size: 11px;
    }
}
/* =========================================================
   END OF SAWANA.LK 2.0 GLOBAL CSS
========================================================= */
/* =========================================================
   SAWANA.LK — GLOBAL BUTTON SYSTEM
   Dark / Light Theme Compatible
========================================================= */

/* ---------- BASE BUTTON ---------- */

button,
.btn,
a.btn,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    min-height: 40px;
    padding: 9px 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 1px solid transparent;
    border-radius: 10px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;

    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

/* ---------- PRIMARY BUTTON ---------- */

.btn-primary,
button.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #ffffff;
    border-color: transparent;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.13);
}

.btn-primary:hover,
button.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* ---------- SECONDARY BUTTON ---------- */

.btn-secondary,
button.btn-secondary {
    background: var(--panel2);
    color: var(--text);
    border-color: var(--line);
}

.btn-secondary:hover,
button.btn-secondary:hover {
    background: var(--panel);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- SUCCESS BUTTON ---------- */

.btn-success,
button.btn-success {
    background: #15803d;
    color: #ffffff;
    border-color: #15803d;
}

.btn-success:hover,
button.btn-success:hover {
    background: #166534;
    border-color: #166534;
    transform: translateY(-1px);
}

/* ---------- DANGER BUTTON ---------- */

.btn-danger,
button.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.btn-danger:hover,
button.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
}

/* ---------- WARNING BUTTON ---------- */

.btn-warning,
button.btn-warning {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
}

.btn-warning:hover,
button.btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
}

/* ---------- OUTLINE BUTTON ---------- */

.btn-outline,
button.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover,
button.btn-outline:hover {
    background: var(--accent);
    color: #ffffff;
}

/* ---------- GHOST BUTTON ---------- */

.btn-ghost,
button.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.btn-ghost:hover,
button.btn-ghost:hover {
    background: var(--panel2);
    color: var(--text);
}

/* ---------- SMALL BUTTON ---------- */

.btn-sm,
button.btn-sm {
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 11px;
}

/* ---------- LARGE BUTTON ---------- */

.btn-lg,
button.btn-lg {
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px;
}

/* ---------- FULL WIDTH ---------- */

.btn-block {
    width: 100%;
}

/* ---------- ICON BUTTON ---------- */

.btn-icon,
button.btn-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
}

/* ---------- DISABLED ---------- */

button:disabled,
.btn:disabled,
.btn.disabled,
input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* ---------- KEYBOARD ACCESSIBILITY ---------- */

button:focus-visible,
.btn:focus-visible,
input[type="submit"]:focus-visible {
    outline: 3px solid var(--accent2);
    outline-offset: 3px;
}

/* ---------- BUTTON GROUP ---------- */

.btn-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px) {
    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }
}
/* =========================================================
   SAWANA.LK — .BUTTON LINK STYLE
========================================================= */

a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 44px;
    padding: 11px 21px;

    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #ffffff !important;

    border: 1px solid transparent;
    border-radius: 11px;

    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.2px;
    text-decoration: none !important;
    white-space: nowrap;

    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);

    transition: all 0.2s ease;
}

a.button:hover {
    color: #ffffff !important;
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

a.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
}

a.button:focus-visible {
    outline: 3px solid var(--accent2);
    outline-offset: 3px;
}

/* Mobile */
@media (max-width: 600px) {
    a.button {
        min-height: 41px;
        padding: 10px 15px;
        font-size: 12px;
    }
}