:root {
    --dark-background: #1a2a33;
    --light-background: #dee7ec;
    --light-background-transparant: #dee7ec66;
    --button-dark: rgba(240, 249, 253, 0.04);
    --button-primary-background: #ffe180;
    --button-hover: #3a4a53;
    --button-primary-hover: #ffd54f;
    --text-dark: #2c3e50;
    --text-light: #F0F9FD;
    --border-radius-large: 50px;
    --border-radius-medium: 30px;
    --border-radius-small: 15px;
    --lighter-background: #243947;
    --active-badge-bg: #d0e8c0;
    --active-badge-color: #2d3d22;
    --inactive-badge-bg: #dee7ec;
    --inactive-badge-color: #3d2222;
    --error-badge-bg: #ff9999;
    --error-badge-color: #3d2222;
    --text-muted: #a0aec0;
    --border-radius: 12px;
}

body {
    font-family: "Nunito Sans", "Segoe UI", Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 300;
    margin: 0;
    padding: 20px;
    background-color: var(--dark-background);
    color: var(--text-light);
    font-size: 18px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex {
    display: flex;
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

.space-between {
    justify-content: space-between;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

form {
    display: grid;
}

h1 {
    font-size: 52px;
    line-height: 1.2;
}
h1.large {
    font-size: 64px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
}

label {
    font-weight: bold;
}

input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.text-red {
    color: red;
}

a, a:visited, a:hover, a:active {
    color: var(--text-light);
}

.bold {
    font-weight: bold;
}

.padded {
    padding: 15px;
}

.small-padded {
    padding: 5px;
}

.v-padded {
    padding-top: 15px;
    padding-bottom: 15px;
}

.h-padded {
    padding-right: 15px;
    padding-left: 15px;
}

.t-padded {
    padding-top: 15px;
}

.r-padded {
    padding-right: 15px;
}

.b-padded {
    padding-bottom: 15px;
}

.no-underline {
    text-decoration: none;
}

.w-full {
    width: 100%;
}

.whitespace-nowrap {
    white-space: nowrap;
}

img {
    max-width: calc(100vw - 70px);
}

.status-badge {
    border-radius: 8px;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
    min-width: 60px;
}

.status-badge--active {
    background-color: var(--active-badge-bg);
    color: #2d3d22;
}

.status-badge--inactive {
    background-color: var(--inactive-badge-bg);
    color: #3d2222;
}

.status-badge--error {
    background-color: var(--error-badge-bg);
    color: #3d2222;
}

label {
    display: block;
    margin-bottom: 12px;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 400;
}

/* Text input styling */
.form-input {
    width: 100%;
    max-width: 1100px;
    padding: 16px 24px;
    font-size: 16px;
    background-color: var(--light-background);
    color: var(--text-dark);
    border: none;
    border-radius: var(--border-radius-large);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    box-sizing: border-box;
}
textarea.form-input  {
    border-radius: 20px;
}

.form-input::placeholder {
    color: var(--text-dark);
    opacity: 0.7;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 225, 128, 0.5);
}

.right {
    text-align: right;
    float: right;
}

button, a.button {
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    padding: 14px 25px;
    margin: 5px;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    background-color: var(--button-dark);
    color: var(--text-light);
}

button:hover, a.button:hover {
    background-color: var(--button-hover);
}

button.primary, a.button.primary {
    background-color: var(--button-primary-background);
    color: var(--text-dark);
}

button.primary:hover, a.button.primary:hover {
    background-color: var(--button-primary-hover);
}

button.primary:active, a.button.primary:active {
    transform: translateY(0);
}

.small-button, a.small-button {
    display: inline-flex;
    font-weight: 500;
    padding: 10px 20px;
    font-size: 14px;
}

/* Container for centering the button */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: separate; /* Important for border-radius to work */
    border-spacing: 0 10px;
}

table thead th {
    text-align: left;
    font-weight: 500;
    padding: 10px 20px;
    font-size: 16px;
    color: var(--text-light);
}

table tbody tr {
    border-radius: var(--border-radius);
}

/* This trick helps apply border-radius to table rows */
table tbody tr td:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

table tbody tr td:last-child {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

table td {
    min-height: 60px;
    background-color: var(--lighter-background);
    padding: 15px 20px;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-icon {
    background-color: var(--dark-background);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.user-role {
    font-size: 14px;
    color: var(--text-muted);
}

.rotate-180 {
    transform: rotate(-180deg);
    transform-origin: center center;
    position: relative;
}

.overlay {
    height: 100dvh;
    width: 100%;
    background-color: var(--light-background-transparant);
    position: absolute;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}


.popup {
    background-color: var(--light-background-transparant);
    padding: 40px;
    border-radius: var(--border-radius-medium);
    position: relative;
    min-height: 200px;
    min-width: min(300px, 80%);
}

.popup .close-button {
    position: absolute;
    right: 10px;
    top: 10px;
}

.logged-in {
    display: flex;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

/* Hide the default checkbox */
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider - grey by default (unchecked state) */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d0d0d0; /* Grey background for unchecked state */
    border-radius: 34px;
    transition: .4s;
}

/* The circle indicator */
.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    right: 4px; /* Positioned on the right side (on state) */
    bottom: 3px;
    background-color: #1a3039; /* Dark blue/green color */
    border-radius: 50%;
    transition: .4s;
}

form {
    border: 2px solid var(--light-background-transparant);
    max-width: 1100px;
    padding: 10px 20px;
    border-radius: 30px;
}

/* When checked, make the background green */
input:checked + .slider {
    background-color: #c1e1c1; /* Light green background for checked state */
}

/* When unchecked, move the circle to the left */
input:not(:checked) + .slider:before {
    transform: translateX(-28px);
}

/* Optional: Add focus styles */
input:focus + .slider {
    box-shadow: 0 0 1px #c1e1c1;
}

/* Remove default focus styles */
input:focus {
    outline: none;
}

/* Custom focus styles that match your design */
input:focus + .slider {
    /* No additional styling for focus */
    box-shadow: none;
}

.toggle-switch, .slider, input {
    -webkit-appearance: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.count-cell {
    text-align: center;
}

.action-cell {
    text-align: center;
}

.edit-button, a.edit-button {
    background: var(--button-dark);
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 15px;
    margin: 0;
    box-sizing: border-box;
    aspect-ratio: 1; /* Forces square ratio */
    display: inline-flex;
}

.edit-button:hover {
    opacity: 0.8;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.border {
    border: 1px solid var(--text-muted);
    border-radius: var(--border-radius-small);
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

.leading-loose {
    line-height: 2rem;
}

.tabs {
    margin: 50px auto;
}

.tab-buttons {
    display: flex;
}

.tab-btn {
    font-size: small;
    background-color: transparent;
    border: 0;
    border-bottom: none;
    cursor: pointer;
    border-radius: 0;
    margin: 0;
    padding: 10px;
}

.tab-btn.active {
    border-bottom: 2px solid var(--button-primary-background);
}

.tab-panel {
    display: none;
    border-top: none;
}

.tab-panel.active {
    display: block;
}

.rounded-border {
    display: flex;
    flex-direction: column;
    border: 1px solid #dddddd33;
    padding: 20px 40px 40px 40px;
    margin-top: 20px;
    border-radius: 25px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    table {
        font-size: 14px;
    }

    table thead th {
        padding: 5px 10px;
    }

    table td, table th {
        padding: 10px;
        text-align: center;
    }

    table td:first-child {
        text-align: left;
    }

    .status-badge {
        padding: 8px 8px;
        font-size: 12px;
        min-width: 1px;
    }

    h1 {
        font-size: 26px;
    }
    .h1.large {
        font-size: 46px;
    }

    .hidden-small {
        display: none;
    }

    .popup {
        padding: 20px;
        width: calc(100% - 60px);
    }

    .header {
        flex-direction: column;
        align-items: normal;
    }

    .right {
        float: revert;
    }

    .flex-column-small {
        flex-direction: column;
    }

    .text-center-small {
        text-align: center;
    }

    .t-padded-small {
        padding-top: 15px;
    }
}

.clickable-row {
    position: relative;
}

.row-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    font-size: 0; /* Hide any text inside the link */
    opacity: 0; /* Make the link transparent */
}

/* Make sure other content in cells remains clickable */
.clickable-row td button {
    position: relative;
    z-index: 2;
}

.error {
    color: red;
    font-size: 0.9em;
}

.menu-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    color: var(--text-dark);
    background: var(--light-background);
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 1);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 5px 10px;
    line-height: 1.6;
}

.dropdown-menu a, .dropdown-menu a:visited, .dropdown-menu a:hover, .dropdown-menu a:active {
    color: var(--text-dark);
    display: block;
}

/* Show menu when checkbox is checked */
.menu-toggle:checked + .menu-button + .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-container:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}