/* ============================================================================
   GLOSS — reusable glossy sheets, headers, wells, hover-row actions
   Tokens: --glass-* and --radius-xl in root.css
   Modal anatomy (Time & Attendance employee pattern, Unison tokens):
     accent gradient header + radial sheen + highlight edge + frosted close
   ============================================================================ */

.modal-dialog.glass-dialog,
.glass-sheet,
.glass-card,
.glass-dialog,
.modern-modal.glass-dialog {
    background: var(--glass-sheen), var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
    color: var(--color-text-light);
}

.glass-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.glass-toolbar .modular-segment,
.glass-sheet .modular-segment {
    margin-bottom: 0;
}

.glass-well {
    background: var(--glass-well-fill);
    border: 1px solid color-mix(in srgb, var(--glass-border) 55%, transparent);
    border-radius: var(--radius-medium);
    box-shadow: var(--glass-well-shadow);
}

.glass-btn,
.glass-sheet .modular-btn,
.glass-dialog .modular-btn,
.glass-dialog .form-actions button {
    min-height: var(--control-height-md, 32px);
    border-radius: var(--radius-medium);
}

.glass-sheet .modular-btn-primary,
.glass-dialog .modular-btn-primary,
.glass-dialog .form-actions button[type="submit"] {
    box-shadow: var(--glass-highlight), var(--glass-glow);
}

/* Accent header — design rule for every modal */
.glass-header,
.modal-header,
.modern-modal-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: var(--modal-header-height, 64px);
    padding: var(--space-lg) var(--space-xl);
    background: var(--glass-header);
    color: #fff;
    border-bottom: none;
}

.glass-header::before,
.modal-header::before,
.modern-modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-header-sheen);
    pointer-events: none;
}

.glass-header::after,
.modal-header::after,
.modern-modal-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--glass-header-edge);
    pointer-events: none;
}

.glass-header > *,
.modal-header > *,
.modern-modal-header > * {
    position: relative;
    z-index: 1;
}

.glass-header h2,
.glass-header h3,
.modal-header h2,
.modal-header h3,
.modern-modal-title,
.universal-product-modal-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.glass-close,
.modal-header .close,
.modal-header .modal-close,
.modern-modal-close,
.universal-product-modal-close,
.modal-document-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: background var(--transition-base), transform var(--transition-base);
}

.glass-close:hover,
.modal-header .close:hover,
.modal-header .modal-close:hover,
.modern-modal-close:hover,
.universal-product-modal-close:hover,
.modal-document-close:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
    transform: rotate(90deg);
}

.glass-close:focus-visible,
.modal-header .close:focus-visible,
.modal-header .modal-close:focus-visible,
.modern-modal-close:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
    .glass-close:hover,
    .modal-header .close:hover,
    .modal-header .modal-close:hover,
    .modern-modal-close:hover {
        transform: none;
    }
}

/* Wide profile dialogs — full-bleed aside + scrolling main */
.glass-split {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    min-height: 0;
    flex: 1;
}

.glass-aside {
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-xl) var(--space-lg);
    background: color-mix(in srgb, var(--glass-fill) 55%, transparent);
    border-right: 1px solid var(--glass-border);
}

@media (max-width: 820px) {
    .glass-split { grid-template-columns: 1fr; }
    .glass-aside {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        max-height: 42vh;
    }
}

.row-hover-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius-medium);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.row-hover-action .material-icons {
    font-size: 16px;
}

tr:hover .row-hover-action,
tr:focus-within .row-hover-action,
.row-hover-action:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.row-hover-action:hover,
.row-hover-action:focus-visible {
    color: var(--color-primary);
    background: var(--color-primary-fade);
}

.row-hover-action:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

@media (hover: none) {
    .row-hover-action {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .row-hover-action { transition: none; }
}
