/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global Variables */
:root {
    /* Spacing System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 40px;
    --space-5xl: 48px;
    --space-6xl: 64px;
    --space-7xl: 80px;

    /* Border Radius System */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Layout */
body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100dvh;
    padding: 0;
    margin: 0;
}

body:has(.main-nav[aria-hidden="false"]) {
    overflow: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Header */
header {
    text-align: center;
    padding: var(--space-4xl) 0 var(--space-4xl);
    background: linear-gradient(to bottom, var(--surface) 0%, transparent 100%);
    /* margin-bottom: var(--space-3xl); */
}

/* Navigation */
.main-nav {
    margin: var(--space-3xl) auto;
    max-width: 720px;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2xl);
    list-style: none;
}

.nav-link {
    font-size: 1.1rem;
    font-weight: 600;
    padding: var(--space-md) var(--space-md);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(243, 215, 50, 0.12);
    color: var(--primary);
    transform: translateY(-1px);
}

/* --- nav start --- */
.loggedin {
    text-align: left;
    position: relative;
    top: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.header-inner {
    display: flex;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-3xl);
    height: 72px;
    gap: var(--space-xl);
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
    cursor: pointer;
}

header.loggedin .logo {
    height: 38px;
    width: auto;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.02em;
}

/* Quick nav */
.quick-nav {
    flex: 1;
}
.quick-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin: 0;
    padding: 0;
    list-style: none;
}

.quick-nav .nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 550;
    font-size: 1.05rem;
    white-space: nowrap;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.quick-nav .nav-link:hover,
.quick-nav .nav-link:focus {
    background: var(--surface-alt);
    color: var(--primary);
}

/* Apps toggle (mega menu trigger) */
.apps-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 550;
}

.apps-toggle svg.chevron {
    transition: transform var(--transition-normal);
}

.apps-toggle[aria-expanded="true"] svg.chevron {
    transform: rotate(180deg);
}

/* Mega menu */
.mega-menu {
    position: absolute;
    top: calc(100% + 1px);
    right: 50%;
    transform: translateX(50%);
    min-width: 960px;
    background: var(--bg);
    padding: var(--space-4xl);
    display: none;
    z-index: 1000;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.apps-toggle[aria-expanded="true"] + .mega-menu {
    display: block;
}

.mega-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2xl) var(--space-xl);
}

.mega-columns h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    font-weight: 700;
}

.mega-columns ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-columns a {
    display: block;
    padding: var(--space-sm);
    color: var(--text);
    text-decoration: none;
}

.mega-columns a:hover {
    color: var(--primary);
}

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* Mobile sidebar */
header.loggedin .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: 70%;
    max-width: 380px;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    background: var(--surface);
    padding: var(--space-5xl) var(--space-lg) var(--space-6xl);
    z-index: 950;
    overflow-y: auto;
}

header.loggedin .main-nav[aria-hidden="false"] {
    transform: translateX(0);
}

header.loggedin .main-nav .group {
    margin-bottom: 2em;
}

header.loggedin .main-nav h4 {
    color: var(--primary);
}

header.loggedin .main-nav .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.nav-list .nav-link {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 550;
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-xs) 0;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.nav-list .nav-link:hover,
.nav-list .nav-link:focus {
    background: var(--surface-alt);
    color: var(--primary);
}

/* Mobile / tablet adjustments */
@media (max-width: 980px) {
    header.loggedin .header-inner {
        justify-content: space-between;
    }
    .apps-menu-wrapper {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 620px) {
    .quick-nav {
        display: none;
    }
    header {
        padding: var(--space-md) 0 var(--space-md);
    }
}

/* Overlay when mobile menu open */
body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--bg-alt);
    z-index: 800;
    transition: opacity var(--transition-normal);
    opacity: 0;
    pointer-events: none;
}

body.menu-open::before {
    opacity: 1;
    pointer-events: auto;
}
/* --- nav end ---*/

hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: var(--space-3xl) 0;
    opacity: 0.7;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    color: var(--primary);
    font-weight: 700;
}

h1,
h2,
.user-welcome {
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.6;
    letter-spacing: 1px;
}

header .name {
    display: flex;
    gap: 1em;
    max-width: min-content;
    margin: 0 auto;
    scale: 0.9;
}

header .name img.logo,
header .name h1 {
    flex: 1;
}
header .name h1 {
    font-size: 3.2rem;
    margin-top: 0.8rem;
    display: inline-block;
}

.user-welcome .user {
    color: var(--primary);
}

img.logo {
    max-width: 64px;
    margin: 0 auto;
}

.tagline {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto;
    padding-top: var(--space-md);
}

/* Link Styling */
a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color var(--transition-fast);
    padding: var(--space-xs) 0;
    border-radius: var(--radius-sm);
}

a:hover {
    color: #ffed4e;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    background: rgba(243, 215, 50, 0.1);
}

a[target="_blank"]::after,
a[href^="https://"]::after {
    /* \2197 is the Unicode for the North East Arrow */
    content: "\2197";

    /* Positioning it like a superscript */
    font-size: 0.75em; /* Makes it smaller than the text */
    vertical-align: super; /* Lifts it to the top of the line */
    margin-left: 2px; /* Adds a tiny bit of breathing room */

    /* Optional: ensure it doesn't underline if the link does */
    text-decoration: none;
    display: inline-block;
}
/* Selects any link ending in .html */
a[href$=".html"]::after {
    content: "\2398"; /* Unicode for a Page/Document icon */
    font-size: 0.8em;
    vertical-align: super;
    margin-left: 4px;
    text-decoration: none;
    display: inline-block;
}

a.strike {
    text-decoration: line-through;
}

.center {
    text-align: center;
}

/* Buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-top: var(--space-3xl);

    justify-content: center;
}

.btn {
    padding: var(--space-lg) var(--space-2xl);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-alt);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--premium-text);
}

/* Info Blocks */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-xl) 0;
}

.info-item {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal);
}

.info-label {
    color: var(--primary);
}

.info-value {
    white-space: nowrap;
}

.info-value:has(.alias),
.info-value .label {
    color: var(--muted);
}

.info-value .alias {
    color: var(--primary);
}

.info-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

/* Protocol Grid */
.protocols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-3xl);
    margin: var(--space-4xl) 0;
}

.protocol-column {
    background: linear-gradient(to bottom, var(--surface) 0%, var(--surface-alt) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.protocol-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-md);
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.protocol-title .info {
    color: var(--muted);
}

/* App Cards */
.app-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.app-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xl);
    background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.app-row:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(243, 215, 50, 0.1);
}

.app-icon,
.app-icon img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--primary-text);
    font-weight: bold;
}

.app-content {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
    color: var(--primary);
}

.app-name a {
    color: var(--muted);
    padding: var(--space-sm) var(--space-sm);
    vertical-align: super;
    font-size: 0.75em;
}

.app-desc {
    line-height: 1.6;
    margin: var(--space-md) 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* Tags */
.platform-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.tag {
    font-size: 0.8rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.tag:hover {
    transform: scale(1.05);
}

/* App Links */
.app-links {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: var(--space-md);
}

.login-title {
    margin-bottom: 1.2rem;
    text-align: center;
}

.mega-menu .login-title {
    text-align: left;
}

/* Inputs */
.login-form {
    max-width: 400px;
    margin: 0 auto !important;
    background: var(--surface);
    padding: var(--space-5xl) var(--space-3xl) !important;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

label {
    display: block;
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 600;
}

input:not([type="checkbox"]) {
    width: 100%;
    padding: var(--space-lg);
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: var(--space-xl);
    transition: all var(--transition-normal);
}

input[type="checkbox"] {
    margin-right: var(--space-lg);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--premium-text);
    background: var(--surface-alt);
}

/* Error Box */
.error {
    background: linear-gradient(135deg, #3f1515 0%, #5e1a1a 100%);
    color: #fda4af;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2xl);
    border-left: 4px solid #f87171;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(120, 53, 53, 0.3);
}

/* Footer */
footer {
    text-align: center;
    margin-top: var(--space-2xl);

    /*border-top: 1px solid var(--border);*/
    padding: var(--space-3xl) 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 2;
}

footer a {
    margin: 0 1em;
    padding: 0.2em 0.4em;
}

/* Utility Classes */
.card {
    padding: var(--space-xs);
    margin: var(--space-2xl) var(--space-lg);
}

.separator {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: var(--space-3xl) 0;
}

/* Mobile */
@media (max-width: 568px) {
    body {
        padding: 0;
    }

    .container:has(.login-form) {
        padding: 0 var(--space-lg);
    }

    header {
        padding: var(--space-sm) 0 var(--space-sm);
    }

    h1 {
        font-size: 2rem;
    }

    .buttons {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: var(--space-md);
        margin-top: var(--space-2xl);
    }

    .btn {
        min-width: auto;
        padding: var(--space-lg) var(--space-md);
        width: 100%;
        text-align: center;
    }

    .protocol-column,
    .app-row,
    .info-item {
        border: none;
        box-shadow: none;

        &:hover {
            box-shadow: none;
        }
    }

    .app-icon {
        display: none;
    }

    footer {
        margin-top: var(--space-4xl);
        padding: var(--space-2xl) 0;
    }
}

/* Tablet */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }

    .app-row {
        grid-column: span 1;
    }

    /* If there's an odd number of items, make the last one full width */
    .app-grid:has(.app-row:nth-child(odd):last-child) .app-row:last-child {
        grid-column: span 2;
    }
}

/* Animation for interactive elements */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 215, 50, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(243, 215, 50, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(243, 215, 50, 0);
    }
}

.btn-primary:focus {
    animation: pulse 1.5s infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-sm);
    border: 2px solid var(--surface);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--surface);
}

/* Text Selection */
::selection {
    background: var(--primary);
    color: var(--primary-text);
}

::-moz-selection {
    background: var(--primary);
    color: var(--primary-text);
}

.progressbars {
    margin: var(--space--lg) 0;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.progress {
    position: relative;
}

.progress:last-child {
    margin-bottom: 0;
}

.progress .label {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress .bar-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg);
}

.progress .bar {
    height: 18px;
    background: var(--face); /* darker base track */
    overflow: visible;
    position: relative;
    transition: all 0.4s ease;
}

.progress .bar:hover {
    transform: scaleY(1.15);
    box-shadow: 0 2px 12px rgba(243, 215, 50, 0.15);
}

.progress .bar .value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    mix-blend-mode: difference; /* makes text always readable */
    pointer-events: none;
}

/* Colored fill - uses your --primary yellow */
.progress .bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--primary) 0%, #ffed4e 100%);
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* This makes the fill animate from the inline style width */
.progress .bar {
    --progress: 0%;
}

.progress .bar[style*="width"] {
    --progress: attr(style);
}

/* Better visual feedback for different usage levels */
.progress .bar[data-progress="low"]::before {
    background: linear-gradient(90deg, #4ade80, #86efac);
}
.progress .bar[data-progress="medium"]::before {
    background: linear-gradient(90deg, var(--primary), #ffed4e);
}
.progress .bar[data-progress="high"]::before {
    background: linear-gradient(90deg, #f87171, #fda4af);
}

.loading {
    /* Disable interaction on the element itself */
    pointer-events: none !important;
    position: relative;
    overflow: hidden;
    /* Optional: slightly dim the background content */
    opacity: 0.8;
}

.loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* The diagonal shine */
    background-image: linear-gradient(110deg, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 75%);

    background-size: 200% 100%;
    animation: sweep 1.5s infinite linear;

    /* Ensure it sits on top of everything inside the element */
    z-index: 9999;
}

@keyframes sweep {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Password field with toggle button */
.password-wrapper {
    position: relative;
    margin-bottom: var(--space-xl);
}

.password-wrapper input {
    margin-bottom: 0;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--surface-alt);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary);
    background: var(--surface-alt);
}

.eye-icon {
    display: block;
    stroke: currentColor;
}

/* Checkbox styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    margin: 0;
    font-weight: normal;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

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

/* Loading state for form submission */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--bg);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}

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

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
}

.fab-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: var(--bg-alt);
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(243, 215, 50, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    border: 2px solid var(--bg);
}

.fab-button:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 24px rgba(243, 215, 50, 0.5);
    background: #ffed4e;
}

.fab-button:focus {
    outline: none;
    box-shadow:
        0 0 0 4px var(--bg),
        0 0 0 6px var(--primary);
}

/* Ticket Modal */
.ticket-modal {
    position: fixed;
    bottom: 110px;
    right: 32px;
    width: 380px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    overflow: hidden;
    display: none;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.ticket-modal.open {
    display: block;
}

.ticket-header {
    background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-header h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
}

.ticket-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0 var(--space-sm);
    line-height: 1;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.ticket-close:hover {
    color: var(--primary);
    background: var(--surface-alt);
    transform: scale(1.2);
}

.ticket-body {
    padding: var(--space-xl);
}

.ticket-textarea {
    width: 100%;
    min-height: 256px;
    line-height: 1.6;
    padding: var(--space-lg);
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: var(--space-lg);
    transition: all var(--transition-normal);
}

.ticket-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--premium-text);
    background: var(--surface-alt);
}

.ticket-textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.ticket-actions {
    display: flex;
    gap: var(--space-md);
}

.ticket-btn {
    flex: 1;
    padding: var(--space-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.ticket-btn-primary {
    background: var(--primary);
    color: var(--bg-alt);
}

.ticket-btn-primary:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--premium-text);
}

.ticket-btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.ticket-btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

/* Success Message */
.ticket-success {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: #d1fae5;
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.ticket-success svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-lg);
    stroke: #10b981;
}

.ticket-success h4 {
    color: #10b981;
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
}

.ticket-success p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile adjustments */
@media (max-width: 568px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }

    .fab-button {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .ticket-modal {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 90px;
    }
}

/* Loading state for button */
.ticket-btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.ticket-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--bg);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}

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

/* Professional Tab System */
.tab-container {
    margin-top: var(--space-3xl);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-lg);
    position: relative;
    gap: var(--space-xs);
}

.tab-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-normal);
    margin-bottom: -1px;
    white-space: nowrap;
}

.tab-item:hover {
    color: var(--primary);
    background: rgba(243, 215, 50, 0.08);
}

.tab-item.active {
    color: var(--primary);
    background: linear-gradient(to top, rgba(243, 215, 50, 0.12), transparent);
}

.tab-item.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 12px var(--premium-text);
    animation: slideInUnderline 0.2s ease;
}

@keyframes slideInUnderline {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

.tab-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    transition: transform var(--transition-normal);
}

.tab-item:hover .tab-icon {
    transform: scale(1.1);
}

.tab-content {
    padding: var(--space-2xl);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Mobile responsive tabs */
@media (max-width: 768px) {
    .tab-nav {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .tab-item {
        flex: 1 1 auto;
        min-width: 80px;
        justify-content: center;
        padding: var(--space-md);
        font-size: 0.85rem;
    }

    .tab-icon {
        width: 18px;
        height: 18px;
    }

    .tab-content {
        padding: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .tab-item span {
        display: none; /* Hide text on very small screens, show only icons */
    }

    .tab-item {
        min-width: auto;
        padding: var(--space-md);
    }

    .tab-icon {
        width: 22px;
        height: 22px;
        margin: 0;
    }
}

/* Tab content styling */
.tab-pane h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: var(--space-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tab-pane h4 {
    color: var(--text);
    font-size: 1.1rem;
    margin: var(--space-xl) 0 var(--space-md);
    font-weight: 600;
}

.tab-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: var(--space-xl) 0;
}

/* Services Overview Styling */
.service-category-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.service-category-card {
    background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all var(--transition-normal);
}

.service-category-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.service-status-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.service-status-badge.active {
    background: #10b981;
    color: white;
}

.service-status-badge.inactive {
    background: var(--surface-alt);
    color: var(--muted);
}

.service-size-bar {
    width: 60px;
    height: 6px;
    background: var(--surface-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
    display: inline-block;
}

.service-size-fill {
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-normal);
}

.service-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    color: var(--primary);
    transition: all var(--transition-fast);
}

.service-link-icon:hover {
    background: var(--surface-alt);
    transform: scale(1.1);
}

.service-link-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Responsive table */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 800px;
    }
}
