/* MILA Customer Portal Design System */

:root {
    /* MILA Brand Colors */
    --background: 0 0% 99%;
    --foreground: 215 25% 15%;
    
    /* MILA Primary - Professional Blue */
    --primary: 217 91% 42%;
    --primary-foreground: 0 0% 100%;
    --primary-hover: 217 91% 35%;
    
    /* MILA Secondary - Warm Grey */
    --secondary: 215 15% 95%;
    --secondary-foreground: 215 25% 25%;
    --secondary-hover: 215 15% 90%;
    
    /* MILA Accent - Success Green */
    --accent: 145 63% 42%;
    --accent-foreground: 0 0% 100%;
    --accent-hover: 145 63% 35%;
    
    /* Cards & Surfaces */
    --card: 0 0% 100%;
    --card-foreground: 215 25% 15%;
    --card-border: 215 20% 92%;
    
    /* Muted & Subtle */
    --muted: 215 20% 97%;
    --muted-foreground: 215 15% 45%;
    
    /* Status Colors */
    --success: 145 63% 42%;
    --success-foreground: 0 0% 100%;
    --warning: 35 91% 62%;
    --warning-foreground: 0 0% 100%;
    --destructive: 0 75% 55%;
    --destructive-foreground: 0 0% 100%;
    
    /* Form Elements */
    --border: 215 20% 90%;
    --input: 215 20% 95%;
    --input-border: 215 20% 85%;
    --ring: 217 91% 42%;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(217, 91%, 42%), hsl(217, 91%, 52%));
    --gradient-subtle: linear-gradient(180deg, hsl(0, 0%, 100%), hsl(215, 20%, 98%));
    --gradient-hero: linear-gradient(135deg, rgb(10, 84, 205) 0%, rgb(21, 107, 244) 50%, rgb(40, 175, 96) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(38, 50, 56, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(38, 50, 56, 0.1), 0 2px 4px -1px rgba(38, 50, 56, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(38, 50, 56, 0.1), 0 4px 6px -2px rgba(38, 50, 56, 0.05);
    --shadow-elegant: 0 20px 25px -5px rgba(30, 64, 175, 0.1), 0 10px 10px -5px rgba(30, 64, 175, 0.04);
}

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

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: rgb(252, 252, 252);
    color: rgb(29, 37, 48);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: hsl(217, 91%, 42%);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    font-family: inherit;
}

label {
    display: block;
}

.block {
    display: block;
}

/* Utility Classes */
.min-h-screen {
    min-height: 100vh;
}

.flex {
    display: flex;
}

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

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

.justify-center {
    justify-content: center;
}

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

.space-x-2 > * + * {
    margin-left: 0.5rem;
}

.space-x-3 > * + * {
    margin-left: 0.75rem;
}

.space-x-4 > * + * {
    margin-left: 1rem;
}

.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.w-full {
    width: 100%;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-7xl {
    max-width: 80rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

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

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

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

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* Ensure proper spacing for cards */
.bg-card.rounded-lg {
    border-radius: 0.5rem;
}

/* Better hover effects */
.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(29, 37, 48, 0.1), 0 2px 4px -1px rgba(29, 37, 48, 0.06);
    transition: box-shadow 0.15s ease-in-out;
}

/* Ensure cards have proper styling */
.bg-card {
    background-color: rgb(255, 255, 255);
    color: rgb(29, 37, 48);
}

.bg-card.rounded-lg {
    border-radius: 0.5rem;
}

/* Better spacing for stats cards */
.bg-card.p-6 {
    padding: 1.5rem;
}

/* Ensure proper icon container styling */
.p-3.rounded-lg {
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Better button styling */
button.bg-gradient-primary,
a.bg-gradient-primary {
    background: linear-gradient(135deg, rgb(10, 84, 205), rgb(21, 107, 244));
    color: white;
    border: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

button.bg-gradient-primary:hover,
a.bg-gradient-primary:hover {
    opacity: 0.9;
    transition: opacity 0.15s ease-in-out;
}

/* Ensure proper badge styling */
.rounded-full {
    border-radius: 9999px;
    display: inline-block;
}

/* Better list styling */
ul.space-y-1 > li {
    margin-top: 0.25rem;
}

ul.space-y-1 > li:first-child {
    margin-top: 0;
}

.border {
    border-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.border-t {
    border-top-width: 1px;
}

.bg-background {
    background-color: rgb(252, 252, 252);
}

.bg-card {
    background-color: rgb(255, 255, 255);
    color: rgb(29, 37, 48);
}

.bg-primary {
    background-color: hsl(217, 91%, 42%);
}

.bg-primary\/10 {
    background-color: hsla(217, 91%, 42%, 0.1);
}

.bg-primary\/20 {
    background-color: hsla(217, 91%, 42%, 0.2);
}

.bg-primary\/5 {
    background-color: hsla(217, 91%, 42%, 0.05);
}

.bg-secondary {
    background-color: hsl(215, 15%, 95%);
}

.bg-success {
    background-color: hsl(145, 63%, 42%);
}

.bg-success\/10 {
    background-color: hsla(145, 63%, 42%, 0.1);
}

.bg-success\/20 {
    background-color: hsla(145, 63%, 42%, 0.2);
}

.bg-warning {
    background-color: hsl(35, 91%, 62%);
}

.bg-warning\/10 {
    background-color: hsla(35, 91%, 62%, 0.1);
}

.bg-warning\/20 {
    background-color: hsla(35, 91%, 62%, 0.2);
}

.bg-destructive\/10 {
    background-color: hsla(0, 75%, 55%, 0.1);
}

.bg-destructive\/20 {
    background-color: hsla(0, 75%, 55%, 0.2);
}

.bg-muted {
    background-color: hsl(215, 20%, 97%);
}

.bg-input {
    background-color: hsl(215, 20%, 95%);
}

.bg-muted\/30 {
    background-color: hsla(215, 20%, 97%, 0.3);
}

.bg-muted\/50 {
    background-color: hsla(215, 20%, 97%, 0.5);
}

.bg-input {
    background-color: hsl(215, 20%, 95%);
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-subtle {
    background: var(--gradient-subtle);
}

.bg-gradient-hero {
    background: linear-gradient(135deg, rgb(10, 84, 205) 0%, rgb(21, 107, 244) 50%, rgb(40, 175, 96) 100%);
    color: rgb(255, 255, 255);
}

.text-foreground {
    color: rgb(29, 37, 48);
}

.text-muted-foreground {
    color: hsl(215, 15%, 45%);
}

.border-card-border {
    border-color: rgb(231, 234, 239);
}

.border-border {
    border-color: hsl(215, 20%, 90%);
}

.border-input-border {
    border-color: hsl(215, 20%, 85%);
}

.shadow-sm {
    box-shadow: rgba(29, 37, 48, 0.05) 0px 1px 2px 0px;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(29, 37, 48, 0.1), 0 2px 4px -1px rgba(29, 37, 48, 0.06);
}

.shadow-elegant {
    box-shadow: 0 20px 25px -5px rgba(10, 84, 205, 0.1), 0 10px 10px -5px rgba(10, 84, 205, 0.04);
}

.hover\:bg-secondary:hover {
    background-color: hsl(215, 15%, 95%);
}

.hover\:bg-muted\/50:hover {
    background-color: hsla(215, 20%, 97%, 0.5);
}

.hover\:opacity-90:hover {
    opacity: 0.9;
}

.hover\:shadow-md:hover {
    box-shadow: var(--shadow-md);
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px hsla(217, 91%, 42%, 0.2);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.min-w-0 {
    min-width: 0;
}

.h-3 {
    height: 0.75rem;
}

.h-4 {
    height: 1rem;
}

.h-5 {
    height: 1.25rem;
}

.h-6 {
    height: 1.5rem;
}

.h-8 {
    height: 2rem;
}

.h-12 {
    height: 3rem;
}

.h-16 {
    height: 4rem;
}

.w-2 {
    width: 0.5rem;
}

.w-8 {
    width: 2rem;
}

.w-8\.h-6 {
    width: 2rem;
    height: 1.5rem;
}

.w-10 {
    width: 2.5rem;
}

.w-16 {
    width: 4rem;
}

.w-full {
    width: 100%;
}

.inline-block {
    display: inline-block;
}

.inline-flex {
    display: inline-flex;
}

.hidden {
    display: none;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.left-3 {
    left: 0.75rem;
}

.top-3 {
    top: 0.75rem;
}

.right-3 {
    right: 0.75rem;
}

.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-50 {
    z-index: 50;
}

.ring-2 {
    box-shadow: 0 0 0 2px hsl(217, 91%, 42%);
}

.opacity-90 {
    opacity: 0.9;
}

.opacity-80 {
    opacity: 0.8;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Additional missing classes */
.cursor-pointer {
    cursor: pointer;
}

.text-primary-foreground {
    color: hsl(0, 0%, 100%);
}

.text-primary-foreground\/80 {
    color: hsla(0, 0%, 100%, 0.8);
}

.text-secondary-foreground {
    color: hsl(215, 25%, 25%);
}

.text-destructive-foreground {
    color: hsl(0, 0%, 100%);
}

.text-warning-foreground {
    color: hsl(0, 0%, 100%);
}

/* Gradients - using var() for consistency */
.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-subtle {
    background: var(--gradient-subtle);
}

.bg-gradient-hero {
    background: var(--gradient-hero);
}

/* Fix for HSL with opacity in CSS - use rgba or separate opacity */
.bg-primary\/10 {
    background-color: hsla(217, 91%, 42%, 0.1);
}

.bg-primary\/20 {
    background-color: hsla(217, 91%, 42%, 0.2);
}

.bg-primary\/5 {
    background-color: hsla(217, 91%, 42%, 0.05);
}

/* Padding utilities */
.pl-10 {
    padding-left: 2.5rem;
}

.pr-10 {
    padding-right: 2.5rem;
}

.pr-4 {
    padding-right: 1rem;
}

.bg-success\/10 {
    background-color: hsla(145, 63%, 42%, 0.1);
}

.bg-success\/20 {
    background-color: hsla(145, 63%, 42%, 0.2);
}

.bg-warning\/10 {
    background-color: hsla(35, 91%, 62%, 0.1);
}

.bg-warning\/20 {
    background-color: hsla(35, 91%, 62%, 0.2);
}

.bg-destructive\/10 {
    background-color: hsla(0, 75%, 55%, 0.1);
}

.bg-destructive\/20 {
    background-color: hsla(0, 75%, 55%, 0.2);
}

.bg-muted\/30 {
    background-color: hsla(215, 20%, 97%, 0.3);
}

.bg-muted\/50 {
    background-color: hsla(215, 20%, 97%, 0.5);
}

/* Text colors */
.text-primary {
    color: hsl(217, 91%, 42%);
}

.text-primary-foreground {
    color: hsl(0, 0%, 100%);
}

.text-success {
    color: hsl(145, 63%, 42%);
}

.text-success-foreground {
    color: hsl(0, 0%, 100%);
}

.text-warning {
    color: hsl(35, 91%, 62%);
}

.text-warning-foreground {
    color: hsl(0, 0%, 100%);
}

.text-destructive {
    color: hsl(0, 75%, 55%);
}

.text-destructive-foreground {
    color: hsl(0, 0%, 100%);
}

.text-secondary-foreground {
    color: hsl(215, 25%, 25%);
}

/* Ring color fix */
.ring-primary {
    --ring-color: hsl(217, 91%, 42%);
}

.focus\:ring-ring:focus {
    box-shadow: 0 0 0 2px hsla(217, 91%, 42%, 0.2);
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px hsla(217, 91%, 42%, 0.2);
}

/* Additional spacing */
.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

/* Ensure proper text rendering */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: rgb(29, 37, 48);
    margin: 0;
}

h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

h3 {
    font-size: 1.5rem;
    line-height: 2rem;
}

h4 {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

/* Card improvements - already defined above */

/* Ensure buttons look good */
button.bg-gradient-primary,
a.bg-gradient-primary {
    background: linear-gradient(135deg, hsl(217, 91%, 42%), hsl(217, 91%, 52%));
    color: white;
    border: none;
}

button.bg-gradient-primary:hover,
a.bg-gradient-primary:hover {
    opacity: 0.9;
}

/* Responsive */
@media (min-width: 640px) {
    .sm\:px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .sm\:flex {
        display: flex;
    }
    
    .sm\:inline {
        display: inline;
    }
}

@media (min-width: 1024px) {
    .lg\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .lg\:flex-row {
        flex-direction: row;
    }
    
    .lg\:w-64 {
        width: 16rem;
    }
    
    .lg\:col-span-2 {
        grid-column: span 2 / span 2;
    }
    
    .lg\:col-span-3 {
        grid-column: span 3 / span 3;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid hsl(215, 20%, 85%);
    border-radius: 0.375rem;
    background-color: hsl(215, 20%, 95%);
    font-size: 1rem;
    font-family: inherit;
    color: rgb(29, 37, 48);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus,
textarea:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: hsl(217, 91%, 42%);
    box-shadow: 0 0 0 2px hsla(217, 91%, 42%, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: hsl(215, 15%, 45%);
    opacity: 0.7;
}

button[type="submit"],
button[type="button"],
a.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    transition: all 0.15s ease-in-out;
    text-align: center;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
}

thead th {
    font-weight: 500;
    color: hsl(215, 15%, 45%);
    border-bottom: 1px solid hsl(215, 20%, 92%);
}

tbody tr {
    border-bottom: 1px solid hsl(215, 20%, 92%);
}

tbody tr:hover {
    background-color: hsla(215, 20%, 97%, 0.5);
}

/* Additional utility classes */
.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.items-stretch {
    align-items: stretch;
}

.leading-relaxed {
    line-height: 1.625;
}

.prose {
    max-width: 65ch;
}

.prose-sm {
    font-size: 0.875rem;
    line-height: 1.7142857;
}

.prose-sm p {
    margin-top: 1.1428571em;
    margin-bottom: 1.1428571em;
}

.max-w-none {
    max-width: none;
}

/* Text colors */
.text-white {
    color: rgb(255, 255, 255);
}

.text-black {
    color: rgb(0, 0, 0);
}

/* Ensure hero gradient text is white */
.bg-gradient-hero,
.bg-gradient-hero * {
    color: rgb(255, 255, 255) !important;
}

.bg-gradient-hero h1,
.bg-gradient-hero h2,
.bg-gradient-hero h3,
.bg-gradient-hero p {
    color: rgb(255, 255, 255);
}

/* Background colors */
.bg-black\/50 {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Border radius */
.rounded-t-lg {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Spacing additions */
.pb-4 {
    padding-bottom: 1rem;
}

.pt-4 {
    padding-top: 1rem;
}

.pt-6 {
    padding-top: 1.5rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

/* Additional utility classes for better matching */
.flex-1 {
    flex: 1 1 0%;
}

.min-w-0 {
    min-width: 0;
}

/* Ensure proper card header styling */
.bg-card .border-b {
    border-bottom: 1px solid rgb(231, 234, 239);
}

/* Better spacing for message items */
.space-y-4 > * + * {
    margin-top: 1rem;
}

/* Ensure proper badge colors */
.bg-success\/20 {
    background-color: hsla(145, 63%, 42%, 0.2);
    color: hsl(145, 63%, 42%);
}

.bg-warning\/20 {
    background-color: hsla(35, 91%, 62%, 0.2);
    color: hsl(35, 91%, 62%);
}

/* Ensure proper icon colors in stat cards */
.text-success {
    color: hsl(145, 63%, 42%);
}

.text-warning {
    color: hsl(35, 91%, 62%);
}

.text-primary {
    color: hsl(217, 91%, 42%);
}

/* Better table styling */
table.w-full {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    font-weight: 500;
    color: hsl(215, 15%, 45%);
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(231, 234, 239);
}

table tbody td {
    padding: 1rem;
    border-bottom: 1px solid rgb(231, 234, 239);
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr:hover {
    background-color: hsla(215, 20%, 97%, 0.5);
}

/* Additional responsive */
@media (min-width: 640px) {
    .sm\:flex-row {
        flex-direction: row;
    }
}

/* ─── MILA Portal UI ─── */
.portal-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.portal-page {
    padding: 1.5rem 0 5rem;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgb(231, 234, 239);
    box-shadow: 0 1px 2px rgba(29, 37, 48, 0.04);
}

.portal-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
    gap: 1rem;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.portal-brand-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.portal-brand-sub {
    font-size: 0.75rem;
    color: hsl(215, 15%, 45%);
    margin: 0;
}

.portal-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-user-chip {
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border-radius: 999px;
    background: hsl(215, 20%, 97%);
}

.portal-user-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: hsla(217, 91%, 42%, 0.12);
    color: hsl(217, 91%, 42%);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.portal-user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.portal-btn:hover {
    text-decoration: none;
}

.portal-btn-ghost {
    border-color: hsl(215, 20%, 90%);
    color: rgb(29, 37, 48);
    background: #fff;
}

.portal-btn-ghost:hover {
    background: hsl(215, 15%, 95%);
}

.portal-btn-primary {
    background: var(--gradient-primary);
    color: #fff;
}

.portal-btn-primary:hover {
    opacity: 0.92;
}

.portal-btn-block {
    width: 100%;
}

.portal-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .portal-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .portal-page {
        padding-bottom: 2rem;
    }
}

.portal-sidebar {
    display: none;
    width: 16rem;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .portal-sidebar {
        display: block;
        position: sticky;
        top: 5.5rem;
    }
}

.portal-nav-card {
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.portal-nav-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(215, 15%, 45%);
    padding: 0.25rem 0.5rem 0.5rem;
    margin: 0;
}

.portal-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    color: hsl(215, 15%, 45%);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.portal-nav-item:hover {
    background: hsl(215, 15%, 95%);
    color: rgb(29, 37, 48);
    text-decoration: none;
}

.portal-nav-item.is-active {
    background: hsla(217, 91%, 42%, 0.1);
    color: hsl(217, 91%, 42%);
}

.portal-nav-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.portal-mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgb(231, 234, 239);
    padding: 0.375rem 0.25rem calc(0.375rem + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
    .portal-mobile-nav {
        display: none;
    }
}

.portal-mobile-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.25rem;
    font-size: 0.625rem;
    color: hsl(215, 15%, 45%);
    text-decoration: none;
}

.portal-mobile-item.is-active {
    color: hsl(217, 91%, 42%);
}

.portal-main {
    flex: 1;
    min-width: 0;
}

.portal-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(217, 91%, 42%);
    margin: 0 0 0.25rem;
}

.portal-page-title {
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.portal-page-sub {
    margin: 0.375rem 0 0;
    color: hsl(215, 15%, 45%);
}

.portal-page-header {
    margin-bottom: 1.5rem;
}

.portal-page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-inspection-header {
    align-items: flex-end;
}

.portal-page-header-main {
    flex: 1;
    min-width: 0;
}

.portal-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.portal-back {
    display: inline-block;
    font-size: 0.875rem;
    color: hsl(215, 15%, 45%);
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.portal-back:hover {
    color: hsl(217, 91%, 42%);
}

.portal-welcome {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(10, 84, 205, 0.08), rgba(40, 175, 96, 0.06));
    border: 1px solid rgba(10, 84, 205, 0.12);
}

.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.portal-alert {
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.portal-alert-warning {
    background: hsla(35, 91%, 62%, 0.12);
    border: 1px solid hsla(35, 91%, 62%, 0.28);
    color: hsl(32, 70%, 28%);
}

.portal-download-error {
    max-width: 36rem;
}

.portal-download-error-invoice {
    font-weight: 600;
    color: hsl(215, 25%, 28%);
    margin-bottom: 0.5rem !important;
}

.portal-download-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

@media (min-width: 768px) {
    .portal-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.portal-stat-card {
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.875rem;
    padding: 1rem 1.125rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.portal-stat-label {
    display: block;
    font-size: 0.8125rem;
    color: hsl(215, 15%, 45%);
    margin-bottom: 0.375rem;
}

.portal-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.portal-stat-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .portal-stat-grid-3 {
        grid-template-columns: 1fr;
    }

    .portal-stat-grid-3 .portal-stat-value {
        font-size: 1.375rem;
    }
}

.portal-stat-card-static {
    cursor: default;
}

.portal-stat-card-static:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.portal-invoices-table-wrap {
    overflow-x: auto;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.625rem;
}

.portal-invoices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    table-layout: fixed;
}

.portal-invoices-table th {
    background: hsl(215, 20%, 97%);
    font-weight: 600;
    text-align: left;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid rgb(231, 234, 239);
    color: hsl(215, 15%, 45%);
    font-size: 0.75rem;
}

.portal-invoices-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid rgb(241, 243, 246);
    vertical-align: top;
    line-height: 1.4;
}

.portal-invoices-table th:first-child,
.portal-invoices-table td:first-child {
    width: 34%;
}

.portal-invoices-table th:nth-child(2),
.portal-invoices-table td:nth-child(2) {
    width: 14%;
    white-space: nowrap;
}

.portal-invoices-table th:nth-child(3),
.portal-invoices-table td:nth-child(3) {
    width: 16%;
    white-space: nowrap;
}

.portal-invoices-table th:nth-child(4),
.portal-invoices-table td:nth-child(4) {
    width: 30%;
}

.portal-invoices-col-action {
    width: 3rem;
    text-align: center;
}

.portal-invoices-number-value {
    display: block;
    font-weight: 600;
    color: hsl(215, 25%, 18%);
}

.portal-invoices-desc {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: hsl(215, 15%, 45%);
    max-width: 22rem;
}

.portal-invoices-amount {
    font-weight: 600;
}

.portal-invoices-amount.is-credit {
    color: hsl(270, 55%, 42%);
}

.portal-invoices-meta {
    display: block;
    font-size: 0.75rem;
    color: hsl(215, 15%, 45%);
    line-height: 1.35;
}

.portal-invoices-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.portal-invoices-table .status-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    line-height: 1;
}

.portal-invoices-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: hsl(217, 91%, 42%);
    background: hsla(217, 91%, 42%, 0.08);
    text-decoration: none;
    transition: background 0.15s ease;
}

.portal-invoices-download:hover {
    background: hsla(217, 91%, 42%, 0.14);
    text-decoration: none;
}

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

.portal-widget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .portal-widget-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-widget {
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.875rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.portal-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.portal-widget-head h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.portal-widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.portal-widget-meta {
    font-size: 0.875rem;
    color: hsl(215, 15%, 45%);
    margin: 0;
}

.portal-widget-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgb(231, 234, 239);
}

.portal-btn-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.portal-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(217, 91%, 42%);
    text-decoration: none;
}

.portal-link:hover {
    text-decoration: underline;
}

.portal-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .portal-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.portal-search-wrap {
    position: relative;
    flex: 1;
    max-width: 28rem;
}

.portal-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: hsl(215, 15%, 45%);
    pointer-events: none;
}

.portal-search {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1px solid hsl(215, 20%, 85%);
    border-radius: 0.625rem;
    background: #fff;
    font-size: 0.875rem;
}

.portal-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.portal-filter {
    padding: 0.4375rem 0.75rem;
    border-radius: 999px;
    border: 1px solid hsl(215, 20%, 90%);
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(215, 15%, 45%);
    cursor: pointer;
}

.portal-filter.is-active {
    background: hsla(217, 91%, 42%, 0.1);
    border-color: hsla(217, 91%, 42%, 0.25);
    color: hsl(217, 91%, 42%);
}

.portal-result-count {
    font-size: 0.8125rem;
    color: hsl(215, 15%, 45%);
    margin: 0 0 1rem;
}

.portal-project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .portal-project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .portal-project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-project-card {
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.875rem;
    padding: 1rem 1.125rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-project-card:hover {
    border-color: hsla(217, 91%, 42%, 0.25);
    box-shadow: var(--shadow-md);
}

.portal-project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.portal-project-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(215, 15%, 45%);
    font-variant-numeric: tabular-nums;
}

.portal-project-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.375rem;
}

.portal-project-category {
    font-size: 0.8125rem;
    color: hsl(217, 91%, 42%);
    margin: 0 0 0.375rem;
}

.portal-project-address {
    font-size: 0.8125rem;
    color: hsl(215, 15%, 45%);
    margin: 0;
}

.portal-project-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid rgb(241, 243, 246);
    font-size: 0.75rem;
    color: hsl(215, 15%, 45%);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-pill-pending {
    background: hsla(35, 91%, 62%, 0.15);
    color: hsl(32, 80%, 35%);
    border-color: hsla(35, 91%, 62%, 0.28);
}

.status-pill-active {
    background: hsla(217, 91%, 42%, 0.12);
    color: hsl(217, 91%, 35%);
    border-color: hsla(217, 91%, 42%, 0.22);
}

.status-pill-done {
    background: hsla(145, 63%, 42%, 0.14);
    color: hsl(145, 55%, 30%);
    border-color: hsla(145, 63%, 42%, 0.24);
}

.status-pill-overdue {
    background: hsla(0, 72%, 51%, 0.12);
    color: hsl(0, 65%, 38%);
    border-color: hsla(0, 72%, 51%, 0.22);
}

.status-pill-credit {
    background: hsla(270, 55%, 50%, 0.1);
    color: hsl(270, 50%, 38%);
    border-color: hsla(270, 55%, 50%, 0.2);
}

.status-pill-muted {
    background: hsl(215, 20%, 95%);
    color: hsl(215, 15%, 45%);
    border-color: hsl(215, 20%, 88%);
}

.portal-empty,
.portal-empty-inline {
    text-align: center;
    color: hsl(215, 15%, 45%);
}

.portal-empty {
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px dashed hsl(215, 20%, 85%);
    border-radius: 0.875rem;
}

.portal-empty h2 {
    font-size: 1.125rem;
    margin: 0.5rem 0;
    color: rgb(29, 37, 48);
}

.portal-empty p {
    max-width: 28rem;
    margin: 0 auto;
}

.portal-empty-icon {
    font-size: 2rem;
    line-height: 1;
}

.portal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portal-list-item {
    padding: 0.875rem 1rem;
    border: 1px solid rgb(241, 243, 246);
    border-radius: 0.625rem;
    background: hsl(215, 20%, 99%);
}

.portal-list-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.portal-list-item-link:hover {
    border-color: hsla(217, 91%, 42%, 0.25);
    background: #fff;
    text-decoration: none;
}

.portal-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.portal-list-title {
    font-weight: 600;
    margin: 0 0 0.125rem;
}

.portal-list-meta {
    font-size: 0.8125rem;
    color: hsl(215, 15%, 45%);
    margin: 0;
}

.portal-chevron {
    font-size: 1.25rem;
    color: hsl(217, 91%, 42%);
    line-height: 1;
}

.portal-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: hsla(217, 91%, 42%, 0.1);
    color: hsl(217, 91%, 42%);
    font-size: 0.75rem;
    font-weight: 600;
}

.portal-detail-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .portal-detail-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-meta-card {
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
}

.portal-meta-card-wide {
    grid-column: 1 / -1;
}

.portal-meta-label {
    display: block;
    font-size: 0.75rem;
    color: hsl(215, 15%, 45%);
    margin-bottom: 0.25rem;
}

.portal-meta-value {
    font-size: 0.9375rem;
    font-weight: 600;
}

.portal-qa-table-wrap {
    overflow-x: auto;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.625rem;
}

.portal-qa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
}

.portal-qa-table th {
    background: hsl(215, 20%, 97%);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(231, 234, 239);
}

.portal-qa-table th:first-child {
    width: 68%;
}

.portal-qa-table th:last-child {
    width: 32%;
}

.portal-qa-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(241, 243, 246);
    vertical-align: top;
    line-height: 1.5;
}

.portal-qa-table td:first-child {
    width: 68%;
    color: hsl(215, 25%, 18%);
    font-weight: 500;
    padding-right: 1.5rem;
}

.portal-qa-table td:last-child {
    width: 32%;
    max-width: 14rem;
    color: hsl(215, 15%, 42%);
    word-break: break-word;
}

.portal-qa-table tr:last-child td {
    border-bottom: none;
}

.qa-answer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.qa-answer-ok {
    background: hsla(145, 63%, 42%, 0.14);
    color: hsl(145, 55%, 28%);
}

.qa-answer-na {
    background: hsl(215, 20%, 95%);
    color: hsl(215, 15%, 42%);
}

.qa-answer-nok {
    background: hsla(0, 72%, 51%, 0.12);
    color: hsl(0, 65%, 38%);
}

.qa-answer-rating {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.2;
}

.qa-answer-rating-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.qa-answer-rating-label {
    font-size: 0.6875rem;
    color: hsl(215, 15%, 42%);
    font-weight: 500;
}

.qa-answer-rating-1 .qa-answer-rating-score,
.qa-answer-rating-2 .qa-answer-rating-score {
    background: hsla(0, 72%, 51%, 0.12);
    color: hsl(0, 65%, 38%);
}

.qa-answer-rating-3 .qa-answer-rating-score {
    background: hsla(35, 91%, 62%, 0.15);
    color: hsl(32, 80%, 35%);
}

.qa-answer-rating-4 .qa-answer-rating-score,
.qa-answer-rating-5 .qa-answer-rating-score {
    background: hsla(145, 63%, 42%, 0.14);
    color: hsl(145, 55%, 28%);
}

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    .login-page {
        grid-template-columns: 1.1fr 1fr;
    }
}

.login-hero {
    display: none;
    background: var(--gradient-hero);
    color: #fff;
    padding: 3rem 2rem;
}

@media (min-width: 960px) {
    .login-hero {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.login-hero-inner {
    max-width: 26rem;
}

.login-brand-mark {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-hero h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.login-hero p {
    opacity: 0.92;
    margin-bottom: 1.5rem;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-features li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.login-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    font-weight: 700;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--gradient-subtle);
}

.login-panel-inner {
    width: 100%;
    max-width: 24rem;
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-elegant);
}

.login-panel-inner h2 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
}

.login-panel-sub {
    color: hsl(215, 15%, 45%);
    margin: 0 0 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.login-error {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: hsla(0, 75%, 55%, 0.08);
    border: 1px solid hsla(0, 75%, 55%, 0.18);
    color: hsl(0, 75%, 45%);
    font-size: 0.875rem;
}

.login-dev-hint {
    margin-top: 1.25rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: hsl(215, 20%, 97%);
    font-size: 0.8125rem;
    color: hsl(215, 15%, 45%);
    text-align: center;
}

.login-debug-trigger {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.625rem 1rem;
    border: 1px dashed hsl(38, 92%, 50%);
    border-radius: 0.5rem;
    background: hsla(38, 92%, 50%, 0.08);
    color: hsl(32, 80%, 35%);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.login-debug-trigger:hover {
    background: hsla(38, 92%, 50%, 0.14);
    border-color: hsl(38, 92%, 42%);
}

body.login-debug-open {
    overflow: hidden;
}

.login-debug-modal[hidden] {
    display: none !important;
}

.login-debug-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-debug-backdrop {
    position: absolute;
    inset: 0;
    background: hsla(215, 25%, 12%, 0.55);
    backdrop-filter: blur(2px);
}

.login-debug-dialog {
    position: relative;
    width: min(100%, 42rem);
    max-height: min(90vh, 720px);
    overflow: auto;
    border-radius: 1rem;
    background: hsl(0, 0%, 100%);
    box-shadow: 0 24px 48px hsla(215, 25%, 12%, 0.22);
    border: 1px solid hsl(215, 16%, 90%);
}

.login-debug-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid hsl(215, 16%, 92%);
    position: sticky;
    top: 0;
    background: hsl(0, 0%, 100%);
    z-index: 1;
}

.login-debug-eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(38, 92%, 42%);
}

.login-debug-header h3 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
}

.login-debug-intro {
    margin: 0;
    font-size: 0.875rem;
    color: hsl(215, 15%, 45%);
    line-height: 1.45;
}

.login-debug-close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.5rem;
    background: hsl(215, 20%, 96%);
    color: hsl(215, 15%, 35%);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.login-debug-close:hover {
    background: hsl(215, 20%, 92%);
}

.login-debug-list {
    display: grid;
    gap: 0.875rem;
    padding: 1rem 1.25rem 1.25rem;
}

.login-debug-card {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid hsl(215, 16%, 90%);
    background: hsl(215, 25%, 99%);
}

.login-debug-card.is-disabled {
    opacity: 0.72;
}

.login-debug-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.login-debug-card h4 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.login-debug-role {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-debug-role-admin {
    background: hsla(262, 70%, 50%, 0.12);
    color: hsl(262, 60%, 40%);
}

.login-debug-role-customer {
    background: hsla(210, 90%, 50%, 0.12);
    color: hsl(210, 80%, 38%);
}

.login-debug-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.login-debug-feature {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: hsl(215, 20%, 94%);
    color: hsl(215, 15%, 38%);
    font-size: 0.6875rem;
    font-weight: 600;
}

.login-debug-desc {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: hsl(215, 20%, 28%);
}

.login-debug-email {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: hsl(215, 12%, 50%);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.login-debug-form {
    margin: 0;
}

.login-debug-unavailable {
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: hsla(0, 75%, 55%, 0.06);
    border: 1px solid hsla(0, 75%, 55%, 0.15);
    font-size: 0.8125rem;
    color: hsl(0, 55%, 40%);
}

/* Inbox */
.portal-inbox {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: 28rem;
}

@media (min-width: 900px) {
    .portal-inbox {
        grid-template-columns: minmax(260px, 320px) 1fr;
        align-items: start;
    }
}

.portal-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid rgb(231, 234, 239);
    border-radius: 0.875rem;
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    max-height: 36rem;
    overflow-y: auto;
}

.portal-inbox-item {
    display: block;
    padding: 0.875rem;
    border-radius: 0.625rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.portal-inbox-item:hover {
    background: hsl(215, 20%, 98%);
    text-decoration: none;
}

.portal-inbox-item.is-active {
    background: hsla(217, 91%, 42%, 0.08);
    border-color: hsla(217, 91%, 42%, 0.2);
}

.portal-inbox-item.is-unread .portal-inbox-subject {
    font-weight: 700;
}

.portal-inbox-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.portal-inbox-subject {
    font-size: 0.875rem;
    line-height: 1.35;
    margin: 0;
}

.portal-inbox-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: hsl(217, 91%, 42%);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.portal-inbox-from {
    font-size: 0.75rem;
    color: hsl(215, 15%, 45%);
    margin: 0 0 0.375rem;
}

.portal-inbox-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: hsl(215, 15%, 45%);
}

.portal-inbox-tag {
    display: inline-flex;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: hsl(215, 20%, 95%);
    color: hsl(215, 15%, 40%);
    font-size: 0.6875rem;
    font-weight: 600;
}

.portal-inbox-detail {
    min-height: 20rem;
}

.portal-inbox-detail-card {
    min-height: 100%;
}

.portal-inbox-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgb(231, 234, 239);
}

.portal-inbox-detail-head h2 {
    font-size: 1.125rem;
    margin: 0 0 0.25rem;
}

.portal-inbox-detail-meta {
    font-size: 0.8125rem;
    color: hsl(215, 15%, 45%);
    margin: 0;
}

.portal-inbox-body {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgb(29, 37, 48);
    white-space: pre-wrap;
}

.portal-inbox-empty {
    min-height: 20rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.portal-empty-compact {
    padding: 2rem 1rem;
}

.portal-page-header-row .portal-count-badge {
    vertical-align: middle;
    margin-left: 0.5rem;
}

