*,
::before,
::after {
    --tw-border-spacing-x: 0;
    --tw-border-spacing-y: 0;
    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
    --tw-pan-x: ;
    --tw-pan-y: ;
    --tw-pinch-zoom: ;
    --tw-scroll-snap-strictness: proximity;
    --tw-gradient-from-position: ;
    --tw-gradient-via-position: ;
    --tw-gradient-to-position: ;
    --tw-ordinal: ;
    --tw-slashed-zero: ;
    --tw-numeric-figure: ;
    --tw-numeric-spacing: ;
    --tw-numeric-fraction: ;
    --tw-ring-inset: ;
    --tw-ring-offset-width: 0px;
    --tw-ring-offset-color: #fff;
    --tw-ring-color: rgb(59 130 246 / 0.5);
    --tw-ring-offset-shadow: 0 0 #0000;
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow: 0 0 #0000;
    --tw-shadow-colored: 0 0 #0000;
    --tw-blur: ;
    --tw-brightness: ;
    --tw-contrast: ;
    --tw-grayscale: ;
    --tw-hue-rotate: ;
    --tw-invert: ;
    --tw-saturate: ;
    --tw-sepia: ;
    --tw-drop-shadow: ;
    --tw-backdrop-blur: ;
    --tw-backdrop-brightness: ;
    --tw-backdrop-contrast: ;
    --tw-backdrop-grayscale: ;
    --tw-backdrop-hue-rotate: ;
    --tw-backdrop-invert: ;
    --tw-backdrop-opacity: ;
    --tw-backdrop-saturate: ;
    --tw-backdrop-sepia: ;
    --tw-contain-size: ;
    --tw-contain-layout: ;
    --tw-contain-paint: ;
    --tw-contain-style:
}

::backdrop {
    --tw-border-spacing-x: 0;
    --tw-border-spacing-y: 0;
    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
    --tw-pan-x: ;
    --tw-pan-y: ;
    --tw-pinch-zoom: ;
    --tw-scroll-snap-strictness: proximity;
    --tw-gradient-from-position: ;
    --tw-gradient-via-position: ;
    --tw-gradient-to-position: ;
    --tw-ordinal: ;
    --tw-slashed-zero: ;
    --tw-numeric-figure: ;
    --tw-numeric-spacing: ;
    --tw-numeric-fraction: ;
    --tw-ring-inset: ;
    --tw-ring-offset-width: 0px;
    --tw-ring-offset-color: #fff;
    --tw-ring-color: rgb(59 130 246 / 0.5);
    --tw-ring-offset-shadow: 0 0 #0000;
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow: 0 0 #0000;
    --tw-shadow-colored: 0 0 #0000;
    --tw-blur: ;
    --tw-brightness: ;
    --tw-contrast: ;
    --tw-grayscale: ;
    --tw-hue-rotate: ;
    --tw-invert: ;
    --tw-saturate: ;
    --tw-sepia: ;
    --tw-drop-shadow: ;
    --tw-backdrop-blur: ;
    --tw-backdrop-brightness: ;
    --tw-backdrop-contrast: ;
    --tw-backdrop-grayscale: ;
    --tw-backdrop-hue-rotate: ;
    --tw-backdrop-invert: ;
    --tw-backdrop-opacity: ;
    --tw-backdrop-saturate: ;
    --tw-backdrop-sepia: ;
    --tw-contain-size: ;
    --tw-contain-layout: ;
    --tw-contain-paint: ;
    --tw-contain-style:
}

*,
::after,
::before {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb
}

::after,
::before {
    --tw-content: ''
}

:host,
html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-feature-settings: normal;
    font-variation-settings: normal;
    -webkit-tap-highlight-color: transparent
}

body {
    margin: 0;
    line-height: inherit
}

hr {
    height: 0;
    color: inherit;
    border-top-width: 1px
}

abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: inherit
}

b,
strong {
    font-weight: bolder
}

code,
kbd,
pre,
samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-size: 1em
}

small {
    font-size: 80%
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline
}

sub {
    bottom: -.25em
}

sup {
    top: -.5em
}

table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    /* font-size: 100%; */
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
    margin: 0;
    padding: 0
}

button,
select {
    text-transform: none
}

button,
input:where([type=button]),
input:where([type=reset]),
input:where([type=submit]) {
    -webkit-appearance: button;
    background-color: transparent;
    background-image: none
}

:-moz-focusring {
    outline: auto
}

:-moz-ui-invalid {
    box-shadow: none
}

progress {
    vertical-align: baseline
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
    height: auto
}

[type=search] {
    -webkit-appearance: textfield;
    outline-offset: -2px
}

::-webkit-search-decoration {
    -webkit-appearance: none
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit
}

summary {
    display: list-item
}

blockquote,
dd,
dl,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
pre {
    margin: 0
}

fieldset {
    margin: 0;
    padding: 0
}

legend {
    padding: 0
}

menu,
ol,
ul {
    list-style: none;
    margin: 0;
    padding: 0
}

dialog {
    padding: 0
}

textarea {
    resize: vertical
}

input::placeholder,
textarea::placeholder {
    opacity: 1;
    color: #9ca3af
}

[role=button],
button {
    cursor: pointer
}

:disabled {
    cursor: default
}

audio,
canvas,
embed,
iframe,
img,
object,
svg,
video {
    display: block;
}

img,
video {
    max-width: 100%;
    height: auto
}

[hidden]:where(:not([hidden=until-found])) {
    display: none
}

.mr-2 {
    margin-right: 0.5rem
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem
}

.flex {
    display: flex
}

.h-screen {
    height: 100vh
}

.w-64 {
    width: 20rem
}

.w-72 {
    width: 18rem
}

.w-full {
    width: 100%
}

.flex-1 {
    flex: 1 1 0%
}

.flex-col {
    flex-direction: column
}

.items-center {
    align-items: center
}

.justify-between {
    justify-content: space-between
}

.space-x-2> :not([hidden])~ :not([hidden]) {
    --tw-space-x-reverse: 0;
    margin-right: calc(0.5rem * var(--tw-space-x-reverse));
    margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))
}

.space-y-2> :not([hidden])~ :not([hidden]) {
    --tw-space-y-reverse: 0;
    margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(0.5rem * var(--tw-space-y-reverse))
}

.space-y-4> :not([hidden])~ :not([hidden]) {
    --tw-space-y-reverse: 0;
    margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(1rem * var(--tw-space-y-reverse))
}

.rounded {
    border-radius: 0.25rem
}

.rounded-lg {
    border-radius: 0.5rem
}

.bg-blue-500 {
    --tw-bg-opacity: 1;
    background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1))
}

.bg-gray-700 {
    --tw-bg-opacity: 1;
    background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1))
}

.bg-gray-800 {
    --tw-bg-opacity: 1;
    background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1))
}

.bg-gray-900 {
    --tw-bg-opacity: 1;
    background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1))
}

.bg-orange-500 {
    --tw-bg-opacity: 1;
    background-color: rgb(249 115 22 / var(--tw-bg-opacity, 1))
}

.bg-purple-500 {
    --tw-bg-opacity: 1;
    background-color: rgb(168 85 247 / var(--tw-bg-opacity, 1))
}

.bg-transparent {
    background-color: transparent
}

.p-2 {
    padding: 0.5rem;
    margin: 0.2rem 0;
    font-size: 14px;
}

.p-3 {
    padding: 0.75rem
}

.p-4 {
    padding: 1rem
}

.p-6 {
    padding: 1.5rem
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem
}

.font-bold {
    font-weight: 700
}

.text-blue-400 {
    --tw-text-opacity: 1;
    color: rgb(96 165 250 / var(--tw-text-opacity, 1))
}

.text-gray-400 {
    --tw-text-opacity: 1;
    color: rgb(156 163 175 / var(--tw-text-opacity, 1))
}

.text-white {
    --tw-text-opacity: 1;
    color: rgb(255 255 255 / var(--tw-text-opacity, 1))
}

.outline-none {
    outline: 2px solid transparent;
    outline-offset: 2px
}

.hover\:bg-gray-700:hover {
    --tw-bg-opacity: 1;
    background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1))
}

nav button {
    justify-content: left;
    text-align: left;
}

/* Chat Button */

#openChatBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
}

/* Chatbox Container */

.chatbox {
    display: block;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    background: rgb(31 41 55 / var(--tw-bg-opacity, 1));
    border-radius: var(--radius-lg);
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Chat Header */

.chat-header {
    /* background: rgb(31 41 55 / var(--tw-bg-opacity, 1)); */
    /* background: #003366;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;border: 1px solid #111827; */
            display: flex;
    align-items: center;
    gap: 8px;
    background: var(--header-gradient);
    color: #fff;
    font-weight: bold;
    padding: 10px 12px;
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Chat Body */

.chat-body {
    /* height: calc(100vh - 30vh); */
    padding: 5px;
    /* background: rgb(31 41 55 / var(--tw-bg-opacity, 1)); */
    background:#fff;
}

.bot-message {
    background: #e0e0e0;
}

/* Chat Footer */

.chat-footer {
    /* display: flex; */
    /* padding: 8px; */
    background: whitesmoke;
    border-top: 1px solid #ccc;
    /* padding: 10px; */
}

.chat-footer input {
    flex: 1;
    padding: 12px;
    /* border: 1px solid #ccc; */
    border-radius: 5px;
}

/* .chat-footer button {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-left: 5px;
    border-radius: 5px;
    cursor: pointer;
}    */

/* scrollbar */

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    -webkit-border-radius: 10px;
    border-radius: 10px;
  }

::-webkit-scrollbar-thumb {
    -webkit-border-radius: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
  }

::-webkit-scrollbar-thumb:window-inactive {
    background: rgba(255, 255, 255, 0.3);
  }

/*  */

.text-box {
    margin-left: 44vw;
    margin-top: 42vh;
  }

.text-box .btn:link,
  .text-box .btn:visited {
    text-transform: uppercase;
    text-decoration: none;
    padding: 15px 40px;
    display: inline-block;
    border-radius: 100px;
    transition: all 0.2s;
    position: absolute;
  }

.text-box  .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  }

.text-box  .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  }

.text-box .btn-white {
    /* background-color: #fff; */
    color: #777;
  }

.text-box  .btn::after {
    content: "";
    display: inline-block;
    height: 100%;
    width: 100%;
    border-radius: 100px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    transition: all 0.4s;
  }

.text-box  .btn-white::after {
    /* background-color: rgb(194, 149, 59); */
    background-color: var(--themeBgBtnColor);
  }

.btn-animated .fa {
    color: #fff;
  }

.text-box  .btn:hover::after {
    transform: scaleX(1.4) scaleY(1.6);
    opacity: 0;
  }

.text-box  .btn-animated {
    -webkit-animation: moveInBottom 5s ease-out;
            animation: moveInBottom 5s ease-out;
    -webkit-animation-fill-mode: backwards;
            animation-fill-mode: backwards;
  }

@-webkit-keyframes moveInBottom {
    0% {
      opacity: 0;
      transform: translateY(30px);
    }
    100% {
      opacity: 1;
      transform: translateY(0px);
    }
  }

@keyframes moveInBottom {
    0% {
      opacity: 0;
      transform: translateY(30px);
    }
    100% {
      opacity: 1;
      transform: translateY(0px);
    }
  }

.powerIcon {
    width: 30px;
    display: block;
    cursor: pointer;
  }

.powerIcon img{
    width: 100%;
  }

.dflexTxt {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #374151;
    padding-bottom: 15px;
    align-items: center;
    min-height: 50px;
    box-sizing: border-box;
    
  }

:root {
    /* --themeBgColor: #111827; */
    /* 002428*/
    /* --themeBgBtnColor: #C2953B; */
    /*f16920 */
    --themeBgColor: #fff;
    /* 002428*/
    --themeBgBtnColor: #13345F;
    --header-gradient: linear-gradient(90deg, #1A1033 0%, #1E1F6A 100%);
    --button-gradient: linear-gradient(90deg, #0B3A80 0%, #0E4C9B 100%);
    --button-radius:8px

}

@font-face {
    font-family: 'Inter', sans-serif;
    src: url('./ChakraPetch-Bold.ttf');
}

@font-face {
    font-family: 'Inter', sans-serif;
    src: url('./ChakraPetch-Light.ttf');
}

/* Base Styles */

body {
    font-family: 'Inter', sans-serif;
    color: #222;
    background: linear-gradient(135deg, #f9fafc, #f1f6fa, #e9f3f8);
    background-image: linear-gradient(120deg, rgba(213, 235, 251, 0.5) 30%, transparent 0%),
        /*linear-gradient(300deg, rgba(0, 252, 247, 0.15) 15%, transparent 15%),*/
        linear-gradient(300deg, rgba(213, 235, 251, 0.5) 30%, transparent 0%);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overscroll-behavior-y: contain; /* prevents iOS header bounce */

}

.header-wrapper {
    padding-top: 10px;
    /* prevents margin collapse */

}

/* Login page styles */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    background-color: var(--themeBgColor);
    font-family: Arial, sans-serif;
    flex-direction: row;
}

.login-container {

    padding: 2.5rem;
    border-radius: 0;
    width: 100%;
    max-width: 400px;
    border-left: 2px solid #5a5a5a;
    height: auto;
}

.login-container:first-child {
    border: none;
}

.error-message {
    text-align: center;
    color: #fff;
    padding: 10px 15px;
}

/* Header styles */

.header {
    /* background: linear-gradient(135deg, #1A1032, #2B1A4A); */
    background: var(--themeBgColor);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
}

/* Layout */

.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* Prevent wrapper scrolling */
    height: calc(100vh - 72px);
    /* Subtract header height */
}

.main-content {
    flex: 1;
    padding: 0px;
    overflow-y: auto;
    /* Allow vertical scroll only in main content */
    /* background: whitesmoke; */
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    padding: var(--space-4  )

}

/* Chat Sidebar */

.chat-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent sidebar scrolling */
}

.chat-messages {
    padding: 0px;
    overflow-y: auto;
    height: calc(100vh - 12.3rem);
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.chat-input-container {
    display: flex;
    align-items: center;
    /* gap: 8px;
  padding: 10px;
  border-top: 1px solid #ccc; */
    background: #fff;
    width: 100%;
}

.chat-input {
    display: flex;
    align-items: center;
    /* gap: 8px;
  padding: 10px;
  border-top: 1px solid #ccc; */
    background: #fff;
    width: 100%;
}

.chat-input-container button {
    border: none;
    background: var(--button-gradient);
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 60px;
}

.chat-input-container button:active {
    transform: translateY(1px);
}

.chat-message {
    color: #000;
    float: left;
    background-color: #d5ebfb;
    max-width: 70%;
    min-width: 40%;
    padding: 6px 25px 25px 10px;
    margin: 5px;
    border-radius: 6px 6px 6px 0;
    font-size: 12px;
    position: relative;
}

.user-message {
    background: #eee;
    color: black;
}

.system-message {
    align-self: flex-start;
}

.thinking-message {
    color: #ffffff;
    float: left;
    background-color: #374151;
    max-width: 70%;
    min-width: 40%;
    padding: 6px 10px 10px 10px;
    margin: 5px;
    border-radius: 6px 6px 6px 0;
    font-size: 12px;
    position: relative;
}

.upload-container {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-6);
    overflow: hidden;

    /* Add padding for inner spacing */
    padding: 0;
    /* or use a fixed value like 1rem */
}

.upload-container form {
    padding: var(--space-4);
    /* restore padding for inner form */
}

@media(max-width:700px) {
    .upload-container {
        flex-direction: column;
    }
}

@media(max-width:900px) {
    .upload-container {
        flex-direction: column;
    }

    .chatbox {
        width: 100%;
        height: 320px;
        margin-left: 0;
        margin-top: 20px
    }
}

.upload-container h2 {
    display: block;
    font-size: 1.17em;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
    unicode-bidi: isolate;
}

/* Form Row Layout */

.form-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-body input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
    margin-bottom: 5px;
    width: 100%;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(3, 5fr);
    gap: 12px;
    /*margin-bottom: 15px;*/
}

.search-form input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

@media(max-width:1024px) {
    .search-form {
        grid-template-columns: repeat(2, 1fr)
    }

    .chatbox {
        min-width: 240px
    }
}

@media(max-width:700px) {
    .search-form {
        grid-template-columns: 1fr;
    }
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.2rem;
    justify-content: flex-start;
}

.action-edit i {
    color: #1d4ed8;
}

/* blue */

.action-delete i {
    color: #dc2626;
}

/* red */

/* Button Styles */

.button-group button {
    height: 42px;
    padding: 0 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: linear-gradient(135deg, #1A1032, #2B1A4A); */
    background: #ccc;

    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-group button:hover {
    /* background: linear-gradient(135deg, #1A1032, #2B1A4A); */
    background: var(--button-gradient);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.button-group button:active {
    transform: translateY(1px);
}

.tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    margin-bottom: 8px;
}

/* Update button styles to apply to all forms */

button[type="submit"] {
    background: var(--button-gradient);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--button-radius);
    cursor: pointer;
    font-weight: bold;

}

button[type="submit"]:hover {
    /* background: linear-gradient(135deg, #1A1032, #2B1A4A); */
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(109, 40, 217, 0.35);
    background: var(--button-gradient);
}

button[type="submit"]:active {
    transform: translateY(1px);
}

/* Responsive adjustments */

/* Add icons from Material Icons */

/* Card styles */

/* Table styles */

.table td {
    padding: 0.5rem;
}

/* Modal Styles */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--themeBgColor);
    margin: 10% auto;
    /* padding: 15px; */
    width: 400px;
    max-width: 95%;
    border-radius: var(--button-radius);
    position: relative;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

}

.modal-header {
    background: var(--header-gradient);
    color: #fff;
    font-weight: 700;
    padding: 10px 16px;
    text-align: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.button-group .btn-save {
    background: var(--button-gradient);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.button-group .btn-cancel {
    background: #ccc;
    color: #000;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
}

.modal-footer {
    /* margin-top: 15px;
    text-align: right; */
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: #f9f9f9;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.close-modal {
    position: absolute;
    right: 14px;
    top: 8px;
    font-size: 22px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.close-modal:hover {
    color: var(--themeBgBtnColor);
}

/* make room for 3 columns */

.modal-contentt {
    width: 960px;
    /* was 400 / 720 — fits 3 cols comfortably */
    max-width: 95%;
    border-radius: var(--button-radius);
    position: relative;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background-color: var(--themeBgColor);
    margin: 10% auto;
}

/* 3-col grid */

.form-grid.form-grid--3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
}

/* --- Controls: single source of truth --- */

:root {
    --ctl-h: 40px;
    --ctl-r: 6px;
    --ctl-px: 12px;
    --ctl-py: 8px;
    --ctl-fs: 14px;
    --ctl-bd: 1px solid #d1d5db;
    --ctl-bg: #fff;
    --ctl-fg: #111827;
    --ctl-focus: #2563eb;
}

/* Grid alignment */

.form-grid.form-grid--3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 16px;
    align-items: start;
    /* top-align rows uniformly */
}

/* Field wrapper */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    /* prevent overflow in grid */
}

.field label {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
    font-size: var(--ctl-fs);
}

/* Normalize ALL controls */

input.text-input,
select.text-input,
textarea.text-input {
    width: 100%;
    box-sizing: border-box;
    font-size: var(--ctl-fs);
    color: var(--ctl-fg);
    background: var(--ctl-bg);
    border: var(--ctl-bd);
    border-radius: var(--ctl-r);
    padding: var(--ctl-py) var(--ctl-px);
    outline: none;
}

/* Single-line controls share SAME HEIGHT */

input.text-input,
select.text-input {
    height: var(--ctl-h);
    line-height: calc(var(--ctl-h) - 2*var(--ctl-py));
}

/* Textarea: consistent style + taller by default */

textarea.text-input {
    /* min-height: 96px;              ~2.4 rows */
    /* line-height: 1.4; */
    height: var(--ctl-h);
    line-height: calc(var(--ctl-h) - 2 * var(--ctl-py))
        /* resize: vertical; */
}

/* Focus state */

input.text-input:focus,
select.text-input:focus,
textarea.text-input:focus {
    border-color: var(--ctl-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* Make select look consistent (keeps native arrow, adds padding) */

select.text-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 34px;
    /* room for arrow */
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%),
        linear-gradient(to right, #d1d5db, #d1d5db);
    background-position:
        right 12px center,
        right 6px center,
        right 30px center;
    background-size: 6px 6px, 6px 6px, 1px 60%;
    background-repeat: no-repeat;
}

/* Description spans 2 columns on wider screens */

.span-2 {
    grid-column: span 2;
}

/* Responsive */

@media (max-width: 1024px) {
    .form-grid.form-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .modal-contentt {
        width: 95%;
    }

    .form-grid.form-grid--3 {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }
}

/* Add these styles */

.text-input {
    /* width: 100%;
    padding: 8px;
    border: 1px solid #5e6879;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
    background-color: transparent; */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;

}

.text-input:focus {
    border-color: var(--themeBgBtnColor);
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 16, 50, 0.2);
}

.hidden {
    display: none;
}

/* Desktop / Base */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 13px;
}

.data-table thead tr th:first-child {
    border-top-left-radius: 8px;
}

.data-table thead tr th:last-child {
    border-top-right-radius: 8px;
}

.data-table th {
    background: #1A1033;
    color: #fff;
    padding: 10px;
    text-align: left;
    font-size: 13px;
}

.data-table td {
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #fff;
    font-size: 13px;
    vertical-align: middle;
}

.data-table tbody tr {
    border-radius: var(--button-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all .18s ease;
}

/* Action buttons */

.table-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
    background: #fff;
}

.icon-btn i {
    font-size: 14px;
    line-height: 1;
}

.icon-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.icon-btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.action-button-edit {
    color: #2563eb;
}

.action-button-del {
    color: #e74c3c;
}

.action-button-action {
    color: #ff8c00;
}

/* Mobile: transform rows into cards with labels */

@media (max-width: 720px) {
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        background: #fff;
        margin: 0 0 12px;
        border-radius: var(--button-radius);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }

    .data-table td {
        border: none;
        border-top: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
    }

    .data-table td:first-child {
        border-top: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4b5563;
        margin-right: 12px;
        flex: 0 0 auto;
    }

    .table-buttons {
        justify-content: flex-end;
    }
}

/* New styles */

.form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f9fafb;
    cursor: pointer;
    color: #080808;
    margin-bottom: 10px;
}

.form-select:focus {
    /* border-color: #C2953B; */
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 16, 50, 0.2);
}

/* Pagination styles */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.pagination button {
    padding: 8px 16px;
    background: var(--button-gradient);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:disabled {
    background: #374151;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background: #c2953b80;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination span {
    color: #fff;
    font-weight: 500;
}

.userName {
    padding-left: 10px;
    font-size: 16px;
}

.welcomeTxt {
    color: #ffffffab;
}

.LogginedUserName {
    display: inline-flex;
    justify-content: end;
    color: #ffffffab;
}

.VEuserName {
    font-size: 14px;
    margin-right: 15px;
}

.welcomeMsg {
    color: #fff;
    line-height: 1.2;
}

.user-avatar {
    width: 20px;
    margin: 5px;
}

.user-container {
    display: inline-flex;
    align-items: end;
    flex-direction: row;
    justify-content: end;
}

.system-avatar,
.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #374151;
    padding: 0px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    bottom: 4px;
    border: 1px solid #c2953b66;
}

.system-container {
    display: inline-flex;
    align-items: flex-end;
}

.location-input-group {
    display: flex;
    gap: 10px;
}

.location-input-group input {
    flex: 1;
}

.location-input-group button {
    padding: 8px 12px;
    white-space: nowrap;
}

#map {
    width: 100%;
    height: 345px;
    border-radius: 8px;
    margin: 15px 0;
}

h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    margin: 0;
}

.add-link {
    color: #CFE8FF;
    /* light icy blue */
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.add-link:hover {
    color: #A9D1FF;
    /* slightly darker pastel blue */
    text-shadow: 0 0 8px rgba(207, 232, 255, 0.6);
}

.add-link:active {
    color: #7AB8FF;
    /* stronger mid-blue for pressed state */
    text-shadow: 0 0 6px rgba(122, 184, 255, 0.4);
}

.add-link:focus {
    outline: none;
    color: #D8F3FF;
    /* subtle highlight blue */
    text-shadow: 0 0 10px rgba(216, 243, 255, 0.7);
}

/* Header */

#header-wrapper {
    background-color: #1e3a8a !important;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
}

.tagline {
    font-size: 13px;
    opacity: 0.9;
    color: #f1f6fa;
}

/* Header */

.app-header {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #fff;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
  
    /* Use gradient variable */
    background: var(--header-gradient);
  }

/* Overlay the SVG pattern as a glowing animated layer */

.app-header::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    background: url("images/header-bg.svg") no-repeat right center;
    background-size: cover;
    opacity: 0.95;
    animation: nodePulse 8s ease-in-out infinite;
    transition: opacity 0.3s ease;
  }

/* Pulse animation for subtle glow */

@keyframes nodePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
  }

/* Example logo and text alignment */

.app-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    /* ensure it appears above ::after */
    z-index: 2;
}

.app-header .nav-links {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.app-header .nav-links a {
    color: #CFE8FF;
    /* icy blue link color */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.app-header .nav-links a:hover {
    color: #A9D1FF;
    text-shadow: 0 0 8px rgba(169, 209, 255, 0.7);
}

.app-header .nav-links a:active {
    color: #7AB8FF;
}

.app-header .nav-links a:focus {
    color: #D8F3FF;
    text-shadow: 0 0 10px rgba(216, 243, 255, 0.8);
}

.logout-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #EAF4FF;
  font-weight: 700;
  letter-spacing: .3px;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
  backdrop-filter: blur(6px);
}

.logout-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.5);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25), inset 0 0 10px rgba(255,255,255,0.12);
}

.logout-btn:active {
  transform: translateY(1px) scale(0.995);
}

.logout-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.45);
}

/* ===== Logo and Branding Section ===== */

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2; /* keeps above background */
  }

.app-logo {
    height: 42px;
    width: 42px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.2));
  }

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #FFFFFF;
  }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

/* SIDEBAR CSS */

.move-to-left {
    transform: translateX(-385px);
}

/* .move-to-left-partly {
    transform: translateX(-200px);
  } */

.sidebar {
    height: 100%;
    width: 400px;
    position: fixed;
    top: 5.3rem;
    z-index: 1;
    right: -400px;
    box-shadow: 0 1rem 5rem rgba(0, 0, 0, 0.4);
    transition: transform .7s ease-in-out;
    border-top: 1px solid #363f4f;
    display: flex;
    flex-direction: column;
    border-radius: var(--button-radius);
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    margin-left: auto;

}

.container-liner {
    margin-left: 0rem;
}

.sidebar-tab {
    height: 130px;
    width: 30px;
    position: fixed;
    top: 50%;
    z-index: 1;
    right: 0;
    margin-left: auto;
    border-radius: 10px 0 0 10px;
    background-color: #1A1033;
    box-shadow: 0 1rem 5rem rgba(0, 0, 0, 0.5);
    transition: transform .7s ease-in-out;
    border: 1px solid #363f4f;
}

/* Sidebar tab: the visible strip you click */

#sidebar-tab {
    cursor: pointer;
    /* keep whatever positioning you already have */
  }

#sidebar-tab-text {
  pointer-events: none;          /* prevent capturing clicks outside the strip */
  display: block;
  white-space: nowrap;
  width: auto;                   /* remove JS-set giant width */
  writing-mode: vertical-rl;     /* vertical text without messy transforms */
  transform: rotate(180deg);     /* if you want text to read bottom-to-top */
  line-height: 1;
}

.vertical-text {
    writing-mode: vertical-rl;
    /* vertical text layout */
    transform: rotate(180deg);
    /* make it read top->bottom */
    color: #fff;
    font-weight: 500;
    letter-spacing: .5px;
    text-align: center;
    padding: 6px 0;
    margin-left: 5px;
    line-height: 1.1;
    user-select: none;
}

.item {
    display: flex;
    flex-direction: column;
    /* Stack text and image vertically */
    align-items: center;
    /* Center the text and image horizontally */
}

.header-text {
    margin: 15px 0px 10px;
    width: 100%;
    text-align: center;
    font-size: 16px;
}

.chat-link {
    cursor: pointer;
    color: rgb(16, 16, 17);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.chat-link:hover {
    cursor: pointer;
    color: var(--themeBgBtnColor);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

/* Container for question + buttons (inside system-message) */

.timestamp {
    position: absolute;
    bottom: 2px;
    right: 10px;
    font-size: 0.75rem;
    color: rgb(31, 26, 26);
}

/* ========================================================== */

/* When sidebar is open: shrink content, show sidebar */

.app-container.move-to-left .content-wrapper {
    flex: 0 0 75%;
    /* Shrink to 75% width */
}

.app-container.move-to-left .sidebar {
    width: 25%;
    /* Show sidebar */
}

.move-to-left-partly .content-wrapper {
    flex: 0 0 75%;
    width: calc(100% - 400px);
    transition: transform .7s ease-in-out;
}

/* .content-wrapper{
    border: 30px solid red;
} */

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-gradient);
    color: #fff;
    padding: 10px 16px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-weight: 500;
}

.search-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

.search-actions-button {
    background: var(--button-gradient);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: var(--button-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(14, 76, 155, 0.35);
  }

.collapse-btn {
    padding: 9px 12px;
    background: var(--themeBgBtnColor);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 10px;
}

.collapse-btn.collapsed i {
    transform: rotate(180deg);
}

.form-collapsed {
    display: none;
}

/* Info button and tooltip for Manage Types */

.info-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #C2953B;
    font-size: 1.2rem;
    padding: 0;
    margin-left: 0.5rem;
}

.info-tooltip {
    display: none;
    position: absolute;
    background: #232b3a;
    color: #fff;
    border: 1px solid #374151;
    border-radius: var(--button-radius);
    padding: 12px;
    z-index: 1000;
    left: 50px;
    top: 40px;
    min-width: 260px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.98rem;
    line-height: 1.5;
}

/* 3D Viewer Container and Sensor UI */

.viewer-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 80vh;
    border-radius: var(--button-radius);
    overflow: hidden;
}

/* header bar pinned at top of viewer */

.viewer-header {
    position: relative;
    top: 0;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    background: var(--header-gradient);
    z-index: 2;
    color: #fff;
    padding-top: 5px;
}

.vh-left {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 5px;
}

.vh-title-top {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.2
}

.vh-title-sub {
    opacity: .8;
    font-size: 12px
}

.vh-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
}

.icon-btn.ghost {
    height: 34px;
    width: 34px;
    display: inline-grid;
    place-items: center;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    cursor: pointer;
}

/* canvas sits BELOW header and fills area */

.three-canvas {
    position: relative; /* let it flow below the header */
    width: 100%;
    height: calc(100% - var(--viewer-header-h)); /* fills remaining viewer height */
    display: block;
    background-color: #fff;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    z-index: 1;
}

/* ───────────── Always-visible blue gutter + vertical label ───────────── */

.sensor-list-panel {
    position: absolute;
    top: var(--viewer-header-h, 43px);
    left: 0;
    bottom: 0; /* full height */
    width: 275px; /* full sidebar width when open */
    z-index: 12;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    overflow: hidden;
  
    /* --- core layout --- */
    --barW: 48px;
    padding-left: var(--barW); /* space for blue bar */
    background: #fff;
    transition: width 0.3s ease, padding-left 0.3s ease;
  }

/* Always-visible blue bar */

.sensor-list-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0; /* top:0; left:0; bottom:0 */
    width: var(--barW);
    background: #789fd2; /* your blue color */
    border-right: 1px solid #1a1a1a;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
    pointer-events: none;
  }

/* Always-visible vertical "Sensors" label */

.sensor-list-panel::after {
    content: "Sensors";
    position: absolute;
    left: 10px;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center;
    opacity: 0.9;
    pointer-events: none;
  }

/* ───────────── Collapsed state ───────────── */

.sensor-list-panel.collapsed {
    width: var(--barW);
    padding-left: 0;
    background: transparent; /* only blue bar visible */
    cursor: pointer;
  }

/* Hide list when collapsed */

.sensor-list-panel.collapsed #sensorList {
    display: none;
  }

/* Maintain "Sensors" label alignment in collapsed mode */

.sensor-list-panel.collapsed::after {
    opacity: 1;
  }

.sensor-list-panel.collapsed ~ .sensor-list-open-btn { display: grid; }

/* ───────────── Canvas shift ───────────── */

.viewer-container.sidebar-open .three-canvas {
    left: 260px;
    width: calc(100% - 260px);
  }

.viewer-container.sidebar-collapsed .three-canvas {
    left: 48px;
    width: calc(100% - 48px);
    transition: width 0.3s ease, left 0.3s ease;
  }

/* Make sure canvas stays under sidebar */

.three-canvas {
    z-index: 1;
  }

.sensor-list-panel {
    z-index: 2;
  }

/* when sidebar is open, nudge canvas so it doesn't sit under it */

.viewer-container.sidebar-open .three-canvas {
    left: 270px;
    /* 250 + 20 margin */
    top: -10px;
    width: calc(100% - 270px);
}

/* When sidebar is collapsed, canvas expands */

.viewer-container.sidebar-collapsed .three-canvas {
  left: 48px;
  width: calc(100% - 48px);
  transition: width 0.3s ease, left 0.3s ease;
}

/* small floating button to re-open sidebar when collapsed */

.sensor-list-open-btn {
    position: absolute;
    left: 12px;
    top: calc(var(--viewer-header-h) + 12px);
    height: 36px;
    width: 36px;
    display: none;
    place-items: center;
    background: #1e3a8a;
    color: #fff;
    border: none;
    border-radius: 8px;
    z-index: 12;
    cursor: pointer;
}

.sensor-list-panel.collapsed~.sensor-list-open-btn {
    display: grid;
}

.sensor-tooltip {
    display: none;
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    pointer-events: none;
}

.sensor-popup-menu {
    display: none;
    position: absolute;
    background: #232b3a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.sensor-popup-title {
    color: #C2953B;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
}

.sensor-popup-edit {
    width: 100%;
    margin-bottom: 8px;
    font-size: 12px;
    padding: 6px 12px;
}

.sensor-popup-delete {
    width: 100%;
    font-size: 12px;
    padding: 6px 12px;
    background: #dc3545;
}

.sensor-modal-title {
    color: #C2953B;
    margin-top: 0;
}

.sensor-modal-desc {
    color: #bdbdbd;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.sensor-label {
    color: #bdbdbd;
}

.sensor-remarks {
    min-height: 80px;
    background: #232b3a;
    border-color: #374151;
    color: #fff;
}

.sensor-modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ===== Sidebar Panel ===== */

.sensor-list {
    overflow-y: auto;
    flex: 1;
    /*padding: 6px;*/
    /* small breathing space against edges */
}

/* ===== Sensor Row (table-like, but sidebar-friendly) ===== */

.sensor-list-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    /* name | status | actions */
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color .18s ease, box-shadow .18s ease;
    background: #fff;
}

.sensor-list-item:hover {
    background-color: #284e53;
}

.sensor-list-item.highlighted {
    background-color: #113c25;
    border-left: 4px solid #469a99;
    padding-left: 6px;
    /* compensate for border-left */
}

.sensor-item-name {
    font-weight: 600;
    min-width: 0;
    /* prevent overflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sensor-item-status {
    justify-self: end;
    /* push badge towards actions */
}

/* ===== Actions (icon buttons) ===== */

.sensor-item-actions {
    display: flex;
    gap: 6px;
    justify-self: end;
}

.action-edit i {
    color: #1d4ed8;
}

/* blue */

.action-delete i {
    color: #dc2626;
}

/* red */

.empty-list-message {
    text-align: center;
    color: #9ca3af;
    padding: 10px 6px;
}

.row-actions {
    display: inline-flex;
    gap: 6px;
    vertical-align: middle;
}

.action-edit i {
    color: #1d4ed8;
}

.action-delete i {
    color: #dc2626;
}

/* (Optional) slim scrollbars for the sidebar */

/* Body cells */

.sidebar-table tbody td {
    padding: 8px 10px;
    /* ← consistent body padding */
    vertical-align: middle;
    /* ← proper vertical alignment */
}

/* Row height & hover */

.sidebar-table tbody tr {
    /*height: 38px;*/
    transition: background-color .18s ease;
}

.sidebar-table tbody tr.row-highlight {
    background: #789fd2;
    /* soft blue */
    /*outline: 2px solid #9ec5fe;
    outline-offset: -2px;*/
}

.name-text {
    transition: color .12s ease, font-weight .12s ease;
}

.name-text.name-highlight {
    color: #101011;
    font-weight: 700;
}

/* basic table bits used above (keep your existing styles too) */

.sidebar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sidebar-table thead th {
    background:lightslategray;
    color: #000;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-table td {
    padding: 8px 10px;
    /*background: #fff;*/
    vertical-align: middle;
}

.sidebar-table .row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.action-edit i {
    color: #1d4ed8;
}

.action-delete i {
    color: #dc2626;
}

/* Last row bottom border cleanup */

.sidebar-table tbody tr:last-child td {
    border-bottom: none;
}

.led {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: #9ca3af;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.led-green {
    background: #22c55e;
}

/* selected row */

.led-blue {
    background: #3b82f6;
}

/* placing new sensor */

.blink {
    animation: ledPulse 1s ease-in-out infinite;
}

@keyframes ledPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
        opacity: 0.85;
    }

    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        opacity: 0.85;
    }
}

/* Make blue pulse use blue glow when .led-blue + .blink */

.led-blue.blink {
    animation-name: ledPulseBlue;
}

@keyframes ledPulseBlue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, .6);
        opacity: 0.85;
    }

    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        opacity: 0.85;
    }
}

/* Columns sizing/alignment */

.cell-name {
    max-width: 128px;
    /* fits inside 250px sidebar */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-status {
    width: 72px;
}

/* badge column width */

.col-actions,
.cell-actions {
    width: 84px;
    text-align: right;
}

/* OPTIONAL: if you still have the floating reopen button, disable it so only the header list button controls open */

.sensor-list-open-btn {
    display: none !important;
}

/* ============ ADDITIONS: consistent cell highlight + selected badge ============ */

.button-icon {
    font-size: 1.2rem;
    line-height: 1;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Pagination */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination button {
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.pagination button:hover {
    background-color: var(--bg-hover);
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .current-page {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* ───────────── Viewer Controls Panel (Squared) ───────────── */

#viewer-controls {
    position: absolute;
    top: var(--viewer-header-h, 70px); /* stays below the header */
    right: 10px;
    z-index: 3;
    background: var(--header-gradient);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #eee;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

/* Checkbox area */

#viewer-controls label {
    font-size: 12px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }

#viewer-controls input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
  }

/* ───────────── Control Grid ───────────── */

#viewer-controls .control-buttons {
    display: grid;
    grid-template-columns: repeat(3, 36px);
    grid-template-rows: repeat(2, 36px);
    gap: 6px;
    justify-items: center;
    align-items: center;
  }

/* ───────────── Buttons ───────────── */

#viewer-controls button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #789fd2;
    color: #eee;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.05);
  }

/* Fade-in animation for smooth appearance */

#viewer-controls {
    opacity: 0;
    animation: fadeInControls 0.4s ease-out forwards;
  }

@keyframes fadeInControls {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
  }

/* ───────────── Model Loading Overlay ───────────── */

.model-loading-overlay {
    position: absolute;
    inset: 0; /* top:0; left:0; right:0; bottom:0 */
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50; /* above canvas but below modals */
    color: #fff;
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

.model-loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
  }

/* Simple spinner */

.model-loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4dabf7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
  }

@keyframes spin {
    to { transform: rotate(360deg); }
  }

/* ============================== */

/* 📦 Chat UI Enhancements        */

/* ============================== */

/* System (bot) message bubble */

.chat-message.system-message {
    background: linear-gradient(135deg, #d9ecff 0%, #cde6ff 100%);
    border: 1px solid #b7d8fa;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 10px 18px 26px 18px;
    animation: fadeInUp 0.35s ease both;
    transition: all 0.25s ease;
  }

/* Subtle fade-up animation for chat messages */

@keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

/* User message refinement */

.user-message {
    background: #f5f7fa;
    border: 1px solid #e1e7ef;
    border-radius: 10px 10px 0 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #222;
  }

/* Timestamp styling (lighter, subtle) */

.timestamp {
    font-size: 11px !important;
    color: #666 !important;
    opacity: 0.75;
    margin-top: 6px;
    text-align: right;
    display: block;
    pointer-events: none;
  }

/* "Is this what you are looking for?" container */

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
  }

/* Question text */

.chat-suggestions-title {
    font-weight: 500;
    font-size: 12px;
    color: #000;
    margin-bottom: 6px;
  }

/* Button container */

.chat-suggestions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

/* Suggestion buttons */

.chat-suggestion-btn {
    background: var(--button-gradient);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
  }

.chat-suggestion-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  }

.chat-suggestion-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

/* Mobile: stack buttons vertically for better tap area */

@media (max-width: 768px) {
    .chat-suggestions-group {
      flex-direction: column;
    }
    .chat-suggestion-btn {
      width: 100%;
      text-align: center;
    }
 
  }

:root {
  --primary: #13345F;
  --primary-light: #1E4A7F;
  --secondary: #F26913;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --radius: .375rem;
  --radius-md: .5rem;
  --radius-lg: .75rem;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
  --header-gradient: linear-gradient(90deg, #1A1033 0%, #1E1F6A 100%);
  --button-gradient: linear-gradient(90deg, #0B3A80 0%, #0E4C9B 100%);
  --border-radius-top: 8px 8px 0 0;
}

* {
  box-sizing: border-box
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  margin: 0;
  color: var(--gray-800);
  line-height: 1.6
}

.header {
  background: var(--primary);
  color: #fff;
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md)
}

.logo {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3)
}

.page-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  background: #13345F;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.page-title {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 0;
  color: var(--primary)
}

.header-actions {
  display: flex;
  gap: var(--space-4)
}

.alerts-container {
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: var(--space-6);
  overflow: hidden;
  background: #fff;
  border: 1px solid #dcdcdc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0 0 var(--space-6) 0;
}

.alert-pill {
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: var(--space-2)
}

.alert-pill.critical {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #fadbd8
}

.alert-pill.warning {
  background: #fff4e0;
  color: var(--warning);
  border: 1px solid #fae0b3
}

.alert-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md)
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: var(--space-6);
  margin-bottom: var(--space-6)
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5)
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 500;
  margin: 0;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-3)
}

.card-actions {
  display: flex;
  gap: var(--space-3)
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  /* was 220px */
  gap: 16px;
  overflow-x: auto;
  /* enable horizontal scroll if still too many cards */
  white-space: nowrap;
  padding: 20px 24px;
}

.summary-card {
  background: #f1f3f6;
  /* soft bluish-gray, complements navy header */
  border-radius: 10px;
  box-shadow:
    0 6px 12px rgba(19, 52, 95, 0.2),
    /* theme-colored shadow */
    0 12px 28px rgba(0, 0, 0, 0.18);
  /* secondary dark shadow */
  padding: var(--space-5);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.summary-card:hover {
  transform: translateY(-5px);
  background: #ffffff;
  /* subtle “lift” contrast */
  box-shadow:
    0 10px 25px rgba(19, 52, 95, 0.25),
    0 20px 40px rgba(0, 0, 0, 0.22);
}

.summary-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  /* space between icon and title */
  justify-content: flex-start;
  /* icon and title on the same side */
  margin-bottom: var(--space-4);
}

.summary-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
  color: var(--gray-700)
}

/* --- Icon Styling --- */

.summary-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
  /* prevent icon from shrinking */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Existing colors */

.summary-card-icon.healthy {
  background: var(--success);
}

.summary-card-icon.warning {
  background: var(--warning);
}

.summary-card-icon.critical {
  background: var(--danger);
}

/* --- New colorful gradient for Alerts --- */

.summary-card-icon.colorful {
  background: linear-gradient(135deg, #f26913, #ffcc33);
  color: #fff;
  box-shadow: 0 3px 8px rgba(242, 105, 19, 0.4);
  animation: pulseGlow 2.5s infinite alternate;
}

.summary-card-content {
  display: flex;
  flex-direction: column;
  /* stack value + label */
  justify-content: center;
  /* center vertically */
  align-items: center;
  /* center horizontally */
  gap: 4px;
  min-height: 60px;
  /* optional: keeps cards even */
}

.summary-card-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  /* ensures centering if width shrinks */
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  font-weight: 500
}

.filter-bar {
  background: #fff;
  padding: var(--space-4);
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  ;
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--space-6)
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2)
}

.filter-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap
}

.filter-group select,
.filter-group input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  background: #fff
}

.table-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: #fff;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--gray-700);
}

th {
  background: #1A1033;
  /* changed from var(--gray-50) */
  color: #ffffff;
  /* changed from var(--gray-700) */
  font-weight: 500;
  position: sticky;
  top: 0;
}

tr {
  cursor: pointer;
  transition: background .2s;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: var(--gray-50);
}

.status-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px
}

.status-Healthy {
  background: #eaf9f0;
  color: var(--success)
}

.status-Warning {
  background: #fff4e0;
  color: var(--warning)
}

.status-Critical {
  background: #fdecea;
  color: var(--danger)
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px)
}

.modal-content {
  background: #fff;
  margin: 40px auto;
  padding: 0;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn .3s
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-3)
}

.modal-close {
  font-size: var(--text-xl);
  font-weight: bold;
  cursor: pointer;
  color: var(--gray-500);
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700)
}

.modal-body {
  padding: var(--space-6)
}

@keyframes tabFadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.chart-container {
  background: var(--gray-50);
  border-radius: var(--radius);
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  margin-bottom: var(--space-5)
}

canvas {
  width: 100% !important;
  height: 100% !important
}

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--space-4)
}

.sensor-card {
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--primary)
}

.sensor-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3)
}

.sensor-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
  color: var(--gray-700)
}

.sensor-card-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary)
}

.sensor-card canvas {
  height: 140px !important
}

.btn-secondary {
  background: var(--button-gradient);
  color: #fff;
  border-radius: 10px;
  
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(109, 40, 217, 0.35);
  background: var(--button-gradient);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs)
}

/* ===== rpt-* aliases to avoid collisions ===== */

.rpt-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px)
}

.rpt-modal-content {
  background: #fff;
  margin: 40px auto;
  padding: 0;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn .3s
}

.rpt-modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.rpt-modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-3)
}

.rpt-modal-close {
  font-size: var(--text-xl);
  font-weight: bold;
  cursor: pointer;
  color: var(--gray-500);
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.rpt-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700)
}

.rpt-modal-body {
  padding: var(--space-6)
}

.rpt-tab-nav {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--gray-200)
}

.rpt-tab-nav button {
  padding: var(--space-3) var(--space-5);
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--gray-600);
  position: relative;
  transition: all .2s
}

.rpt-tab-nav button:hover {
  color: var(--primary)
}

.rpt-tab-nav button.active {
  color: var(--primary);
  font-weight: 600
}

.rpt-tab-nav button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary)
}

.rpt-tab-content>div {
  display: none
}

.rpt-tab-content>div.active {
  display: block;
  animation: tabFadeIn .3s
}

@media (max-width:768px) {

  .kpi-grid,
  .summary-grid {
    grid-template-columns: 1fr
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch
  }

  .sensor-grid {
    grid-template-columns: 1fr
  }

  .modal-content {
    width: 95%;
    margin: 20px auto
  }
}

/* --- Responsive Enhancements --- */

/* Make cards, grids, and panels stack naturally */

@media (max-width: 1024px) {
  .kpi-grid {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .kpi-card {
    flex: 1 1 calc(50% - 1rem);
    min-width: 160px;
    max-width: none;
  }

  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* --- Filter Bar Responsiveness --- */

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .filter-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .filter-group label {
    margin-bottom: 4px;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
    font-size: var(--text-base);
  }
}

/* --- Table Responsiveness --- */

.alerttable-container,
.table-container,
.table-containers {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Make tables scrollable horizontally with padding */

.alerttable-container table,
.table-container table,
.table-containers table {
  min-width: 600px;
  /* ensures proper layout inside scroll */
}

/* --- Card Layouts --- */

@media (max-width: 768px) {
  .card {
    padding: var(--space-4);
    margin-bottom: var(--space-5);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header h3 {
    font-size: 1.1rem;
  }
}

/* Match Active Alerts style for other sections */

.alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-gradient);

  color: #fff;
  padding: 10px 16px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  font-weight: 500;
}

.alerts-header h3 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alerts-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Modal Scaling --- */

@media (max-width: 600px) {
  .rpt-modal-content {
    width: 95%;
    margin: 10px auto;
    padding: 0;
  }
}

/* 🧩 Fix: Remove table horizontal scroll when stacked (mobile view) */

@media (max-width: 600px) {

  .alerttable-container,
  .table-container,
  .table-containers {
    overflow-x: visible !important;
    /* stop forcing scrollbars */
  }

  .alerttable-container table,
  .table-container table,
  .table-containers table {
    min-width: 100% !important;
    width: 100% !important;
    box-shadow: none;
    border: none;
  }

  
  /* Optional: ensure no residual scroll in container parent */
  body,
  html {
    overflow-x: hidden;
  }
}

@media (max-width: 600px) {
  tr {
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: var(--text-xs);
  }
}

/* --- Hierarchical layout for Equipment Instances table --- */

.alerts-container .alerttable-container {
  /*padding: 16px 24px 24px 24px;*/
  /* space inside the panel */
  background: transparent;
}

.alerts-container .alerttable-container table {
  width: 96%;
  /* slightly smaller to look indented */
  margin: 0 auto;
  /* center table within the container */
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease-in-out;
}

/* Optional subtle border for separation from filters above */

/* Optional hover accent */

/* --- Enhanced Main Dashboard Header --- */

/* 🎨 Dynamic light backgrounds for summary cards based on icon type */

.summary-card.healthy {
  background: rgba(46, 204, 113, 0.1); /* light green tint */
}

.summary-card.warning {
  background: rgba(243, 156, 18, 0.1); /* warm amber tint */
}

.summary-card.critical {
  background: rgba(231, 76, 60, 0.1); /* soft red tint */
}

.summary-card.omitted {
  background: rgba(107, 114, 128, 0.08); /* subtle gray tint */
}

.summary-card.colorful {
  background: linear-gradient(135deg, rgba(242, 105, 19, 0.08), rgba(255, 204, 51, 0.1));
}

/* Hover enhancement (slightly brighter) */

.summary-card.healthy:hover {
  background: rgba(46, 204, 113, 0.18);
}

.summary-card.warning:hover {
  background: rgba(243, 156, 18, 0.18);
}

.summary-card.critical:hover {
  background: rgba(231, 76, 60, 0.18);
}

.summary-card.omitted:hover {
  background: rgba(107, 114, 128, 0.15);
}

.summary-card.colorful:hover {
  background: linear-gradient(135deg, rgba(242, 105, 19, 0.15), rgba(255, 204, 51, 0.18));
}

/* --- Align Filter Bar with Table Width and Detach from Header --- */

.alerts-header {
  border-bottom: none; /* visually separates header */
  border-radius: 8px 8px 0 0;
}

.filter-bar {
  width: 92%; /* same width as table below */
  margin: 0 auto; /* center align with table */
  background: #fff;
  padding: var(--space-4) var(--space-5);
  border-radius: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.alerttable-container {
  width: 96%; /* matches filter bar width */
  margin: 0 auto;
}

/* Optional subtle spacing for hierarchy */

.filter-bar + .alerttable-container {
  margin-top: var(--space-4);
}
