/* ============================================
   QazQuality - Design 2.0 (Minty Fresh)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors - Mint & Turquoise */
    --primary: #26A69A;
    /* Teal 400 */
    --primary-light: #80CBC4;
    /* Teal 200 */
    --primary-dark: #00897B;
    /* Teal 600 */
    --secondary: #E0F2F1;
    /* Teal 50 */

    /* Functional Colors */
    --success: #66BB6A;
    --danger: #EF5350;
    --warning: #FFA726;
    --info: #29B6F6;

    /* Netural Colors */
    --dark: #263238;
    /* Blue Grey 900 */
    --text-primary: #37474F;
    /* Blue Grey 800 */
    --text-secondary: #546E7A;
    /* Blue Grey 600 */
    --gray-light: #CFD8DC;
    /* Blue Grey 100 */
    --white: #FFFFFF;
    --background: #F4F7F6;
    /* Very light grey/mint tint */

    /* UI Properties */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Layout & Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

main.container {
    padding-top: 2rem;
    padding-bottom: 4rem;
    min-height: calc(100vh - var(--nav-height) - 100px);
}

/* ============================================
   Navigation (Google Style)
   ============================================ */
.navbar {
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    /* Glassmorphism */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-brand-text {
    font-family: 'Outfit', sans-serif;
    /* Geometric, Google-like */
    font-size: 2rem;
    font-weight: 800;
    /* Deep modern color with a hint of mint in the highlights */
    background: linear-gradient(to right, #263238 0%, #26A69A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    transition: var(--transition);
    padding-bottom: 2px;
    /* Fix for cut-off descenders in some browsers */
}

.nav-brand-text:hover {
    opacity: 0.8;
}

.nav-public {
    display: flex;
    gap: 2rem;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-public::-webkit-scrollbar {
    display: none;
}

.nav-link-custom {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    white-space: nowrap;
    flex: 0 0 auto;
}

.nav-link-custom:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

/* Underline effect on hover */
.nav-link-custom::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s;
}

.nav-link-custom:hover::after {
    width: 100%;
}

/* Landing Page Overrides (White Text) */
.navbar-landing .nav-link-custom {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-landing .nav-link-custom:hover {
    color: rgba(255, 255, 255, 0.8);
}

.navbar-landing .nav-link-custom::after {
    background-color: white;
}

.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.nav-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.mobile-nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-nav-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #0f172a;
    transition: var(--transition);
}

.mobile-nav-backdrop {
    display: none;
}

.app-info-trigger {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.78);
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0;
    flex-shrink: 0;
}

.app-info-trigger:hover {
    background: rgba(235, 248, 246, 0.96);
    border-color: rgba(38, 166, 154, 0.5);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.app-info-trigger:focus-visible {
    outline: 2px solid rgba(38, 166, 154, 0.9);
    outline-offset: 2px;
}

.navbar-landing .app-info-trigger {
    background: rgba(4, 36, 46, 0.42);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.navbar-landing .app-info-trigger:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}

.app-info-popover {
    position: fixed;
    top: calc(var(--nav-height) + 10px);
    right: 1rem;
    width: min(92vw, 350px);
    border-radius: 16px;
    border: 1px solid rgba(67, 118, 124, 0.32);
    background:
        radial-gradient(140% 120% at 95% 0%, rgba(90, 214, 201, 0.22) 0%, rgba(90, 214, 201, 0.02) 42%, rgba(255, 255, 255, 0.92) 80%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 251, 250, 0.94) 100%);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    box-shadow: 0 18px 38px rgba(5, 41, 46, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    padding: 1.05rem 1rem 0.95rem;
    z-index: 1310;
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.app-info-popover[hidden] {
    display: none !important;
}

.app-info-popover::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(145deg, rgba(85, 206, 196, 0.58), rgba(84, 155, 195, 0.24), rgba(255, 255, 255, 0.32));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.app-info-popover.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.app-info-title {
    margin: 0;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-info-subtitle {
    margin: 0.1rem 0 0;
    color: #47666e;
    font-size: 0.73rem;
    font-weight: 600;
}

.app-info-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 0.58rem;
    position: relative;
    padding-right: 8.4rem;
}

.app-info-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28b7aa 0%, #0b6d86 100%);
    box-shadow: 0 0 0 4px rgba(40, 183, 170, 0.12);
    flex-shrink: 0;
}

.app-info-version {
    position: absolute;
    right: 0;
    top: 0;
    transform: none;
    border-radius: 999px;
    border: 1px solid rgba(38, 166, 154, 0.3);
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.18) 0%, rgba(17, 125, 142, 0.18) 100%);
    color: #0b6b7f;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.55rem;
    box-shadow: 0 4px 10px rgba(17, 125, 142, 0.14);
}

.app-info-text {
    margin: 0 0 0.5rem;
    color: #2d4650;
    font-size: 0.81rem;
    line-height: 1.42;
    text-align: center;
}

.app-info-divider {
    height: 1px;
    width: 100%;
    margin: 0.45rem 0 0.45rem;
    background: linear-gradient(90deg, rgba(32, 127, 140, 0.02) 0%, rgba(32, 127, 140, 0.3) 50%, rgba(32, 127, 140, 0.02) 100%);
}

.app-info-meta {
    margin: 0.25rem 0 0.15rem;
    color: #4c6370;
    font-size: 0.8rem;
    text-align: center;
}

.app-info-email {
    display: table;
    margin-top: 0.3rem;
    margin-left: auto;
    margin-right: auto;
    color: #0c7288;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(12, 114, 136, 0.36);
    transition: var(--transition);
}

.app-info-email:hover {
    color: #095e6f;
    border-bottom-color: rgba(9, 94, 111, 0.75);
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--secondary);
    color: var(--primary-dark);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--gray-light);
}

@media (max-width: 1200px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-brand-text {
        font-size: 1.6rem;
    }

    .nav-public {
        gap: 1rem;
    }

    .nav-link-custom {
        font-size: 0.8rem;
        letter-spacing: 0.03em;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 0.75rem;
    }

    .mobile-nav-open .navbar {
        z-index: 1210;
    }

    .nav-logo {
        height: 34px;
    }

    .nav-brand-text {
        font-size: 1.2rem;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        z-index: 1102;
        margin-left: 0;
    }

    .app-info-trigger {
        width: 36px;
        height: 36px;
        margin-left: 0;
        z-index: 1102;
    }

    .nav-controls {
        margin-left: auto;
        gap: 0.45rem;
        z-index: 1102;
    }

    .app-info-popover {
        top: calc(var(--nav-height) + 8px);
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .app-info-version {
        position: absolute;
        top: 0;
        right: 0;
        transform: none;
        margin-left: 0;
    }

    .navbar-landing .mobile-nav-toggle {
        border-color: rgba(255, 255, 255, 0.24);
        background: rgba(4, 36, 46, 0.55);
    }

    .navbar-landing .mobile-nav-toggle span {
        background: #ffffff;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: min(86vw, 360px);
        height: 100dvh;
        background: linear-gradient(180deg, #f7fcfb 0%, #edf8f6 100%);
        box-shadow: -16px 0 35px rgba(10, 35, 38, 0.2);
        border-left: 1px solid rgba(0, 0, 0, 0.06);
        transform: translateX(106%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 76px) 1rem 1.25rem;
        z-index: 1212;
        transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
    }

    .mobile-nav-open .nav-menu {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-nav-open .mobile-nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-nav-open .mobile-nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-open .mobile-nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(9, 27, 31, 0.46);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 1200;
    }

    .mobile-nav-open .mobile-nav-backdrop {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .nav-public,
    #authLinks {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-link-custom,
    .nav-link {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 46px;
        border-radius: 12px;
        border: 1px solid rgba(38, 166, 154, 0.16);
        background: rgba(255, 255, 255, 0.9);
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
        letter-spacing: 0.02em;
    }

    .mobile-nav-open .navbar-landing .nav-link-custom {
        color: #0f172a;
        text-shadow: none;
    }

    .mobile-nav-open .navbar-landing .nav-link-custom:hover {
        color: var(--primary-dark);
    }

    .nav-link-custom::after {
        display: none;
    }

    .nav-link-custom:hover,
    .nav-link:hover,
    .nav-link.active {
        transform: none;
        background: #e4f5f2;
        border-color: rgba(38, 166, 154, 0.35);
    }

    .nav-user {
        margin: 0.75rem 0 0;
        padding: 0.75rem 0 0;
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-trigger {
        width: 100%;
    }

    .nav-dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.08);
        margin-top: 0.35rem;
    }
}

/* ============================================
   Buttons & Inputs
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    /* Pill shaped */
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    text-decoration: none;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(38, 166, 154, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(38, 166, 154, 0.4);
    color: white;
}

.btn-secondary {
    background-color: white;
    color: var(--text-secondary);
    border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
    background-color: var(--secondary);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.btn-danger {
    background-color: #ffebee;
    color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #43A047;
    color: white;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #FB8C00;
    color: white;
}

/* Form Elements */
input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    color: var(--dark);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: inline-block;
    vertical-align: middle;
    accent-color: var(--primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.15);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-label {
    display: inline;
    margin: 0;
}

/* ============================================
   Cards & Surfaces
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--secondary);
}

.card-title {
    font-size: 1.25rem;
    color: var(--dark);
    margin: 0;
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: var(--secondary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #fafafa;
}

/* ============================================
   Specific Components
   ============================================ */

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #FFFFFF 100%);
    padding: 4rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero h1 {
    font-size: 3.5rem;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: var(--secondary);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Badges */
.badge {
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-warning {
    background: #FFF3E0;
    color: #EF6C00;
}

.badge-danger {
    background: #FFEBEE;
    color: #C62828;
}

.badge-info {
    background: #E1F5FE;
    color: #0277BD;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000;
    overflow: auto;
    background: rgba(38, 50, 56, 0.4);
    /* Darker overlay */
    backdrop-filter: blur(8px);
}

/* Remove gray overlay for fullscreen modals */
.modal:has(.modal-content-full) {
    background: transparent;
    backdrop-filter: none;
}

.modal-content {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--gray-light);
    padding: 1.5rem 2rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--dark);
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--gray-light);
    margin-top: auto;
}

/* Login/Auth */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem;
    border-radius: var(--radius-lg);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-dark);
}

/* Utils */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.flex-end {
    justify-content: flex-end;
}

/* ============================================
   Landing Page Styles (Polished)
   ============================================ */

/* Transparent Navbar for Landing Page */
.navbar-landing {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
}

.navbar-landing .nav-brand-text {
    background: none;
    -webkit-text-fill-color: initial;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar-landing .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.navbar-landing .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Landing Main Container */
.landing-main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
}

.hero-landing {
    position: relative;
    /* High-Quality Generated Image */
    background-image: url('/static/img/hero.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    /* Full screen height to include behind nav */
    width: 100%;
    /* Natural full width */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 0;
    /* Nav is absolute, no need for negative margin if main is at top */
    padding-top: 0;
    margin-bottom: 0;
    box-shadow: var(--shadow-float);
    overflow: hidden;
}


.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Professional Dark Gradient Overlay for max contrast */
    background: linear-gradient(135deg, rgba(16, 30, 35, 0.85) 0%, rgba(38, 166, 154, 0.4) 100%);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.hero-content-landing {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 900px;
    padding: 2rem;
    animation: fadeInUp 1s ease-out;
}

.main-title {
    font-size: 4.5rem;
    /* Massive, confident type */
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.main-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.auth-buttons-landing {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

/* Glassmorphism Buttons */
.auth-buttons-landing .btn {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    backdrop-filter: blur(10px);
}

.auth-buttons-landing .btn-primary {
    background: rgba(38, 166, 154, 0.9);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-buttons-landing .btn-primary:hover {
    background: #26A69A;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(38, 166, 154, 0.4);
}

.auth-buttons-landing .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-buttons-landing .btn-secondary:hover {
    background: white;
    color: var(--dark);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Footer Styles (Premium)
   ============================================ */
.footer-custom {
    background: #00332C;
    /* Deep Dark Teal */
    color: rgba(255, 255, 255, 0.8);
    padding: 5rem 0 2rem;
    margin-top: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
    flex: 1;
    min-width: 300px;
}

/* Brand Column needs to not stretch too wide */
.brand-col {
    max-width: 500px;
}

/* Contact Column aligned to the right for balance */
.contact-col {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 800;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Removed links-col styles */

.contact-col p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    /* Align icon/text to right */
}

/* ============================================
   Public Pages (Header & Construction)
   ============================================ */
.page-header {
    background: linear-gradient(135deg, #E0F2F1 0%, #FFFFFF 100%);
    padding: 6rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.breadcrumbs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.breadcrumbs a {
    color: var(--text-secondary);
    opacity: 0.7;
}

.breadcrumbs a:hover {
    color: var(--primary);
    opacity: 1;
}

.breadcrumbs span {
    opacity: 0.4;
}

.construction-state {
    text-align: center;
    padding: 4rem 1rem 8rem;
    max-width: 600px;
    margin: 0 auto;
}

.construction-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    display: inline-block;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.1));
}

.construction-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* ============================================
   Auth Pages (Split Layout)
   ============================================ */
.auth-body {
    background: white;
    /* Override default grey */
}

.auth-split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-art-side {
    flex: 1;
    background-image: url('/static/img/hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    color: white;
    display: none;
    /* Hidden on mobile by default */
}

@media (min-width: 992px) {
    .auth-art-side {
        display: flex;
        width: 35%;
    }
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 51, 44, 0.85) 0%, rgba(38, 166, 154, 0.6) 100%);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.auth-quote {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
}

.auth-quote blockquote {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.4;
    font-style: italic;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
}

.auth-quote p {
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    color: #ffffff;
}

.auth-branding {
    position: relative;
    z-index: 2;
}

.auth-logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 2.5rem;
    color: #ffffff !important;
    text-shadow: 0 4px 20px rgba(0,0,0,0.6);
    line-height: 1;
    margin-bottom: 1rem;
}

.auth-tagline {
    color: #ffffff !important;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
}

.login-wrapper {
    width: 100%;
    max-width: 650px;
    padding: 2rem;
}

.login-wrapper--narrow {
    max-width: 460px;
    margin: 0 auto;
    padding: 2rem 1.75rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
}

.login-wrapper--narrow .form-floating-custom {
    margin-bottom: 1.15rem;
}

.login-wrapper--narrow .form-floating-custom input {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1.5px solid #d6dee8;
    background: #ffffff;
    font-size: 0.98rem;
}

.login-wrapper--narrow .form-floating-custom input:hover {
    border-color: #b9c8d7;
}

.login-wrapper--narrow .form-floating-custom input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.14), 0 10px 24px rgba(38, 166, 154, 0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    height: 60px;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Form Styles */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-floating-custom input {
    width: 100%;
    padding: 1rem 1rem 1rem 0;
    /* No left padding for minimal look, or normal */
    padding: 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #FAFAFA;
}

.form-floating-custom input:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.1);
}

.form-floating-custom input::placeholder {
    color: transparent;
    transition: color 0.2s;
}

.form-floating-custom input:focus::placeholder {
    color: #9E9E9E;
}

.form-floating-custom label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: #9E9E9E;
    transition: all 0.2s;
    pointer-events: none;
    background: transparent;
}

.form-floating-custom input:focus+label,
.form-floating-custom input:not(:placeholder-shown)+label {
    top: 0;
    font-size: 0.8rem;
    background: white;
    padding: 0 0.4rem;
    color: var(--primary);
    transform: translateY(-50%);
}

.btn-login {
    width: 100%;
    background: var(--dark);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-login:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(38, 166, 154, 0.3);
}

.passkey-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0.15rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    font-weight: 700;
    color: #0f5d56;
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.2) 0%, rgba(38, 166, 154, 0.08) 100%);
    border: 1.5px solid rgba(38, 166, 154, 0.45);
    box-shadow: 0 8px 18px rgba(38, 166, 154, 0.15);
    transition: all 0.25s ease;
}

.passkey-cta:hover {
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.28) 0%, rgba(38, 166, 154, 0.14) 100%);
    border-color: var(--primary);
    color: #0c4f49;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(38, 166, 154, 0.22);
}

.passkey-cta:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.22), 0 10px 24px rgba(38, 166, 154, 0.2);
}

@media (max-width: 640px) {
    .login-wrapper--narrow {
        max-width: 100%;
        padding: 1.35rem 1rem;
        border-radius: 16px;
    }
}

.auth-links {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
}/* Dashboard Styles */

/* Page Header */
.dashboard-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--dark);
    margin: 0;
}

.dashboard-subtitle {
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* Stats Cards */
.stats-grid-custom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card-custom {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.1), rgba(38, 166, 154, 0.05));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-content h3 {
    margin: 0;
    font-size: 1.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.1;
}

.stat-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Action Grid (Menu) */
.action-section-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.action-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    display: block;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.action-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.action-card:hover .action-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.backup-ops .action-card {
    padding: 1.5rem;
}

.backup-ops .action-card-icon {
    font-size: 2.1rem;
    margin-bottom: 0.75rem;
}

.backup-ops .action-card:hover .action-card-icon {
    transform: scale(1.05) rotate(3deg);
}

.backup-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.backup-toggle {
    display: grid;
    grid-template-columns: 18px auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(38, 166, 154, 0.04);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: var(--dark);
}

.backup-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.backup-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 1.25rem;
    align-items: end;
}

@media (max-width: 1100px) {
    .backup-settings-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }
}

@media (max-width: 640px) {
    .backup-settings-grid {
        grid-template-columns: 1fr;
    }
}

.action-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.action-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Premium Tables */
.table-premium-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
}

.table-premium thead th {
    background: #F8F9FA;
    padding: 1rem 1.5rem;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E0E0E0;
}

.table-premium tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F0F0F0;
    font-size: 0.95rem;
    color: var(--dark);
}

.table-premium tbody tr:last-child td {
    border-bottom: none;
}

.table-premium tbody tr:hover {
    background-color: #FAFAFA;
}

.status-badge {
    padding: 0.35em 0.8em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-success {
    background: rgba(38, 166, 154, 0.1);
    color: var(--primary);
}

.status-danger {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
}

.status-warning {
    background: rgba(255, 167, 38, 0.1);
    color: #FFA726;
}

/* ============================================
   Modern Selection Cards & Wizard UI (2024 Style)
   ============================================ */

/* Selection Grid - Card-based selector replacement */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.selection-card {
    position: relative;
    background: white;
    border: 2px solid #E8F5F3;
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.selection-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(38, 166, 154, 0.15);
}

.selection-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #E0F7FA 0%, #E8F5E9 100%);
    box-shadow: 0 8px 20px rgba(38, 166, 154, 0.2);
}

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(420px, calc(100vw - 36px));
}

.toast {
    background: white;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
}

.toast-message {
    font-size: 0.95rem;
    color: var(--dark);
    line-height: 1.4;
}

.toast-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 10px;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--dark);
}

.toast-success {
    border-left: 4px solid #26A69A;
}

.toast-error {
    border-left: 4px solid #EF5350;
}

.selection-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.selection-card-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.selection-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    margin: 0;
}

.selection-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Modern Wizard Steps Progress */
.wizard-progress-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0 3rem;
    padding: 0 2rem;
}

.wizard-step-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
}

.wizard-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #E8F5F3;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    border: 3px solid transparent;
    position: relative;
    z-index: 2;
}

.wizard-step-modern.active .wizard-step-number {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(38, 166, 154, 0.4);
    transform: scale(1.1);
}

.wizard-step-modern.completed .wizard-step-number {
    background: var(--success);
    color: white;
}

.wizard-step-modern.completed .wizard-step-number::before {
    content: '✓';
}

.wizard-step-label {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 100px;
}

.wizard-step-modern.active .wizard-step-label {
    color: var(--primary);
    font-weight: 600;
}

.wizard-step-line {
    width: 80px;
    height: 4px;
    background: #E8F5F3;
    margin: 0 0.5rem;
    border-radius: 2px;
    position: relative;
    top: -18px;
}

.wizard-step-line.completed {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

/* Modern Form Groups */
.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-group-modern label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
}

.form-group-modern label .step-badge {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Premium Input Fields */
.input-premium {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #E8F5F3;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-premium:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.1);
}

.input-premium::placeholder {
    color: #B0BEC5;
}

/* Floating Label Effect */
.floating-label-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.floating-label-group input {
    padding: 1.5rem 1rem 0.75rem;
}

.floating-label-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 1rem;
    color: #90A4AE;
    transition: all 0.2s ease;
    pointer-events: none;
}

.floating-label-group input:focus + label,
.floating-label-group input:not(:placeholder-shown) + label {
    top: 0.35rem;
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

/* Modern Modal Wizard */
.modal-wizard {
    max-width: 700px;
    border-radius: 24px;
    overflow: hidden;
}

.modal-wizard .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border: none;
}

.modal-wizard .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-wizard .modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-wizard .modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.modal-wizard-body {
    padding: 2rem;
}

/* Step Navigation Dots */
.step-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E0E0E0;
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

.step-dot.completed {
    background: var(--success);
}

/* Shimmer Animation for Loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Glass Effect Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

/* Button Block */
.btn-block {
    display: block;
    width: 100%;
}

/* Device Item Premium */
.device-item-premium {
    background: white;
    border: 1px solid #E8F5F3;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.device-item-premium:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.device-item-premium .device-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-item-premium .device-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #E0F7FA, #E8F5E9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.device-item-premium .device-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.device-item-premium .device-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.device-item-premium .device-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tooltip Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1rem;
}

/* Section Headers with gradients */
.section-header-gradient {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
/* Premium Modal Styles for Admin Menu */
.glass-modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.2);
    padding: 0;
    overflow: hidden;
    width: 800px;
    max-width: 95vw;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header-premium {
    background: linear-gradient(135deg, rgba(38,166,154,0.08) 0%, rgba(255,255,255,0) 100%);
    padding: 2.5rem 2.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.modal-icon-wrapper {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 12px 24px rgba(38, 166, 154, 0.15);
    color: var(--primary);
    border: 1px solid rgba(38, 166, 154, 0.1);
}

.modal-title-premium {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.modal-close-premium {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
}

.modal-close-premium:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.premium-form {
    padding: 2.5rem;
}

.input-group-premium {
    margin-bottom: 2rem;
    position: relative;
}

.form-floating-custom input,
.form-floating-custom textarea,
.form-floating-custom select {
    width: 100%;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 1.25rem;
    font-size: 1.05rem;
    color: var(--dark);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500;
}

.form-floating-custom input:hover,
.form-floating-custom textarea:hover,
.form-floating-custom select:hover {
    background: white;
    border-color: #cbd5e1;
}

.form-floating-custom input:focus,
.form-floating-custom textarea:focus,
.form-floating-custom select:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.15);
    outline: none;
}

.form-floating-custom select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-top: 1.55rem;
    padding-bottom: 0.85rem;
    line-height: 1.2;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 24px) calc(50% + 2px), calc(100% - 18px) calc(50% + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-floating-custom label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding: 0 0.5rem;
    color: #64748b;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    font-weight: 400;
}

.form-floating-custom textarea + label {
    top: 1.25rem;
    transform: none;
}

.form-floating-custom select + label {
    top: -0.75rem;
    left: 1rem;
    transform: none;
    font-size: 0.85rem;
    color: var(--primary);
    background: white;
    font-weight: 600;
    border-radius: 6px;
}

.form-floating-custom input:focus + label,
.form-floating-custom input:not(:placeholder-shown) + label,
.form-floating-custom textarea:focus + label,
.form-floating-custom textarea:not(:placeholder-shown) + label {
    top: -0.75rem;
    left: 1rem;
    transform: none;
    font-size: 0.85rem;
    color: var(--primary);
    background: white;
    font-weight: 600;
    border-radius: 6px;
}

.form-row-premium {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem; /* Added margin to match regular fields */
}

.half-width {
    flex: 1;
}

.form-actions-premium {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: #64748b;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--dark);
}

.btn-premium-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #0d9488 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 12px 24px -8px rgba(38, 166, 154, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-premium-gradient:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 20px 32px -10px rgba(38, 166, 154, 0.5);
}

.btn-premium-gradient:active {
    transform: translateY(0) scale(0.98);
}

/* Premium Settings Modal Styles */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 2rem;
    overflow-x: auto; /* Allow scrolling if many tabs */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-tabs::-webkit-scrollbar {
    height: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(38, 166, 154, 0.05); /* very light primary bg */
    border-radius: 8px 8px 0 0;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px; /* Align exactly on border */
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.settings-content {
    padding: 0 0 2rem; /* Adjusted padding */
    min-height: 400px;
}

.settings-tab {
    padding: 0 2.5rem;
    animation: fadeIn 0.3s ease-out;
}

.dept-ms {
    position: relative;
}

.dept-ms-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.dept-ms-control:hover {
    border-color: rgba(38, 166, 154, 0.5);
    box-shadow: var(--shadow-md);
}

.dept-ms.open .dept-ms-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.12), var(--shadow-md);
}

.dept-ms-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.dept-ms-placeholder {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dept-ms-caret {
    color: var(--text-secondary);
    font-weight: 700;
    flex: 0 0 auto;
    user-select: none;
}

.dept-ms-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgba(38, 166, 154, 0.10);
    border: 1px solid rgba(38, 166, 154, 0.25);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.dept-ms-chip-x {
    border: none;
    background: transparent;
    color: rgba(38, 50, 56, 0.6);
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.dept-ms-chip-x:hover {
    color: rgba(38, 50, 56, 0.9);
}

.dept-ms-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 30;
    overflow: hidden;
    display: none;
}

.dept-ms.open .dept-ms-dropdown {
    display: block;
}

.dept-ms-search {
    padding: 10px;
    border-bottom: 1px solid #E2E8F0;
    background: rgba(244, 247, 246, 0.7);
}

.dept-ms-search-input {
    width: 100%;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
}

.dept-ms-options {
    max-height: 260px;
    overflow: auto;
    padding: 6px;
}

.dept-ms-option {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
}

.dept-ms-option:hover {
    background: rgba(38, 166, 154, 0.06);
}

.dept-ms-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    justify-self: start;
}

.dept-ms-option-code {
    font-weight: 800;
    color: var(--dark);
    font-size: 0.95rem;
    min-width: 5ch;
    justify-self: start;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tab-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--dark);
    font-weight: 700;
}

/* Premium Lists inside Settings */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem; /* Space for scrollbar */
}

.settings-item {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.settings-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.08);
}

.settings-item span {
    font-weight: 500;
    color: var(--dark);
}

.settings-item strong {
    color: var(--primary);
}

/* Add Forms in Settings */
.add-form, .batch-add-form {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #E2E8F0;
    display: flex;
    gap: 1rem;
    align-items: center;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.add-form input, 
.batch-add-form input,
.batch-add-form select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.add-form input:focus,
.batch-add-form input:focus,
.batch-add-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Fullscreen Modal Variant */
.modal-content-full {
    width: 98vw !important;
    height: 95vh !important;
    max-width: none !important;
    display: flex;
    flex-direction: column;
    margin: 0 auto; /* Center horizontal */
}

/* Ensure no gray bleed from base styles */
.glass-modal-content {
    border: 1px solid rgba(255,255,255,0.6) !important;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15) !important;
    background-clip: padding-box; /* Prevent border bleed */
}

/* Absolute override for glass modal to fix corner bleeding */
.glass-modal-content {
    background-color: rgba(255, 255, 255, 0.98) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Ensure children respecting border radius */
.glass-modal-content > * {
    z-index: 1;
    position: relative;
}

/* Fix for gray corners artifact: Disable backdrop-filter on the content box to prevent render bleeding */
.glass-modal-content {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: #ffffff !important; /* Solid white to be safe */
    transform: translateZ(0); /* Force GPU layer */
}

/* Radical fix for gray corners: remove shadow and border, force white background */
.glass-modal-content {
    box-shadow: none !important;
    border: none !important;
    background-color: #ffffff !important;
    background-clip: border-box !important;
    outline: none !important;
}

/* True Fullscreen Modal for Settings: Removes rounded corners and gaps to eliminate 'gray corners' artifact */
.modal-content-full {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
}

/* Adjust header for fullscreen */
.modal-content-full .modal-header-premium {
    padding: 1.5rem 2rem !important; /* Slightly more compact header for fullscreen */
    border-radius: 0 !important;
    background: white !important; /* Solid white header to match body */
    border-bottom: 1px solid #e2e8f0;
}

/* FINAL FIX for Settings Modal: Restore rounded corners with nested radius to prevent gray artifacts */
.modal-content-full {
    width: 96vw !important;
    height: 92vh !important;
    max-width: 1800px !important;
    
    /* Restore aesthetic rounded corners */
    border-radius: 24px !important;
    margin: 2vh auto !important;
    
    /* Clean styling */
    background: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.1) !important; /* Subtle inner border */
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.3) !important; /* Deep shadow */
    
    /* Layout */
    display: flex;
    flex-direction: column;
    overflow: hidden !important; /* Clip content */
    transform: translateZ(0); /* GPU composition */
}

/* Explicitly round the header corners to match container (Prevents corner bleeding) */
.modal-content-full .modal-header-premium {
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    background: #ffffff !important; /* Solid white header to avoid transparency issues */
    border-bottom: 1px solid #f1f5f9;
    padding: 2rem 3rem !important;
    z-index: 2;
}

/* Clean content area */
.modal-content-full .settings-content {
    background: #ffffff !important;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    padding-bottom: 2rem;
}

/* ABSOLUTE FINAL FIX V2: Simplifying styling to eliminate rendering artifacts */
.modal-content-full {
    /* Precise Geometry */
    width: 96vw !important;
    height: 92vh !important;
    max-width: 1800px !important;
    margin: 4vh auto !important;
    
    /* Clean Visuals */
    background-color: #ffffff !important;
    border-radius: 20px !important;
    border: none !important;
    outline: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    
    /* Clipping Logic - The most robust way */
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    
    /* Reset GPU hacks causing clipping issues */
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
}

/* Ensure children are strictly rectangular and clipped by parent */
.modal-content-full .modal-header-premium {
    border-radius: 0 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    z-index: 2;
}

.modal-content-full .settings-content {
    border-radius: 0 !important;
    background: #ffffff !important;
    flex-grow: 1;
    overflow-y: auto;
}

/* TRUE FULLSCREEN FIX: Remove all margins and make 100% to eliminate gray overlay visibility */
.modal-content-full {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    
    /* Square corners for true fullscreen (no gray bleeding) */
    border-radius: 0 !important;
    
    /* Clean white */
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    
    /* Layout */
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

/* Also hide the gray overlay for settings modal specifically */
#settingsModal.modal {
    background: transparent !important;
    backdrop-filter: none !important;
}

/* FINAL SOLUTION: Rounded corners with transparent overlay to prevent gray artifacts */
.modal-content-full {
    width: 98vw !important;
    height: 98vh !important;
    max-width: none !important;
    margin: 1vh auto !important;
    
    /* Beautiful rounded corners */
    border-radius: 24px !important;
    
    /* Clean white */
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    
    /* Layout */
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

/* Make overlay transparent for settings modal - this prevents gray corners */
#settingsModal.modal {
    background: rgba(255, 255, 255, 0.95) !important; /* White semi-transparent instead of gray */
    backdrop-filter: blur(10px) !important;
}

/* Final fix for profile modal scrolling and visibility */
body.modal-open { overflow: hidden !important; padding-right: 15px; }
.modal { display: none; z-index: 100001 !important; overflow-y: auto !important; padding: 0 !important; }
.modal-content { margin: 60px auto !important; width: 95% !important; max-width: 800px !important; overflow: visible !important; }
@media (max-width: 768px) { .modal-content { margin: 20px auto !important; } }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.filter-input {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    color: var(--dark);
    transition: var(--transition);
    outline: none;
    min-width: 200px;
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.15);
}

/* Sortable Table Headers */
.table-premium thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2.5rem;
    transition: background 0.2s, color 0.2s;
}

.table-premium thead th.sortable:hover {
    background: white;
    color: var(--primary);
}

.table-premium thead th.sortable::after {
    content: '↕';
    position: absolute;
    right: 1rem;
    opacity: 0.2;
    font-size: 1rem;
    transition: var(--transition);
}

.table-premium thead th.sortable.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary);
}

.table-premium thead th.sortable.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary);
}

/* Table Action Buttons Layout Fix - ensures icons are in 1-2 rows instead of a column */
.user-actions, 
.actions-cell,
.request-actions,
.actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    min-width: 140px !important;
}

.table-premium .btn-sm {
    padding: 0.4rem 0.6rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

/* Dropdown Menu Styles (Added for Admin Menu) */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.nav-dropdown:hover .nav-dropdown-trigger {
    background-color: var(--secondary);
    color: var(--primary-dark);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    z-index: 1001;
    margin-top: 0.5rem;
    border: 1px solid rgba(0,0,0,0.05);
    animation: dropdownFadeIn 0.2s ease-out;
}

.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    width: 100%;
    height: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content .nav-link {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: left;
}

.nav-dropdown-content .nav-link:hover {
    background-color: var(--secondary);
    color: var(--primary-dark);
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Premium Row Cards for Programs
   ============================================ */
.program-row-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    gap: 2rem;
    transition: all 0.3s ease;
}

.program-row-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(38, 166, 154, 0.12);
    border-color: rgba(38, 166, 154, 0.2);
}

.program-row-card.approved {
    border-left: 4px solid var(--primary);
}

.prc-main {
    flex: 1;
    min-width: 250px;
}

.prc-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.prc-title h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.prc-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.prc-meta {
    display: flex;
    gap: 2rem;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.prc-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.prc-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    font-weight: 600;
}

.prc-meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.prc-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 220px;
}

@media (max-width: 768px) {
    .program-row-card {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    .prc-meta {
        justify-content: space-around;
        gap: 1rem;
    }
    .prc-actions {
        justify-content: stretch;
    }
    .prc-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mini-badges for action buttons */
.relative-pos {
    position: relative !important;
}

.badge-mini {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--danger);
    color: var(--white);
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.btn-confirm-cancel, .btn-confirm-ok {
    outline: none !important;
    font-family: 'Inter', sans-serif;
    font-size: 1rem !important; /* Ensure same text size */
}

.btn-confirm-cancel {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-confirm-cancel:hover, .btn-confirm-cancel:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-confirm-ok {
    padding: 10px 28px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 10px 15px -3px rgba(38, 166, 154, 0.3);
    border: none;
    cursor: pointer;
}

.btn-confirm-ok:hover, .btn-confirm-ok:focus {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(38, 166, 154, 0.4);
}


/* Unified Program Card Styles */
.program-row-card.rejected {
    border-left: 4px solid var(--danger) !important;
}

.prc-admin-note {
    background: #fff5f5;
    border: 1px dashed #feb2b2;
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #c53030;
    line-height: 1.5;
}

.prc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.badge-info-light {
    background: var(--secondary);
    color: var(--primary-dark);
}

.badge-primary {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* =====================
   Results Entry Page
   ===================== */
.program-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-light);
    box-shadow: var(--shadow-md);
}

.program-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.program-section-header h2 {
    margin: 0 0 0;
    font-size: 1.4rem;
    color: var(--dark);
    font-weight: 700;
}

.program-cycle-badge {
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(38, 166, 154, 0.2);
}

.periods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.7rem;
}

.period-card {
    background: var(--secondary);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 138px;
}

.period-card:hover {
    border-color: var(--primary);
    background: #fff;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.period-card.completed {
    border-color: var(--success);
    background: #f0fdf4;
}

.period-card.completed::after { content: none; }

.period-card.overdue {
    border-color: rgba(239, 68, 68, 0.5);
    background: #fff5f5;
}

.period-card.overdue .period-card-date { color: #dc2626 !important; font-weight: 600; }

.period-card.urgent {
    border-color: rgba(245, 158, 11, 0.5);
    background: #fffbeb;
}

.period-card.urgent .period-card-date { color: #d97706 !important; font-weight: 600; }

.period-card.soon {
    border-color: rgba(59, 130, 246, 0.5);
    background: #eff6ff;
}

.period-card.soon .period-card-date { color: #2563eb !important; font-weight: 600; }

.period-card-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--dark);
    margin-bottom: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.period-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.period-card-icons {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.period-card-date-primary {
    margin-top: auto;
    margin-bottom: 0.35rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.period-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.25rem;
}

.period-card-status-compact {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
}

.period-card-progress {
    background: var(--gray-light);
    border-radius: 6px;
    height: 4px;
    overflow: hidden;
    margin-top: 0.1rem;
}

.period-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.6s ease;
}

.period-card-status {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 0.45rem;
    font-weight: 700;
}

.period-card-comment {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(20, 32, 49, 0.08);
    border: 1px solid rgba(20, 32, 49, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    line-height: 1;
    position: relative;
    cursor: help;
}

.period-card-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-width: 320px;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.86rem;
    line-height: 1.35;
    font-weight: 500;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-3px);
    transition: opacity 0.08s ease, transform 0.08s ease;
    pointer-events: none;
    z-index: 30;
}

.period-card-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #0f172a;
    transform: rotate(45deg);
}

.period-card-comment:hover .period-card-tooltip,
.period-card-comment:focus .period-card-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.period-card-done {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    border: 1px solid rgba(34, 197, 94, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 768px) {
    .periods-grid {
        grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    }

    .period-card {
        padding: 0.68rem;
        min-height: 128px;
    }

    .period-card-tooltip {
        min-width: 170px;
        max-width: 240px;
        font-size: 0.8rem;
    }

    .period-card-date-primary {
        font-size: 1.14rem;
    }
}

/* Device Result Form (Modal) - Compact Version */
.device-result-form {
    background: #fafafa;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-light);
    transition: all 0.2s;
    position: relative;
}

.device-result-form.has-result {
    border-color: rgba(102, 187, 106, 0.4);
    background: #f0fdf4;
}

.device-result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap; /* Keep it on one line */
}

.device-result-icon {
    width: 32px;
    height: 32px;
    background: var(--secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    border: 1px solid var(--gray-light);
    flex-shrink: 0;
}

.device-result-form.has-result .device-result-icon {
    background: #dcfce7;
    color: var(--success);
    border-color: rgba(102, 187, 106, 0.3);
}

.device-result-info { 
    flex: 1; 
    min-width: 0; /* Allow shrinking */
}

.device-result-info h4 { 
    margin: 0; 
    font-size: 0.95rem; 
    color: var(--dark); 
    font-weight: 600;
    line-height: 1.3;
}

.device-result-info p { 
    margin: 0; 
    font-size: 0.75rem; 
    color: var(--text-secondary);
    line-height: 1.4;
}

.comment-toggle-btn {
    background: var(--secondary);
    color: #94a3b8;
    border: 1px solid var(--gray-light);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.comment-toggle-btn:hover {
    background: #e2e8f0;
    color: var(--dark);
}

.comment-toggle-btn.has-comment {
    background: #eff6ff;
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.comment-box-wrapper {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-light);
    display: none; /* Hidden by default */
}

.comment-box-wrapper.active {
    display: block;
    animation: er-fade-down 0.2s ease-out;
}

@keyframes er-fade-down {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-inputs-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-left: auto;
}

.input-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-label-small {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-input {
    width: 90px;
    background: #fff;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.5rem;
    color: var(--dark);
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s;
}

.result-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.12);
}

.result-input.has-value {
    border-color: var(--success);
    color: var(--primary-dark);
}

.result-input::-webkit-inner-spin-button,
.result-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.results-scroll-area {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sample-tabs-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
}

.sample-tab-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sample-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.sample-tab-btn.active {
    background: linear-gradient(135deg, #e0f7fa 0%, #e8f5e9 100%);
    border-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.18);
}

.sample-panel {
    display: none;
}

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

.analyte-section-title {
    margin: 1.5rem 0 1rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
}

.analyte-section-subtitle {
    margin: -0.5rem 0 0.85rem;
    color: #5f7484;
    font-size: 0.86rem;
    font-weight: 600;
}

.analit-result-section { margin-bottom: 1.5rem; }

.empty-programs {
    text-align: center;
    padding: 5rem 2rem;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-light);
}

.empty-programs h3 { margin-bottom: 0.75rem; color: var(--dark); }

/* Spinner */
.spinner-small {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: er-spinner .75s linear infinite;
    margin-right: 0.5rem;
}

@keyframes er-spinner { to { transform: rotate(360deg); } }
