/* ---------------------------------------------------------------------------
   Vyoora admin — additions on top of the sQuare template themes
   (theme/css/light.css and theme/css/dark.css; one of them applies at a time).
   --------------------------------------------------------------------------- */

/* Brand font, self-hosted (same files as the public website) */
@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url(../fonts/jost-latin-ext-92zatB.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url(../fonts/jost-latin-92zatB.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Theme tokens: light by default, dark when chosen or when following a dark device */
:root {
    --vy-gold: #c29b57;
    --vy-gold-hover: #a98140;
    --vy-gold-soft: rgba(194, 155, 87, 0.14);
    --vy-ink: #0f1c50;
    --vy-ink-2: #24397f;
    --vy-surface: #ffffff;
    --vy-text: #3a3d4a;
    --vy-muted: #8a8f9c;
    --vy-border: rgba(0, 0, 0, 0.1);
    --vy-shadow: 0 6px 24px rgba(15, 28, 80, 0.14);
    --vy-nav-link: #212121;
    --vy-modal-bg: #ffffff;
    --vy-modal-text: #2c2c2c;
    --vy-auth-card: #ffffff;
    --vy-auth-text: #2c2c2c;
    --vy-auth-muted: #8a8f9c;
    --vy-auth-border: #e3e3e3;
}
html[data-theme="dark"] {
    --vy-gold-hover: #d6b16b;
    --vy-surface: #373f46;
    --vy-text: #dddddd;
    --vy-muted: #9aa0ad;
    --vy-border: rgba(255, 255, 255, 0.12);
    --vy-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    --vy-nav-link: #90a4ae;
    --vy-modal-bg: #373f46;
    --vy-modal-text: #dddddd;
    --vy-auth-card: #2b2f3a;
    --vy-auth-text: #e6e6e6;
    --vy-auth-muted: #9aa0ad;
    --vy-auth-border: #535e69;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        --vy-gold-hover: #d6b16b;
        --vy-surface: #373f46;
        --vy-text: #dddddd;
        --vy-muted: #9aa0ad;
        --vy-border: rgba(255, 255, 255, 0.12);
        --vy-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
        --vy-nav-link: #90a4ae;
        --vy-modal-bg: #373f46;
        --vy-modal-text: #dddddd;
        --vy-auth-card: #2b2f3a;
        --vy-auth-text: #e6e6e6;
        --vy-auth-muted: #9aa0ad;
        --vy-auth-border: #535e69;
    }
}

/* ---------------------------------------------------------------------------
   Gold skin (same selectors as the template's colour skins)
   --------------------------------------------------------------------------- */
.theme-gold .btn-primary,
.theme-gold .btn-primary:not(:disabled):not(.disabled):active {
    background: var(--vy-gold);
    border-color: var(--vy-gold);
    color: #fff;
}
.theme-gold .btn-primary:hover,
.theme-gold .btn-primary:focus {
    background: var(--vy-gold-hover);
    border-color: var(--vy-gold-hover);
    color: #fff;
}
.theme-gold .btn-primary.btn-simple {
    border-color: var(--vy-gold);
    color: var(--vy-gold);
    background: transparent;
}
.theme-gold .sidebar .menu .list li.active.open {
    background: var(--vy-gold);
}
.theme-gold .sidebar .menu .list li.active.open > a,
.theme-gold .sidebar .menu .list li.active.open > a i,
.theme-gold .sidebar .menu .list li.active.open > a span {
    color: #fff;
}
.theme-gold .sidebar .menu .list a:hover {
    color: var(--vy-gold);
}
.theme-gold .sidebar .menu .list li.active.open a:hover {
    color: #fff;
}
.theme-gold .nav-tabs .nav-link.active {
    border: 1px solid var(--vy-gold) !important;
    background: var(--vy-gold);
    color: #fff;
}
.theme-gold .card .header h2:before {
    background: var(--vy-gold);
}
.theme-gold .card .header h2 strong {
    color: var(--vy-gold);
}
.theme-gold .form-control:focus,
.theme-gold .form-control:focus + .input-group-addon,
.theme-gold .form-control:focus ~ .input-group-addon,
.theme-gold .input-group-focus .input-group-addon {
    border-color: var(--vy-gold);
}
.theme-gold .authentication .navbar,
.theme-gold .authentication .page-header {
    background: linear-gradient(135deg, var(--vy-ink) 0%, var(--vy-ink-2) 100%) !important;
}
.theme-gold a {
    color: var(--vy-gold);
}
.theme-gold a:hover {
    color: var(--vy-gold-hover);
}
.theme-gold .page-item.active .page-link {
    background-color: var(--vy-gold);
    border-color: var(--vy-gold);
    color: #fff;
}
.theme-gold .breadcrumb-item a {
    color: inherit;
}

/* ---------------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------------- */
.navbar .navbar-brand img {
    object-fit: contain;
    vertical-align: middle;
}
.navbar .bars {
    display: none;
}
.navbar form.d-inline {
    margin: 0;
}
.btn-link-plain {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
    padding: 0;
}

/* Theme toggle: show the moon in light mode, the sun in dark mode */
.theme-toggle .theme-icon-light {
    display: none;
}
html[data-theme-effective="dark"] .theme-toggle .theme-icon-light,
html[data-theme="dark"] .theme-toggle .theme-icon-light {
    display: inline-block;
}
html[data-theme-effective="dark"] .theme-toggle .theme-icon-dark,
html[data-theme="dark"] .theme-toggle .theme-icon-dark {
    display: none;
}
.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 1050;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.auth-theme-toggle:hover {
    background: rgba(194, 155, 87, 0.35);
}
.auth-theme-toggle .theme-icon-light,
.auth-theme-toggle .theme-icon-dark {
    line-height: 1;
}

/* ---------------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------------- */
.sidebar .menu .list {
    overflow-y: auto;
    max-height: calc(100vh - 65px);
}
.sidebar .user-info .image .avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8cd93 0%, var(--vy-gold) 55%, #a98140 100%);
    color: var(--vy-ink);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
}
.menu_sm .sidebar .user-info .image .avatar-initials {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Content
   --------------------------------------------------------------------------- */
.stat-card h3 i {
    font-size: 26px;
    opacity: 0.85;
}
.stat-card.stat-gold h3 i { color: var(--vy-gold); }
.stat-card.stat-blue h3 i { color: #4c9bea; }
.stat-card.stat-amber h3 i { color: #f0ad4e; }
.stat-card.stat-green h3 i { color: #5cb85c; }
.stat-card.stat-coral h3 i { color: #ee6e73; }
.stat-card.stat-purple h3 i { color: #8e6fd8; }
.stat-card .stat-link {
    font-size: 12px;
    font-weight: 500;
}

.grid-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 15px;
}
.grid-filters label {
    margin: 0;
    font-weight: 500;
}
.grid-filters .form-control {
    width: auto;
    min-width: 150px;
}

.card .header .header-dropdown .btn {
    margin: 0;
}
table.dataTable td .btn-sm {
    margin: 2px 2px 2px 0;
    padding: 3px 10px;
    font-size: 12px;
}
table.dataTable td small {
    opacity: 0.8;
}
div.dataTables_wrapper div.dataTables_processing {
    background: var(--vy-surface);
    color: var(--vy-text);
    border: 1px solid var(--vy-border);
    box-shadow: var(--vy-shadow);
}

.tab-padded {
    padding-top: 18px;
}
.modal-header .close {
    color: inherit;
}

/* Appearance choice (Settings → Appearance) */
.theme-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.theme-option {
    margin: 0;
    cursor: pointer;
}
.theme-option input {
    position: absolute;
    opacity: 0;
}
.theme-option span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--vy-border);
    border-radius: 30px;
}
.theme-option input:checked + span {
    border-color: var(--vy-gold);
    background: var(--vy-gold-soft);
    color: var(--vy-gold);
    font-weight: 600;
}
.theme-option input:focus-visible + span {
    outline: 2px solid var(--vy-gold);
    outline-offset: 2px;
}

/* One-time credentials */
.credential-box code {
    font-size: 16px;
    user-select: all;
    color: var(--vy-gold);
}

/* Toasts */
#toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    max-width: 360px;
}
#toasts .alert {
    box-shadow: var(--vy-shadow);
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------------------
   Sign-in & error pages
   --------------------------------------------------------------------------- */
.authentication .logo-container img {
    width: 64px;
    height: auto;
}
.authentication .error-code {
    font-size: 56px;
    font-weight: 600;
    color: var(--vy-gold);
}
.authentication .error-message {
    color: rgba(255, 255, 255, 0.85);
}
.authentication .alert {
    text-align: left;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .theme-toggle .theme-icon-light {
        display: inline-block;
    }
    html[data-theme="system"] .theme-toggle .theme-icon-dark {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
   Fixes: the template was built on Bootstrap 4.1; these keep it right on 4.6
   --------------------------------------------------------------------------- */

/* Bootstrap 4.4+ gives .table a fixed dark text colour; the template expects it to inherit */
.table {
    color: inherit;
}

/* Sign-out is a form button (POST + CSRF); make it sit like the other top-bar icons */
.navbar-nav > li > form > .btn-link-plain {
    padding: 0 15px;
    line-height: 65px;
    color: var(--vy-nav-link);
}
.navbar-nav > li > form > .btn-link-plain:hover {
    color: var(--vy-gold);
}
.sidebar .user-info .image {
    margin-top: 14px;
}

/* Modals: dark surface in the dark theme (the template leaves Bootstrap's white) */
.modal-content {
    background-color: var(--vy-modal-bg);
    color: var(--vy-modal-text);
}
.modal-content .modal-header .title,
.modal-content label {
    color: var(--vy-modal-text);
}
.modal-content .close {
    color: var(--vy-modal-text);
    text-shadow: none;
    opacity: 0.7;
}
.modal-content .nav-tabs .nav-link {
    padding: 6px 14px;
}

/* Sign-in fields: icon inside the pill-shaped input */
.icon-field {
    position: relative;
    margin-bottom: 14px;
}
.icon-field .form-control {
    height: 46px;
    padding: 0 46px 0 20px;
    font-size: 14px;
}
.icon-field i {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--vy-auth-muted);
    pointer-events: none;
}
.icon-field .form-control:focus + i {
    color: var(--vy-gold);
}

/* Sign-in / error card follows the theme */
.authentication .card-plain {
    background: var(--vy-auth-card);
    color: var(--vy-auth-text);
}
.authentication .card-plain .header h5,
.authentication .card-plain .error-message {
    color: var(--vy-auth-text);
}
.authentication .card-plain .form .form-control {
    color: var(--vy-auth-text);
    border-color: var(--vy-auth-border);
}
.authentication .card-plain .form .form-control::placeholder {
    color: var(--vy-auth-muted);
    opacity: 1;
}
.authentication .card-plain .form .form-control:focus {
    border-color: var(--vy-gold);
}
.authentication .footer .copyright {
    color: rgba(255, 255, 255, 0.65);
}
