/* =====================================================
   Material Icons Fix (Prevent FOUT)
   ===================================================== */
.material-icons-round,
[class^="material-icons-"],
[class*=" material-icons-"],
.custom-select-trigger:after,
.custom-select-container .custom-select-trigger:after,
.custom-select-arrow,
.task-checkbox:checked::after,
.custom-option.selected::after,
.nav-item.has-submenu.drill-mode::after {
    font-family: 'Material Icons Round' !important;
    font-weight: normal !important;
    font-style: normal !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px; /* Default */
    text-transform: none !important;
    letter-spacing: normal !important;
    word-wrap: normal !important;
    white-space: nowrap !important;
    direction: ltr !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga' !important;
    -webkit-font-feature-settings: 'liga' !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

/* Specific overrides for fonts in pseudo-elements */
[class*="material-icons-"]::before,
[class*="material-icons-"]::after {
    font-family: inherit; /* Inherit from parent which has the font-family */
    display: inline-flex;
}

/* Typography Scale - Ultra Light */
.text-display {
    font-family: var(--font-titles);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.text-title {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.3;
}

.text-heading {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
}

.text-subheading {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
}

.text-body {
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
}

.text-caption {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-small {
    font-size: 0.7rem;
    font-weight: 400;
}

/* Emphasis - use sparingly */
.text-medium {
    font-weight: 500;
}

.text-semi {
    font-weight: 400;
    /* No more 600! */
}

/* =====================================================
   Status & Badges
   ===================================================== */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-success {
    background: var(--success-soft);
    opacity: 0.7;
}

.status-dot-error {
    background: var(--error-soft);
    opacity: 0.7;
}

.status-dot-warning {
    background: var(--warning-color);
    opacity: 0.7;
}

.status-dot-info {
    background: var(--brand-blue);
    opacity: 0.7;
}

.badge {
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-neutral {
    background: var(--glass-bg);
    color: var(--text-tertiary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success-soft);
}

.badge-error {
    background: rgba(220, 38, 38, 0.08);
    color: var(--error-soft);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning-color);
}

/* =====================================================
   Cards & Containers
   ===================================================== */

.minimal-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.minimal-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-premium);
}

.minimal-card-lg {
    padding: 1.5rem;
}

.minimal-card-sm {
    padding: 0.75rem;
}

/* Info Card with Dot Indicator */
.info-card {
    position: relative;
    padding-left: 1.25rem;
}

.info-card::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
}

/* =====================================================
   Page Headers
   ===================================================== */

.page-header {
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    font-weight: 400;
    margin: 0;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.section-title {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =====================================================
   Data Display
   ===================================================== */

.info-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 400;
    margin-bottom: 0.3rem;
    display: block;
}

.info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 400;
}

.info-value-lg {
    font-size: 1.2rem;
    font-weight: 400;
}

.info-value-xl {
    font-size: 1.5rem;
    font-weight: 400;
}

/* Number with Color */
.value-success {
    color: var(--success-soft);
}

.value-error {
    color: var(--error-soft);
}

.value-warning {
    color: var(--warning-color);
}

.value-neutral {
    color: var(--text-secondary);
}

/* =====================================================
   Layout Utilities
   ===================================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

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

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

/* =====================================================
   Borders & Dividers
   ===================================================== */

.border-subtle {
    border: 1px solid var(--glass-border);
}

.border-top-subtle {
    border-top: 1px solid var(--glass-border);
}

.border-bottom-subtle {
    border-bottom: 1px solid var(--glass-border);
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1rem 0;
}

/* =====================================================
   Interactive Elements
   ===================================================== */

.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable:hover {
    opacity: 0.7;
}

.link-subtle {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.link-subtle:hover {
    color: var(--brand-blue);
}

/* =====================================================
   Icon Containers
   ===================================================== */

.icon-container {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-container-sm {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.icon-container-lg {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.icon-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success-soft);
}

.icon-error {
    background: rgba(220, 38, 38, 0.08);
    color: var(--error-soft);
}

.icon-warning {
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning-color);
}

.icon-info {
    background: rgba(78, 146, 216, 0.08);
    color: var(--brand-blue);
}

.icon-neutral {
    background: var(--glass-bg);
    color: var(--text-secondary);
}

/* =====================================================
   Date Badge
   ===================================================== */

.date-badge {
    text-align: center;
    background: var(--glass-bg);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    min-width: 48px;
}

.date-day {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-primary);
}

.date-month {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.7;
    color: var(--text-secondary);
}

/* =====================================================
   Spacing Utilities
   ===================================================== */

.mt-0 {
    margin-top: 0;
}

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

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

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

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

.mb-0 {
    margin-bottom: 0;
}

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

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

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

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

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

/* =====================================================
   Layout Utilities
   ===================================================== */

.flex-row {
    display: flex;
    flex-direction: row;
}

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

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

.flex-start {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

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

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.border-bottom-subtle {
    border-bottom: 1px solid var(--glass-border);
}

.border-top-subtle {
    border-top: 1px solid var(--glass-border);
}

/* =====================================================
   Responsive Utilities
   ===================================================== */

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-actions>*,
    .header-actions input,
    .header-actions select {
        width: 100%;
        max-width: none;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .text-display {
        font-size: 1.5rem;
    }

    .text-title {
        font-size: 1.15rem;
    }
}

.success-btn {
    background: #059669;
    color: white !important;
    padding: 0.6rem 1.2rem;
    height: auto;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.success-btn:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.3);
}

.success-btn:active {
    transform: translateY(0);
}

/* =====================================================
   Animations
   ===================================================== */

@keyframes spin-hub {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-hub {
    animation: spin-hub 2s linear infinite;
}