:root {
    --glass: rgba(255, 255, 255, 0.045);
    --glass2: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --text: rgba(255, 255, 255, 0.88);
    --muted: rgba(255, 255, 255, 0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
}

body {
    min-height: 100vh;
    background: radial-gradient(900px 600px at 20% 10%, rgba(120, 120, 255, 0.12), transparent 60%),
    radial-gradient(900px 600px at 80% 90%, rgba(255, 120, 200, 0.10), transparent 60%),
    linear-gradient(135deg, #0b1020, #0e1628);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover,
a:focus-visible {
    color:var(--muted);
}

.wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.logo {
    max-width: 520px;
    resize: both;
}

.logo svg {
    width: 95%;
    height: 95%;
}

/* NAV */
nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
    flex-wrap: wrap;
}

nav li {
    display: flex;
    align-items: center;
}
nav li.current a,
nav li.section a {
    color:var(--muted);
}

nav li:not(:last-child)::after {
    content: "|";
    margin: 0 12px;
    color: #2f3544;
}

nav.history-nav li:not(:last-child) {
    margin: 0 0 6px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    nav.history-nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    nav.history-nav li {
        justify-content: center;
        width: 100%;
        padding: 10px 0;
    }

    nav.history-nav li:not(:first-child) {
        border-top: 1px solid var(--border);
    }

    nav.history-nav li:not(:last-child)::after {
        display: none;
    }

    nav.history-nav li:not(:last-child) {
        margin: 0;
    }

    nav.history-nav li a {
        display: inline-block;
        padding: 0;
        text-align: center;
    }
}

@media (max-width: 380px) {
    nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    nav li {
        justify-content: center;
        width: 100%;
        padding: 10px 0;
    }

    nav li:not(:first-child) {
        border-top: 1px solid var(--border);
    }

    nav li:not(:last-child)::after {
        display: none;
    }

    nav li a {
        display: inline-block;
        padding: 0;
        text-align: center;
    }
}

/* CARD */
.card {
    width: min(880px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, var(--glass2), var(--glass));
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.card-menu {
    margin-top: 0;
    margin-bottom: 2rem;
}
.card-menu,
.card-content,
.card-login {
    grid-template-columns: 1.2fr;
}
.card-login {
    width: min(460px,100%);
}
.card-dash {
    margin-top: 0;
    background: transparent;
}
.card-dash .panel {
    text-align: center;
}
.card-sensor {
    margin-top: 2rem;
}
.card-sensor.first {
    margin-top: 0;
}

.sensors-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    justify-items: center;
}

@media (min-width: 1800px) {
    .sensors-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
        justify-items: stretch;
    }

    .sensors-grid .card-sensor,
    .sensors-grid .card-sensor.first {
        width: 100%;
        margin-top: 0;
    }
}

.center {
    text-align: center;
}

@media (max-width: 820px) {
    .card {
        grid-template-columns: 1fr;
    }

    .logo {
        max-width: 330px;
    }
}

.sensor-status .dot {
    color: #32d583;
}

.sensor-status.offline .dot {
    color: #ff5a5f;
}

.panel {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.title {
    font-size: .85rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

/* FORM */
input[type="text"],
input[type="email"],
input[type="password"] {
    outline: none;
    color: var(--muted);
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    background: rgb(255 255 255 / 7%);
    border: 1px solid var(--border);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border: 1px solid var(--muted);
}

input[type="submit"],
button {
    background-color: #356d53;
    border-radius: 28px;
    border: 1px solid #3c7f60;
    display: inline-block;
    cursor: pointer;
    color: var(--text);
    font-family: Arial, sans-serif;
    font-size: 17px;
    padding: 16px 31px;
    text-decoration: none;
    transition: background-color 0.2s;
}

input[type="submit"]:hover,
button:hover {
    background-color: #49a078;
}

input[type="submit"]:active,
button:active {
    position: relative;
    top: 1px;
}

form .button-holder {
    margin-top: 20px;
    text-align: center;
}
form .message {
    border-radius: 6px;
    padding: 8px;
    margin: 0;
}
form .message.bad,
form .message.error,
form .message.required {
    border: 1px solid #e54545;
}

/* Login Form Begin */
#MemberLoginForm_LoginForm fieldset,
#LostPasswordForm_lostPasswordForm fieldset,
#ChangePasswordForm_ChangePasswordForm fieldset
{
    border: none;
    padding: 25px;
    margin: 0;
}
@media (max-width: 560px) {
    #MemberLoginForm_LoginForm fieldset,
    #LostPasswordForm_lostPasswordForm fieldset,
    #ChangePasswordForm_ChangePasswordForm fieldset
    {
        padding: 15px;
    }
}
#MemberLoginForm_LoginForm .btn-toolbar,
#LostPasswordForm_lostPasswordForm .btn-toolbar,
#ChangePasswordForm_ChangePasswordForm .btn-toolbar
{
    margin-top: 20px;
    text-align: center;
}
#MemberLoginForm_LoginForm_Email_Holder,
#MemberLoginForm_LoginForm_Password_Holder,
#ChangePasswordForm_ChangePasswordForm_NewPassword2_Holder
{
    margin-top: 20px;
}
label[for="MemberLoginForm_LoginForm_Email"],
label[for="MemberLoginForm_LoginForm_Password"],
label[for="LostPasswordForm_lostPasswordForm_Email"],
label[for="ChangePasswordForm_ChangePasswordForm_NewPassword1"],
label[for="ChangePasswordForm_ChangePasswordForm_NewPassword2"]
{
    display: block;
    padding-bottom: 5px;
}
#MemberLoginForm_LoginForm_Remember_Holder {
    text-align: left;
    margin-top: 20px;
}
/* Login Form End */

/* Table Begin */
.panel table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.panel table thead th {
    text-align: center;
    padding: 12px 14px;
    font-size: .85rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: linear-gradient(180deg, rgb(17 22 45 / 36%), rgb(34 29 52 / 36%));
    border-bottom: 1px solid var(--border);
}

.panel table tbody td {
    text-align: center;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.panel table tbody tr:nth-child(even) {
    background: rgb(23 30 47 / 16%);
}
.panel table tbody tr {
    transition: background-color 0.2s;
}
.panel table tbody tr:hover {
    background: rgba(73, 159, 120, 0.14);
}

.panel table td:nth-child(2),
.panel table td:nth-child(3) {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
    .panel table {
        border: 0;
        background: transparent;
    }

    .panel table thead {
        display: none;
    }

    .panel table tbody tr {
        display: block;
        margin-top: 12px;
        padding: 12px;
        border-radius: 16px;
        border: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.03);
    }

    .panel table tbody td {
        text-align: right;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        padding: 10px 0;
        border: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .panel table tbody td:last-child {
        border-bottom: 0;
    }

    .panel table tbody td::before {
        text-align: left;
        font-size: .8rem;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--muted);
        content: "";
    }

    .panel table tbody td:nth-child(1)::before {
        content: "Recorded at";
    }

    .panel table tbody td:nth-child(2)::before {
        content: "Water Quality";
    }

    .panel table tbody td:nth-child(3)::before {
        content: "Temperature";
    }

    .panel table tbody td:nth-child(4)::before {
        content: "Rating";
    }

    .panel table tbody td:nth-child(5)::before {
        content: "Comment";
    }

    .panel table td:nth-child(2),
    .panel table td:nth-child(3) {
        text-align: left;
    }

    .panel table.sensor-readings-table-air tbody td:nth-child(2)::before {
        content: "Air Quality";
    }

    .panel table.sensor-readings-table-air tbody td:nth-child(4)::before {
        content: "Pressure";
    }

    .panel table.sensor-readings-table-air tbody td:nth-child(5)::before {
        content: "Humidity";
    }

    .panel table.sensor-readings-table-air td:nth-child(4),
    .panel table.sensor-readings-table-air td:nth-child(5) {
        text-align: left;
    }

    .panel table.sensor-history-table-air tbody td:nth-child(2)::before {
        content: "Air Quality";
    }

    .panel table.sensor-history-table-air tbody td:nth-child(4)::before {
        content: "Pressure";
    }

    .panel table.sensor-history-table-air tbody td:nth-child(5)::before {
        content: "Humidity";
    }

    .panel table.sensor-history-table-air tbody td:nth-child(6)::before {
        content: "Rating";
    }

    .panel table.sensor-history-table-air tbody td:nth-child(7)::before {
        content: "Comment";
    }

    .panel table.sensor-history-table-air td:nth-child(4),
    .panel table.sensor-history-table-air td:nth-child(5),
    .panel table.sensor-history-table-air td:nth-child(6) {
        text-align: left;
    }
}

/* Table End */

/* Graph Begin */
.panel canvas {
    width: 100%;
    margin-top: 12px;
}
.chart-wrap {
    height: 650px;
    width: 100%;
    margin-top: 12px;
}

@media (max-width: 560px){
    .chart-wrap {
        height: 400px;
    }
}
/* Graph End */

/* DASHBOARD BITS */
.temp {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    opacity: .85;
}

.primary-metric {
    margin-top: 10px;
    font-size: clamp(4.2rem, 9vw, 6.8rem);
    font-weight: 700;
    opacity: .92;
}

.metric-unit {
    font-size: 1rem;
    letter-spacing: .06em;
    color: var(--muted);
}

.time {
    margin-top: 8px;
    font-size: 1rem;
    color: var(--muted);
}

.date {
    margin-top: 14px;
    font-size: 16px;
    font-weight: 600;
    opacity: .85;
}

.kv {
    overflow: visible;
    cursor: default;
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    margin-top: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.tds-tip-icon {
    cursor: help;
}

.k {
    color: var(--muted);
}

.tds-tip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 9999;
    padding: 10px 12px;
    background: rgb(42 49 65);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: none;
}

.tds-tip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 14px;
    width: 12px;
    height: 12px;
    background: rgb(42 49 65);
    transform: rotate(45deg);
}

.tds-tip-table {
    border-collapse: collapse !important;
    font-size: 13px;
    margin-top: 0 !important;
}

.tds-tip-table th,
.tds-tip-table td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
    white-space: nowrap;
}

.tds-tip-table th {
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.20);
}

.tds-tip-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Tooltip row colors */
.tds-tip-table tr.tds-excellent td {
    color: #2ecc71; /* green */
}

.tds-tip-table tr.tds-very-good td {
    color: #6adf9b; /* light green */
}

.tds-tip-table tr.tds-good td {
    color: #f1c40f; /* yellow */
}

.tds-tip-table tr.tds-acceptable td {
    color: #f39c12; /* orange */
}

.tds-tip-table tr.tds-poor td {
    color: #e67e22; /* dark orange */
}

.tds-tip-table tr.tds-very-poor td {
    color: #e74c3c; /* red */
}

.tds-tip-table tr.tds-unsafe td {
    color: #ff3b3b; /* strong red */
    font-weight: 600;
}

.TDSRating.tds-excellent { color: #2ecc71; }
.TDSRating.tds-very-good { color: #6adf9b; }
.TDSRating.tds-good { color: #f1c40f; }
.TDSRating.tds-acceptable { color: #f39c12; }
.TDSRating.tds-poor { color: #e67e22; }
.TDSRating.tds-very-poor { color: #e74c3c; }
.TDSRating.tds-unsafe { color: #ff3b3b; font-weight: 600; }
.CO2Rating.tds-excellent { color: #2ecc71; }
.CO2Rating.tds-very-good { color: #6adf9b; }
.CO2Rating.tds-good { color: #f1c40f; }
.CO2Rating.tds-acceptable { color: #f39c12; }
.CO2Rating.tds-poor { color: #e67e22; }
.CO2Rating.tds-very-poor { color: #e74c3c; }
.CO2Rating.tds-unsafe { color: #ff3b3b; font-weight: 600; }

.v {
    font-weight: 600;
    opacity: .9;
}

.footer {
    margin-top: 14px;
    font-size: .9rem;
    color: var(--muted);
}
.footer small {
    display: block;
    text-align: center;
}

.get-app-holder {
    display: block;
    margin: 20px 0;
    text-align: center;
}

.get-app-svg {
    width: 100%;
    max-width: 130px;
    height: auto;
}

/* Pagination Begin */
.pagination-wrapper {
    margin-top: 20px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.pagination-btn:hover:not(.pagination-btn-disabled) {
    background: rgba(73, 159, 120, 0.15);
    border-color: rgba(73, 159, 120, 0.3);
    color: var(--text);
    transform: translateY(-1px);
}

.pagination-btn:active:not(.pagination-btn-disabled) {
    transform: translateY(0);
}

.pagination-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-btn i {
    font-size: 1.1rem;
    line-height: 1;
}

.pagination-info-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.pagination-info-text {
    font-size: 0.85rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-info-text strong {
    color: var(--text);
    font-weight: 600;
}

.pagination-info-separator {
    color: var(--muted);
    opacity: 0.6;
}

/* Mobile Responsive - 380px and below */
@media (max-width: 380px) {
    .pagination-wrapper {
        margin-top: 16px;
    }

    .pagination-nav {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .pagination-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.85rem;
        justify-content: center;
    }

    .pagination-btn-text {
        display: none;
    }

    .pagination-btn i {
        font-size: 1.2rem;
    }

    .pagination-info-center {
        order: -1;
        width: 100%;
    }

    .pagination-info-text {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }

    .pagination-info-separator {
        display: none;
    }
}

/* Tablet and small screens - 560px and below */
@media (max-width: 560px) {
    .pagination-nav {
        gap: 12px;
    }

    .pagination-btn {
        padding: 10px 14px;
    }

    .pagination-btn-text {
        display: none;
    }

    .pagination-info-text {
        font-size: 0.8rem;
    }
}
/* Pagination End */

/* Typography Begin */
.typography p {
    line-height: 1.6em;
}
.typography img {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.typography p {
    line-height: 1.6em;
}
.typography img {
    max-width: 400px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.typography .image-grid {
    display: grid;
    gap: 2rem;
    align-items: center;
    justify-items: center;
}
@media (min-width: 768px) {
    .typography .image-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .typography .image-grid img {
        max-width: none;
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
    }
}
@media (max-width: 767px) {
    .typography .image-grid {
        grid-template-columns: 1fr;
    }
}
.typography .image-grid > p {
    margin: 0;
}
/* Typography End */
