
/* ---------- COLORS ---------- */
:root {
    --primary: #030637;
    --secondary: #bd08ff;
    --accent: #f1a804;
    --light: #dddddd;
    --success: #91ff00;
    --transparent: rgba(221,221,221,0);

    --log-ERROR: #77052b;
    --log-WARNING: #913b01;
    --log-ALERT: #38086e;
    --log-INFO: #3182ce;
    --log-DEBUG: #102836;
    --log-UNIT: #03373785;
    --log-default-color: #4242426c;

    --light-accent: rgba(38,59,71,0.3);
    --bg: #dddddd;
    --big-bg: linear-gradient(130deg, var(--light), rgba(255,255,255,0.7));
    --content-bg: #ffffff;
    --text: #222;
    --surface: #f2f2f2;
    --antique: rgba(38,59,71,0.5);
    --light-antique: rgba(64, 84, 95, 0.5);
    --highlight: rgba(3,6,55,0.5);
    --link-highlight: rgba(0, 49, 44, 0.7);
    --outset: rgba(109, 62, 0, 0.5);
    --info-color: rgba(2, 73, 66, 0.7);
    --info-shadow: rgba(3,255,230,0.1);
    --debug-color: rgba(17, 46, 63, 0.8);
    --debug-shadow: rgba(38,59,71,0.1);
    --warning-color: rgba(34, 20, 1, 0.6);
    --warning-shadow: rgba(255,145,3,0.2);
    --alert-color: rgba(68, 68, 2, 0.8);
    --alert-shadow: rgba(246,247,117,0.2);
    --error-color: rgba(102, 2, 2, 0.7);
    --error-shadow: rgba(255,8,8,0.1);
    --grad-error: linear-gradient(130deg, rgba(236,80,40,0.6), rgba(224,93,32,0.3));
    --grad-warning: linear-gradient(130deg, rgba(236,144,40,0.6), rgba(202,146,42,0.3));
    --grad-ready: linear-gradient(130deg, rgba(29,141,1,0.6), rgba(53,184,140,0.3));
    --grad-deny: linear-gradient(130deg, rgba(122,0,30,0.6), rgba(180,62,7,0.3));
    --tint: linear-gradient(130deg, rgba(150,150,150,0.7), rgba(221,221,221,0.7));
    --nav-bg: linear-gradient(130deg, rgba(0,0,0,0.3), var(--light));
    --p-bg: linear-gradient(130deg, rgba(255,8,8,0.2), rgba(0,0,0,0));
    --q-bg: linear-gradient(130deg, rgba(0,0,0,0.3), rgba(0,0,0,0));
    --r-bg: linear-gradient(130deg, rgba(255,8,8,0.6), rgba(255,8,8,0.3));
    --s-bg: linear-gradient(130deg, #cfcfcf, #ffffff);
    --t-bg: linear-gradient(130deg, rgba(189,8,255,0.6), rgba(189,8,255,0.3));
    --t-bg-x: linear-gradient(130deg, rgba(189,8,255,0.4), rgba(189,8,255,0.1));
    --u-bg: linear-gradient(130deg, rgba(255,145,3,0.6), rgba(255,145,3,0.3));
    --v-bg: linear-gradient(130deg, rgba(150,150,150,0.4), rgba(150,150,150,0.1));
    --w-bg: linear-gradient(130deg, var(--light), white);
    --x-bg: linear-gradient(130deg, rgba(0,0,0,0.3), var(--light));
    --y-bg: linear-gradient(130deg, var(--light), rgba(0,0,0,0.3));
    --z-bg: linear-gradient(130deg, var(--light), rgba(255,255,255,0.8));
    --grad-success: linear-gradient(130deg, #b7f764, #7ba83f);
    --grad-blue: linear-gradient(130deg, #b3cddb, #6b93aa);
}

.dark {
    --light-accent: rgba(221,221,221,0.3);
    --bg: #030637;
    --big-bg: linear-gradient(130deg, var(--primary), rgb(0,0,0));
    --content-bg: #40434e;
    --text: #dddddd;
    --surface: rgba(255,255,255,0.03);
    --antique: rgba(150,150,150,0.5);
    --light-antique: rgba(175, 175, 175, 0.5);
    --highlight: rgba(189,8,255,0.5);
    --link-highlight: rgba(3,255,230,0.7);
    --outset: rgba(255,145,3,0.5);
    --info-color: rgba(3,255,230,0.7);
    --info-shadow: rgba(3,255,230,0.1);
    --debug-color: rgba(38,59,71,0.8);
    --debug-shadow: rgba(38,59,71,0.1);
    --warning-color: rgba(255,145,3,0.7);
    --warning-shadow: rgba(255,145,3,0.1);
    --alert-color: rgba(246,247,117,0.7);
    --alert-shadow: rgba(246,247,117,0.1);
    --error-color: rgba(255, 87, 87, 0.7);
    --error-shadow: rgba(255,8,8,0.1);
    --grad-error: linear-gradient(130deg, rgba(236,80,40,0.6), rgba(224,93,32,0.3));
    --grad-warning: linear-gradient(130deg, rgba(236,144,40,0.6), rgba(202,146,42,0.3));
    --grad-ready: linear-gradient(130deg, rgba(29,141,1,0.6), rgba(53,184,140,0.3));
    --grad-deny: linear-gradient(130deg, rgba(255,0,64,0.6), rgba(255,115,0,0.5));
    --tint: linear-gradient(130deg, rgba(60,104,225,0.7), rgba(38,59,71,0.7));
    --nav-bg: linear-gradient(130deg, rgba(0,0,0,0.7), var(--primary));
    --p-bg: linear-gradient(130deg, rgba(255,8,8,0.2), rgba(255,8,8,0.1));
    --q-bg: linear-gradient(130deg, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    --r-bg: linear-gradient(130deg, rgba(255,8,8,0.3), rgba(255,8,8,0.1));
    --s-bg: linear-gradient(130deg, #25283d, #40434e);
    --t-bg: linear-gradient(130deg, rgba(189,8,255,0.3), rgba(189,8,255,0.1));
    --t-bg-x: linear-gradient(130deg, rgba(189,8,255,0.1), rgba(189,8,255,0));
    --u-bg: linear-gradient(130deg, rgba(255,145,3,0.3), rgba(255,145,3,0.1));
    --v-bg: linear-gradient(130deg, rgba(3,255,230,0.3), rgba(3,255,230,0.1));
    --w-bg: linear-gradient(130deg, var(--primary), rgba(0,0,0,0.8));
    --x-bg: linear-gradient(130deg, rgba(0,0,0,0.7), var(--primary));
    --y-bg: linear-gradient(130deg, rgba(0,0,0,0.7), #263b47);
    --z-bg: linear-gradient(130deg, rgba(60,104,225,0.3), var(--primary));
    --grad-success: linear-gradient(130deg, #3f6e00, #254100);
    --grad-blue: linear-gradient(130deg, #516977, #263b47);
}

body {
    margin: 0;
    padding: 0;
    background: var(--big-bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.no-scroll {
    overflow: hidden;
}

#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #6e40c9;
    z-index: 300;
    transition: width 0.3s ease-out, opacity 0.4s ease;
}

#pageLoader.loading {
    opacity: 1;
}

#pageLoader.done {
    opacity: 0;
}

/* General pulsating ring animation using scale */
.pulse-ring {
  transform-origin: center;
  animation: pulse 3s infinite ease-in-out;
}

/* Different durations and delays for dramatic effect */
.ring1 { animation-duration: 3s; animation-delay: 0s; }
.ring2 { animation-duration: 4s; animation-delay: 0.5s; }
.ring3 { animation-duration: 2.5s; animation-delay: 0.8s; }
.ring4 { animation-duration: 5s; animation-delay: 0.2s; }

/* Pulse keyframes using transform scale */
@keyframes pulse {
  0% { transform: scale(1); stroke-opacity: 0.6; }
  50% { transform: scale(1.3); stroke-opacity: 0.3; }
  100% { transform: scale(1); stroke-opacity: 0.6; }
}

hr {
    border-top: 2px solid var(--accent);
    margin: 0 auto 20px auto;
}

nav {
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 5px;
    display: flex;
    justify-content: space-between;
    align-items: right;
    z-index: 140;
}

.body-content {
    margin-bottom: 50px;
}

.dashboard-body {
    margin-bottom: 50px;
    padding: 10px;
}

.footer-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--x-bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 5px;
    display: flex;
    justify-content: space-between;
    align-items: right;
    z-index: 140;
}

/* Left and Right Containers */
.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-center {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

#lightbox-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 500;
    backdrop-filter: blur(10px);
    background: var(--x-bg);
    opacity: 0;
    transition: opacity .35s ease;
}

#lightbox-overlay.show {
    display: flex;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text);
    font-size: 40px;
    cursor: pointer;
    transition: opacity .2s ease;
}

.lightbox-close:hover {
    opacity: .6;
}

/* Fade + zoom animation */
#lightbox-image {
    max-width: 90vw;
    max-height: 70vh;
    border-radius: 10px;

    opacity: 0;
    transform: scale(0.95);
    transition: transform .35s ease, opacity .35s ease;
}

#lightbox-overlay.show #lightbox-image {
    opacity: 1;
    transform: scale(1);
}

#lightbox-caption {
    color: var(--text);
    margin-top: 15px;
    text-align: center;
    font-size: 1rem;
    max-width: 80vw;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.2);
    border: none;
    color: rgba(223, 223, 223, 0.3);
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 20;
    transition: background .2s ease;
}

/* Positions */
.lightbox-prev {
    left: 10px;
}
.lightbox-next {
    right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        display: none;
    }
}

/* Thumbnails wrapper */
#lightbox-thumbs-wrapper {
    width: 90vw;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Thumbnails container */
#lightbox-thumbs {
    overflow-x: auto;
    white-space: nowrap;

    display: flex;
    gap: 10px;
    padding: 10px;
    scroll-behavior: smooth;

    max-width: 80vw;
}

/* Single thumbnail */
.lightbox-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity .2s, transform .2s;
}

/* Active thumbnail highlight */
.lightbox-thumb.active {
    opacity: 1;
    outline: 2px solid var(--dark);
    transform: scale(1.1);
}

#lightbox-thumbs::-webkit-scrollbar {
    height: 8px;
}

#lightbox-thumbs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
}

#lightbox-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 5px;
}

#lightbox-thumbs {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) rgba(255,255,255,0.15);
}

.icon-btn {
    border-radius: 5px;
    position: relative;
    font-size: 22px;
    align-items: center;
    padding: 5px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: center;
    gap: 5px;
    border-radius: 5px;
    background: var(--bg);
    z-index: 1;
    transition: transform 0.2s ease, background 0.25s ease;
}

.admin-icon-btn {
    background: var(--info-shadow);
    color: var(--link-highlight);
}

.icon-btn span {
    font-size: 15px;
    margin: 0 5px;
}

/* Gradient border wrapper */
.icon-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: var(--tint);
    -webkit-mask:
        linear-gradient(#dddddd 0 0) content-box,
        linear-gradient(#dddddd 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

.icon-btn:hover {
    background: var(--tint);
}

.theme-toggler {
    position: fixed;
    right: 10px;
    top: 10px;
    width: 35px;
    height: 35px;
    border: solid var(--transparent) 1px;
}

.info-block {
    margin: 5px 0;
    color: var(--alert-color);
}

.success-block {
    margin: 5px 0;
    color: var(--info-color);
}

.warning-block {
    margin: 5px 0;
    color: var(--warning-color);
}

.error-block {
    padding: 5px 10px;
    margin: 5px 0 20px 0;
    color: var(--error-color);
    background: var(--error-shadow);
    border-radius: 5px;
}

.hamburger-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: var(--w-bg);
    backdrop-filter: blur(8px);
    box-shadow: 5px 0 25px rgba(0,0,0,0.25);
    padding: 10px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.hamburger-menu.open {
    transform: translateX(0);
}

.hamburger-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hamburger-menu li {
    margin-bottom: 5px;
}

.hamburger-menu a {
    display: block;
    padding: 10px;
    border-radius: 5px;
    color: inherit;
    text-decoration: none;
}

.hamburger-menu a:hover {
    background: rgba(255,255,255,0.08);
}

.resource-link {
  text-decoration: none;
  color: var(--info-color);
}

.resource-link:hover {
  color: var(--highlight)
}

.envt-link, .more-dropdown .widget-link, .hamburger-menu .envt-link {
    display: block;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.admin-link {
    color: var(--link-highlight);
}

.envt-link:hover,
.more-dropdown .widget-link:hover{
    background: var(--tint);
    color: var(--light-antique);
}

.widgets-row {
    position: fixed;
    top: 44px;
    left: 0;
    width: 100%;
    height: 45px;
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    padding: 0;
    background: var(--z-bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 160;
}

.widgets-row-placeholder {
    height: 50px;
}

.widget {
    position: relative;
    background: transparent;
    border-radius: 0;
    padding: 5px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    transition: color 0.2s ease;
    text-align: center;
}

.widget:hover {
    color: var(--primary);
}

/* Active tab underline */
.widget.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--highlight);
    border-radius: 2px 2px 0 0;
}

.widget-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text);
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.widget-link i {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.widget-link span {
    font-size: 15px;
}

.widget-link:hover {
    background: var(--tint);
    color: var(--light-antique);
}

.more-menu {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    background: var(--bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 260;
}

.more-menu:hover {
    background: var(--tint);
    color: var(--text);
}

.more-menu i {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.more-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    border-top: solid var(--highlight) 1px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    background: var(--w-bg);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    flex-direction: column;
    min-width: 250px;
    padding: 10px 10px 5px 10px;
    z-index: 240;
}

.more-menu.active .more-dropdown {
    display: flex;
}

/* ---------- PAGE LAYOUT ---------- */
.page {
    flex: 1;
    display: flex;
    height: calc(100vh - 60px);
}

.left,
.right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* LEFT PANEL (IMAGE) */
.left {
    background: var(--x-bg);
    padding: 30px;
}

.left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* RIGHT PANEL (FORM) */
.right {
    padding: 10px;
}

.form-box {
    width: 100%;
    max-width: 450px;
    background: var(--surface);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0px 5px 25px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.form-box h1 {
    margin-top: 0;
    font-weight: 500;
    text-align: center;
}

/* Inputs */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 5px 10px;
    font-size: 15px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #dddddd;
    outline: none;
}

input[type="file"] {
    padding: 5px;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    padding: 5px 10px;
    background: var(--tint);
    border-radius: 3px;
    border: none;
    color: var(--text);
    margin-right: 10px;
}

.user-btn-success, .user-btn-blue {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    background: var(--grad-blue);
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

.user-btn-success {
    background: var(--grad-success);
}

button:hover,
.user-btn-success:hover,
.user-btn-blue:hover {
    background: var(--y-bg);
}

/* Responsive */
@media (max-width: 992px) {
    .page {
        flex-direction: column;
        height: auto;
    }

    .left {
        padding: 20px;
    }

    .left img {
        width: 60%;
    }
}

.off-canvas {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--x-bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 320;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

/* Show off-canvas */
.off-canvas.active {
    right: 0;
}

/* Off-canvas header */
.off-canvas-header, .activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.off-canvas-heading, .activity-heading {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.off-canvas-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* Close button */
.off-canvas-close, .close-activity {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Backdrop */
.off-canvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.off-canvas-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Error Pages */
.error-card {
    position: absolute;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.error-title {
    color: var(--outset);
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.error-title::after {
    content: "";
    position: absolute;
    left: 50%; 
    bottom: 0;
    transform: translateX(-50%);
    width: 200%;
    height: 2px;
    background: var(--secondary);
    border-radius: 3px;
    opacity: 0.8;
}

.error-meta {
    color: var(--antique);
    margin-top: 10px;
}

/* Register */
/* ---- Header Row ---- */
.register-header,
.log-search-container {
    background: var(--v-bg);
    backdrop-filter: blur(5px);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    border-radius: 10px;
}

.header-search {
    flex: 1;
    min-width: 180px;
}

.header-search input,
.log-search-container input,
.account-form input,
.form-field {
    padding: 5px 10px;
    font-size: 15px;
    border-radius: 5px;
    color: var(--text);
    border: solid var(--light-accent) 1px;
    background: var(--transparent);
}

.log-search-container input,
.account-form input,
.form-field {
    width: 100%;
}


.header-search input:active,
.header-search input:focus,
.log-search-container input:active,
.log-search-container input:focus,
.account-form input:active,
.account-form input:focus,
.form-field:focus {
    background: var(--transparent);
    color: var(--text);
    outline: none;
    border-color: var(--light-accent);
}

.header-search input::placeholder,
.log-search-container input::placeholder,
.account-form input::placeholder,
.form-field::placeholder {
    color: var(--antique) !important;
    opacity: 0.7;
}

select.form-field option {
    background-color: var(--bg);
    color: var(--text);
} 

input[type="color"].form-field {
    padding: 5px;
    height: 35px;
}

.field-label {
    font-size: 14px;
    color: var(--text);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-buttons button {
    white-space: nowrap;
}


.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}

.record-card,
.important-card,
.form-card {
    background: var(--s-bg);
    border-radius: 5px;
    padding: 10px;
    border: solid var(--bg) 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transition: 0.2s ease;
}

.form-card {
    background: var(--surface);
    border: solid var(--info-shadow) 1px;
}

.description-card {
    border-radius: 10px;
    padding: 10px;
    border: solid var(--bg) 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transition: 0.2s ease;

    /* Layered gradients using the existing variables */
    background:
        var(--r-bg),
        var(--z-bg),
        var(--y-bg);
    background-size: 400% 400%;
    background-repeat: no-repeat;
    animation: violentGradient 5s linear infinite;
}

@keyframes violentGradient {
    0%   { background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%; }
    25%  { background-position: 100% 50%, 0% 50%, 100% 0%, 0% 100%; }
    50%  { background-position: 50% 100%, 50% 0%, 0% 50%, 100% 0%; }
    75%  { background-position: 0% 50%, 100% 50%, 50% 100%, 0% 0%; }
    100% { background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%; }
}

.description-card p {
    margin: 5px 0;
    color: var(--text);
    line-height: 1.5;
}

.account-form {
    height: 100%;
}

.account-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.account-full-image {
    width: 100%;
    height: auto;
    max-height: 237px;
    object-fit: cover;
    border-radius: 5px;
}

.account-floating-action {
    position: absolute;
    bottom: 0;
    right: 0;
}

.important-card {
    background: var(--p-bg);
    border: solid var(--error-shadow) 1px;
}

.record-card:hover,
.form-card:hover,
.important-card:hover {
    background: var(--v-bg);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.important-card:hover .important {
    color: var(--info-color);
}

.content-card {
    border-radius: 15px;
}

.content-card h6 {
    color: var(--info-color);
}

.content-card .important {
    color: var(--error-color);
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--v-bg);
    color: var(--text);
    font-size: 20px;
    font-weight: bold;
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.name-section {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 35px;
}

.name-section span {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.2;
    display: block;
    word-break: break-word;
}

.info-label {
    font-size: 15px;
    color: var(--light-antique);
}

.info-value {
    font-size: 15px;
    color: var(--text);
    padding: 2px 0;
    font-weight: 400;
}

.info-value.bordered {
    border-bottom: 1px solid var(--antique);
    padding-bottom: 5px;
}

.divider {
    border: none;
    height: 1px;
    background: var(--antique);
    margin: 5px 0;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.act-btn-snap,
.act-btn-archive,
.act-btn-view,
.act-btn-delete {
    background: var(--v-bg);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
}

.act-btn-snap {
    background: var(--t-bg);
}

.act-btn-archive {
    background: var(--u-bg);
}

.act-btn-view {
    background: var(--v-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.act-btn-view i {
    font-size: 20px;
}

.act-btn-view span {
    margin-left: 5px;
}

.act-btn-delete {
    background: var(--r-bg);
}

.action-orange {
    background: var(--u-bg);
}

.action-green {
    background: var(--grad-success);
}

.action-red {
    background: var(--r-bg);
}

.action-blue {
    background: var(--grad-blue);
}

.action-ready {
    background: var(--grad-ready);
}

.action-link {
    background: var(--tint);
}

.action-error {
    background: var(--grad-error);
}

.action-warning {
    background: var(--grad-warning);
}

.action-deny {
    background: var(--grad-deny);
}

.act-status-view {
    display: flex;
    height: 33px;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 5px;
    border-radius: 5px;
    color: var(--text);
    font-size: 22px;
}

.act-label-view {
    display: inline-flex;
    height: 33px;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--text);
    background: var(--info-shadow);
}

.pagination-container {
    border-top: solid var(--antique) 1px;
    padding-top: 10px;
}
.pagination {
    display: flex;
    gap: 5px;
    padding: 0;
}

.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    min-width: 35px;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--tint);
    border: 1px solid var(--light-accent);
    border-radius: 5px;
    text-decoration: none;
    transition: 0.2s ease;
}

.page-link:hover {
    background: rgba(189,8,255,0.1);
    border-color: var(--light-accent);
}

.no-action, .no-action:hover {
    color: rgba(0,0,0,0);
    cursor: default;
}

.page-item.active .page-link {
    background: var(--v-bg);
    color: var(--text);
    border-color: var(--v-bg);
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    padding: 5px 5px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .pagination {
        gap: 3px;
    }

    .page-link {
        min-width: 28px;
        padding: 5px 10px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    /* hide some middle numbers if too small */
    .page-item:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }
}

/* INTEGRATIONS */
/* DASHBOARD WRAPPER */
.dashboard-wrapper {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* When activity panel opens */
.dashboard-wrapper.activity-open {
    flex-wrap: nowrap; /* keep left + right columns in one row */
}

.cards-area {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1 1 100%;
}

/* Standard cards: 3 per row */
.cards-area .record-card {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 250px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

/* Stacked cards - inside left column */
.dashboard-wrapper.activity-open .cards-area.stacked-cards {
    flex-direction: column;
    flex: 0 0 35%;
    max-width: 35%;
}

.activity-column {
    width: 64%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 110px;
    right: 0;
    height: calc(100vh - 110px);
    z-index: 180;
    background: var(--x-bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border-radius: 0;
    border-top-left-radius: 15px;
    transition: right 0.3s ease-in-out;

}

.activity-wrapper,
#activityContent  {
    flex: 1;
    background: var(--big-bg);
    border-top-left-radius: 5px;
    padding: 5px;
    padding-bottom: 1rem;
    height: 100%;
    min-height: 500px;
    position: relative;
    overflow-y: auto;
}

.activity-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.activity-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--transparent);
    flex-shrink: 0;
    border-bottom: 1px solid #cccccc27;
    padding: 5px;
}

.activity-content {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.activity-content::-webkit-scrollbar {
    width: 10px;
}

.activity-content::-webkit-scrollbar-track {
    background: rgba(221,221,221,0);
    border-radius: 0;
}

.activity-content::-webkit-scrollbar-thumb {
    background-color: var(--antique);
    border-radius: 5px;
    border: 2px solid rgba(0,0,0,0);
}

.activity-content::-webkit-scrollbar-thumb:hover {
    background-color: darken(var(--antique), 10%);
}

@media (max-width: 992px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .cards-area.stacked-cards {
        flex: 1 1 100%;
    }

    .activity-column {
        position: fixed;
        top: 0;
        left: 0;
        right: 10px;
        width: 100vw;
        height: 100vh;
        z-index: 340;
        padding: 10px;
    }

    .activity-wrapper {
        height: auto;
        min-height: auto;
        border-radius: 10px;
    }
}


.logs-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--x-bg);
    border-radius: 5px;
    overflow: hidden;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.logs-title {
    font-weight: bold;
}

.logs-meta {
    opacity: 0.7;
}

.logs-list {
    flex: 1;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.logs-list::-webkit-scrollbar {
    width: 5px;
}

.logs-list::-webkit-scrollbar-track {
    background: transparent;
}

.logs-list::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.logs-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.log-row {
    display: grid;
    grid-template-columns: 150px 80px 120px 1fr;
    gap: 5px;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    align-items: center;
}

.log-row:hover {
    background: rgba(255,255,255,0.04);
}

.log-ts {
    opacity: 0.75;
}

.log-source {
    opacity: 0.85;
}

.log-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ERROR {
    color: var(--error-color);
    background: linear-gradient(130deg, var(--error-shadow), transparent);
    padding: 2px 5px;
    border-radius: 2px;
}

.ALERT {
    color: var(--alert-color);
    background: linear-gradient(130deg, var(--alert-shadow), transparent);
    padding: 2px 5px;
    border-radius: 2px;
}

.WARNING {
    color: var(--warning-color);
    background: linear-gradient(130deg, var(--warning-shadow), transparent);
    padding: 2px 5px;
    border-radius: 2px;
}

.INFO {
    color: var(--info-color);
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    padding: 2px 5px;
    border-radius: 2px;
}

.DEBUG {
    color: var(--antique);
    background: linear-gradient(130deg, var(--debug-shadow), transparent);
    padding: 2px 5px;
    border-radius: 2px;
}

.UNIT {
    color: var(--text);
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    padding: 2px 5px;
    border-radius: 2px;
}

.config-panel {
    position: fixed;
    top: 110px;
    height: calc(100vh - 110px);
    background: var(--x-bg);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border-top-left-radius: 15px;
    overflow: hidden;
}

.config-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 10px 10px 50px 10px;
    margin: 0;
}

.config-scroll::-webkit-scrollbar {
    width: 10px;
}

.config-scroll::-webkit-scrollbar-track {
    background: rgba(221, 221, 221, 0.3);
    border-radius: 5px;
}

.config-scroll::-webkit-scrollbar-thumb {
    background-color: var(--antique);
    border-radius: 5px;
    border: 2px solid rgba(0,0,0,0);
}

.config-scroll::-webkit-scrollbar-thumb:hover {
    background-color: var(--antique-dark, #444);
}

@media (max-width: 991px) {

    .config-panel {
        position: fixed;
        right: -100%;
        top: 110px;
        width: 100%;
        height: calc(100vh - 110px);
        z-index: 180;
        background: var(--x-bg);
        backdrop-filter: blur(5px);
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        border-radius: 0;
        border-top-left-radius: 15px;
        transition: right 0.3s ease-in-out;
    }

    .config-panel.show,
    .activity-column.show {
        right: 0;
    }

    .config-fab {
        position: fixed;
        right: 0;
        top: 50%;
        z-index: 260;
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .config-scroll {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .config-scroll::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }
}

.record-item-card {
    background: var(--z-bg);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.resolve-block, .list-block, .list-btns-block {
    display: flex;               
    align-items: center;
    justify-content: space-between; 
    background-color: var(--error-shadow);   
    border: solid 1px var(--error-color);   
    border-radius: 5px;
    padding: 5px;
    color: var(--error-color);              
    gap: 5px;    
    margin-bottom: 5px;               
}

.list-block {
    background: linear-gradient(130deg, var(--info-shadow), var(--debug-shadow));  
    border: none;  
    padding: 5px; 
}

.list-btns-block {
    background: transparent;  
    border: none;  
    padding: 0; 
}

.list-block:hover {
    background: linear-gradient(130deg, var(--debug-color), var(--debug-shadow)); 
}

.list-block .list-body {
    flex-grow: 1; 
    display: flex;
    align-items: center; 
    color: var(--link-highlight);  
    flex-shrink: 1;
    min-width: 0;
}

.list-body i {
    font-size: 20px;
    color: var(--error-color);
}

.list-body.name-indicator {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0; 
    padding-left: 5px;
}

.indicator-badge {
    color: var(--text);
    font-size: 15px;
    background: linear-gradient(130deg, transparent, var(--warning-shadow));
    height: 30px;
    margin-right: 5px;
    padding: 5px 10px;
    border-radius: 2px;
    border: inset var(--antique) 1px;
}

.list-details {
    display: flex;
    flex-grow: 1;
    gap: 5;
}

.text-block {
    flex-grow: 1; 
    display: flex;
    align-items: center; 
    color: var(--text);  
    margin: 0 0 5px 5px;        
}

.text-block i {
    font-size: 20px;
}

.text-block-title {
    flex-grow: 1; 
    display: flex;
    align-items: center; 
    font-weight: bold;
    background: var(--info-shadow);
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.id-span {
    background: var(--t-bg);
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 5px;
    margin-left: -5px;
}

.resolve-block .message {
    flex-grow: 1; 
    margin-left: 5px;               
}

.resolve-block .resolve-btn {
    background: var(--u-bg);  
    color: var(--text);
    border: none;
    padding: 5px 10px;
    border: solid var(--error-shadow) 1px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
}

.resolve-block .resolve-btn:hover {
    background: var(--z-bg);
    border: solid var(--antique) 1px;
}

.resolve-feed {
    height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    border: solid var(--antique) 1px;
    border-radius: 5px;
    margin: 10px 0;
    background: var(--surface);
    font-size: 15px;
    scroll-behavior: smooth;

    scrollbar-width: thin;
    scrollbar-color: #888 rgba(255,255,255,0.2);
}

.resolve-feed ::-webkit-scrollbar {
    width: 10px;
}

.resolve-feed ::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.resolve-feed ::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
}

.resolve-feed ::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

.resolve-feed-title {
    background: var(--tint);
    color: var(--alert-color);
    padding: 0px 5px;
    margin: 0 0 5px 0;
    border-left: solid var(--alert-color) 2px;
    font-weight: bold;
}

.resolve-feed-line {
    background: linear-gradient(130deg, var(--alert-shadow), transparent);
    color: var(--text);
    font-family: monospace;
    font-size: 14px;
    padding: 0px 5px;
    margin: 0 0 3px 0;
    border-left: solid var(--warning-color) 2px;
}

.resolve-feed-line:hover {
    background: var(--u-bg);
}

.config-title {
    background: linear-gradient(130deg, var(--alert-shadow), transparent);
    color: var(--text);
    font-weight: bold;
    border-radius: 5px;
    padding: 5px 10px;
    margin: 0 0 5px 0;
}

.config-section-title {
    background: var(--bg);
    border-radius: 2px;
    color: var(--text);
    padding: 5px 10px;
    margin: 0 0 5px 0;
}

.config-card {
    background: var(--z-bg);
    padding: 10px 10px 5px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.config-form-card {
    background: var(--x-bg);
    border: solid var(--surface) 1px;
    padding: 10px 10px 5px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.no-config {
    color: var(--antique);
}

.config-node {
    position: relative;
    align-items: center;
    padding: 5px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: left;
    gap: 5px;
    border-radius: 2px;
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    margin-bottom: 5px;
    z-index: 1;
    transition: transform 0.2s ease, background 0.25s ease;
}


.config-node-btn {
    background: var(--error-shadow);
    color: var(--error-color);
    padding: 5px;
    width: 30px;
    height: 30px;
    border: inset var(--error-color) 1px;
    border-radius: 2px;
}

.config-node-btn:hover {
    background: var(--error-color);
    color: var(--text);
    padding: 5px;
    border: solid var(--error-color) 1px;
    border-radius: 2px;
}

.config-node span {
    margin: 0 5px;
}

.config-node span.indicator-badge {
    margin: 0;
}

.config-node .index-label {
    margin: 0;
    color: var(--light-antique);
    background: var(--tint);
    padding: 5px;
    border-radius: 2px;
    border: solid transparent 1px;
}

.config-node:hover {
    background: var(--tint);
}

.config-node:hover .index-label{
    background: var(--info-shadow);
    color: var(--text);
   
    border: solid var(--antique) 1px;
}

@media (max-width: 500px) {
    .props-actions {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
}

.contact-c {
    background: linear-gradient(130deg, var(--alert-shadow), transparent);
    margin: 0 0 5px 0;
    padding: 2px 5px;
    border-radius: 5px;
}

.title-c {
    background: linear-gradient(130deg, var(--error-shadow), transparent);
    margin: 0 0 5px 0;
    padding: 2px 5px;
    border-radius: 5px;
}

.block-c {
    margin: 0;
    font-size: 14px;
}

.block-c-sub {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: var(--warning-color);
}

.view-title {
    background: var(--t-bg-x);
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 5px 0;
}

.view-sub {
    color: var(--light-antique);
    font-weight: bold;
    margin-bottom: 10px;
}

.stats-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stats-row {
    display: flex;
    gap: 5px;
}

.stats-attribute {
    width: 150px;
    background: var(--alert-shadow);
    padding: 5px 10px;
    border-radius: 5px;
    box-sizing: border-box;
}

.stats-value {
    flex: 1;
    background: linear-gradient(130deg, var(--alert-shadow), transparent);
    padding: 5px 10px;
    border-radius: 5px;
    box-sizing: border-box;
}

.config-img {
    width: 100%;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 5px;
}

.ajax-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;  
}

.ajax-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ajax-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3,6,55,0.5);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.ajax-modal-dialog {
    position: relative;
    background: var(--x-bg);
    width: 98vw;
    height: 97vh;
    border-radius: 15px;

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 991px) {
    .ajax-modal-dialog {
        width: 95vw;
        height: 88vh;
        border-radius: 10px;
    }
}

.ajax-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--antique);
}

.ajax-modal-tools {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px 0 10px;
    border-bottom: 1px solid var(--info-shadow);
}

.ajax-modal-body {
    flex: 1;
    padding: 5px 10px;
    overflow: auto;
    overscroll-behavior: contain;
}

.ajax-modal-body::-webkit-scrollbar {
    width: 10px;
}

.ajax-modal-body::-webkit-scrollbar-track {
    background: rgba(221,221,221,0);
}

.ajax-modal-body::-webkit-scrollbar-thumb {
    background-color: var(--antique);
    border-radius: 5px;
    border: 2px solid rgba(0,0,0,0);
}

/* Small screens – hide scrollbar but keep scroll */
@media (max-width: 991px) {
    .ajax-modal-body {
        -ms-overflow-style: none;  /* IE / Edge */
        scrollbar-width: none;     /* Firefox */
    }

    .ajax-modal-body::-webkit-scrollbar {
        display: none;             /* Chrome / Safari */
    }
}

.ajax-modal-close {
    border: none;
}

.code-viewer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    line-height: 1.45;
    border-radius: 5px;
    display: inline-block;
    max-width: none; 
}

.code-table {
    border-collapse: collapse;
    width: max-content;
}

.code-table td {
    vertical-align: middle;
}

.code-line-number {
    width: 1%;
    padding: 0 10px;
    text-align: right;
    color: var(--light-antique);
    background: var(--debug-shadow);
    border-right: 1px solid var(--debug-color);
    user-select: none;
}

.code-line {
    padding: 0;
}

.code-line pre {
    margin: 0;
    padding: 0 12px;
    white-space: pre;
}

.code-table tr:hover {
    background: var(--info-shadow);
}

.js-form .row.align-items-stretch {
    align-items: stretch;
}

.js-form .col-lg-7,
.js-form .col-lg-5 {
    display: flex;
    flex-direction: column;
}

.wysiwyg-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 250px;
}

.wysiwyg-toolbar {
    flex: 0 0 auto;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.wysiwyg-btn {
    border: none;
    padding: 0 5px;
}

.wysiwyg-editor {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--info-shadow);
    border-radius: 5px;
    background-color: var(--debug-shadow);
    margin-bottom: 8px;
}

.wysiwyg-editor:empty:before {
    content: attr(placeholder);
    color: var(--antique);
    pointer-events: none;
    display: block;
}

.image-picker {
    position: relative;
    cursor: pointer;
}

.image-preview {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 5px;
    transition: opacity 0.2s ease-in-out;
}

.image-picker:hover .image-preview {
    opacity: 0.85;
}

.image-preview-card {
    border-radius: 5px;
    background: var(--z-bg);
    padding: 10px;
    margin-bottom: 5px;
}

.image-preview-card .image-preview {
    border-radius: 0;
}

.image-cards, .image-cards-existing {
    background: var(--info-shadow);
    padding: 10px;
    border-radius: 5px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

@media (max-width: 992px) {
    .image-cards, .image-cards-existing {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .image-cards, .image-cards-existing {
        grid-template-columns: repeat(2, 1fr);
    }
}

.image-cards-existing {
    background: var(--z-bg);
}

.image-card {
    position: relative;
    border-radius: 3px;
    overflow: hidden;
    background: #111;
}

.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-card .remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 1px;
    background: rgba(3,6,55,0.7);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, transform 0.1s ease;
}

.image-card .delete-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 1px;
    background: var(--r-bg);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, transform 0.1s ease;
}

.image-card .remove:hover,
.delete-image:hover {
    background: var(--grad-deny);
}

.multi-select-dropdown {
    position: relative;
    border: 1px solid var(--info-shadow);
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}

.multi-select-display {
    padding: 0.5rem;
    min-height: 38px;
}

.multi-select-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--info-shadow);
    border-radius: 5px;
    background: var(--z-bg);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    flex-direction: column;
    padding: 0.25rem;
}

.multi-select-list input[type="text"] {
    margin: 0 0 10px 0;
    width: 100%;
    padding: 5px 10px;
}

.multi-select-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
}

/* Multi-select custom checkboxes */
.multi-select-item {
    display: flex;
    align-items: center;
    position: relative;
    padding: 5px 10px;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.multi-select-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Hide default checkbox */
.multi-select-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create custom checkbox */
.multi-select-item span {
    position: relative;
    padding-left: 25px;
}

/* Checkbox square */
.multi-select-item span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 18px;
    border: 1px solid #007bff;
    border-radius: 3px;
    background-color: #fff;
    transition: all 0.2s;
}

/* Checkmark */
.multi-select-item input:checked + span::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 9px;
    width: 5px;
    height: 10px;
    border: solid #007bff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-50%);
}

/* Small shadow for checkbox */
.multi-select-item span::before {
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}


/* Modal Safety */
.modal .image-preview {
    max-height: 200px;
}

.form-info,
.form-success,
.form-forbidden,
.form-error {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.form-info i,
.form-success i,
.form-forbidden i,
.form-error i {
    font-size: 20px;
    flex-shrink: 0;
}

.form-info {
    background: linear-gradient(130deg, var(--debug-color), transparent);
    color: var(--info-color);
}

.form-success {
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    color: var(--info-color);
}

.form-forbidden {
    background: linear-gradient(130deg, var(--warning-shadow), transparent);
    color: var(--warning-color);
}

.form-error {
    background: linear-gradient(130deg, var(--error-shadow), transparent);
    color: var(--error-color);
}

.form-message {
    padding: 5px 10px;
    border-radius: 5px;
    background: var(--info-shadow);
}

.contact-popup {
    position: fixed;
    bottom: 40px;
    left: 10px;
    padding: 15px;
    border-radius: 30px;
    border-bottom-left-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
}

.contact-popup.active {
    opacity: 1;
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.contact-btn {
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.contact-btn .icon-circle {
    position: relative;
    z-index: 2;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text);
    background:
        var(--w-bg) padding-box,
        linear-gradient(130deg, var(--text), var(--accent)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 10px 20px rgba(3,6,55,0.5);
}

.contact-btn .label {
    position: relative;
    z-index: 1;
    width: calc(100vw - 100px);
    padding: 10px 15px 10px 20px;
    margin-left: -10px;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 20px;
    border: 1px solid transparent;
    background:
        var(--w-bg) padding-box,
        linear-gradient(130deg, var(--accent), var(--transparent)) border-box;
}

.contact-btn:hover {
    background: none;
}

.contact-btn:hover .icon-circle {
    transform: scale(1.05);
}

.contact-btn:hover .label {
    background:
        var(--w-bg) padding-box,
        linear-gradient(130deg, var(--secondary), var(--transparent)) border-box;
}

@media (min-width: 992px) {
    .contact-btn .label {
        width: 350px;
    }
}

.comment-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    padding: 10px;
    border-radius: 5px;
    margin: 5px 0;
}

.comment-range-container {
    display: flex;
    flex: 0 0 300px;
    gap: 0.5rem;
}

.comment-range-container .comment-field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.comment-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 600px) {
    .comment-row {
        flex-direction: column;
    }

    .comment-range-container {
        flex: 1 1 auto;
        gap: 0.5rem;
    }

    .comment-text {
        width: 100%;
    }
}

.teacher-row {
    background: linear-gradient(130deg, var(--info-shadow), transparent);
    padding: 10px;
    border-radius: 5px;
    margin: 5px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.teacher-range-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

.teacher-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.teacher-field:first-child {
    flex: 0 0 150px;
}

.teacher-field.teacher-text,
.teacher-field:nth-child(3) {
    flex: 1 1 auto;
    min-width: 120px;
}

@media (max-width: 500px) {
    .teacher-range-container {
        flex-wrap: wrap;
    }
    .teacher-field:first-child,
    .teacher-field.teacher-text {
        flex: 0 0 auto;
        width: calc(50% - 3px);
    }
    .teacher-field:nth-child(3) {
        flex: 0 0 100%;
    }
}

.form-accordion {
    background: var(--z-bg);
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.form-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    user-select: none;
}

.form-accordion-icon {
    font-size: 22px;
    transition: transform 0.2s ease;
}

.form-accordion-content {
    border-top: 1px solid var(--antique);
    display: none;
}

.form-accordion.open .form-accordion-content {
    display: block;
}

.form-accordion.open .form-accordion-icon {
    transform: rotate(45deg);
}

.class-row {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-bottom: 1px solid var(--antique);
}

.class-row .detailsBtn {
    margin-left: auto;
}

.class-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.class-row:last-child {
    border-bottom: none;
}

.class-row:hover {
    background: rgba(0,0,0,0.03);
}

.record-header {
    display: flex;
    align-items: center;
    gap: 5px;
}

.record-title {
    color: var(--text);
    flex: 1;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-field {
    width: 100px;
    flex-shrink: 0;
}

.filter-text-block {
    display: flex;
    gap: 5px;
    align-items: center;
}

.filter-text-block .filter-input {
    flex: 1;
    min-width: 0;
}

.filter-text-block .items-per-page {
    width: 100px;
}

.heatmap-row {
    display: flex;
    align-items: stretch;
    gap: 10;
    width: 100%;
    background: var(--surface);
    border-radius: 5px;
}

.heatmap-wrapper {
    max-width: 880px;
    flex: 0 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
}

.heatmap-sidepanel {
    flex: 1 1 auto;
    background: var(--surface);
    border-radius: 5px;
    padding: 10px;
    min-width: 0;
    display: flex;
}

.heatmap-container {
    position: relative;
    display: inline-block;
    padding: 10px;
    height: 100%;
}

.heatmap-svg {
    display: block;
}

.heatmap-day {
    cursor: pointer;
}

.heatmap-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15, 15, 15, 0.95);
    color: var(--text);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 15px;
    line-height: 1.4;
    min-width: 120px;
    white-space: nowrap;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.heatmap-tooltip .row {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.heatmap-tooltip .row span:last-child {
    opacity: 0.85;
}

@media (max-width: 500px) {
    .heatmap-sidepanel {
        display: none;
    }

    .heatmap-wrapper {
        max-width: 100%;
    }
}

.heatmap-wrapper {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255,255,255,0.35) transparent;
}

.heatmap-wrapper::-webkit-scrollbar {
    height: 10px;
}

.heatmap-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.heatmap-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.35);
    border-radius: 10px;
}

.heatmap-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.55);
}

.js-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.js-btn-spinner {
    width: 1em;
    height: 1em;
    font-size: 22px;
    border: 2px solid var(--antique);
    border-top-color: var(--text);
    border-radius: 50%;
    display: inline-block;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}