:root {
    --ym-bg: #0b2a3c;
    --ym-bg-soft: #0f354a;
    --ym-accent: #1ea7ff;
    --ym-accent-soft: rgba(30, 167, 255, 0.15);
    --ym-border: #dde3ea;
    --ym-text: #131a26;
    --ym-muted: #6f7b8a;
    --ym-surface: #ffffff;
    --ym-surface-alt: #f4f6f8;
    --ym-radius-card: 12px;
    --ym-radius-pill: 999px;
    --ym-shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.14);

    /* FullCalendar tokens — overrides load after FC in ym-fullcalendar-portal.css (calendar blades) */
    --ym-fc-text: #e2e8f0;
    --ym-fc-surface: rgba(15, 23, 42, 0.6);
    --ym-fc-cell: rgba(15, 23, 42, 0.4);
    --ym-fc-cell-strong: rgba(15, 23, 42, 0.8);
    --ym-fc-border: rgba(148, 163, 184, 0.2);
    --ym-fc-button-bg: rgba(148, 163, 184, 0.1);
    --ym-fc-button-bg-hover: rgba(148, 163, 184, 0.2);
    --ym-fc-list-row-hover: rgba(148, 163, 184, 0.14);
    --ym-fc-event-hover-overlay: rgba(255, 255, 255, 0.28);

    /* Form controls — input, textarea, select share these */
    --ym-form-control-color: var(--ym-fc-text);
    --ym-form-control-bg: var(--ym-fc-surface);
    --ym-form-control-bg-focus: var(--ym-fc-cell-strong);
}

[x-cloak] {
    display: none !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #163a5a, #050b10);
    color: var(--ym-text);
}

.ym-header {
    background: linear-gradient(135deg, rgba(11, 42, 60, 0.95) 0%, rgba(5, 16, 26, 0.98) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 16px 36px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ym-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    gap: 24px;
    flex-wrap: wrap;
}

.ym-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 15px;
    transition: transform 0.2s ease;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.ym-logo:hover {
    transform: translateY(-1px);
}

.ym-logo:active {
    transform: translateY(0);
}

.ym-logo-mark {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(30, 167, 255, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.ym-logo-text {
    background: linear-gradient(135deg, #ffffff 0%, rgba(30, 167, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ym-nav {
    display: flex;
    gap: 4px;
    font-size: 13px;
    align-items: center;
    flex: 1;
    justify-content: end;
}

.ym-nav a {
    color: rgba(226, 232, 240, 0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.ym-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ym-accent), rgba(30, 167, 255, 0.6));
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ym-nav a:hover {
    background: rgba(30, 167, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.ym-nav a:hover::before {
    width: calc(100% - 28px);
}

.ym-nav a.active {
    background: linear-gradient(135deg, rgba(30, 167, 255, 0.15), rgba(30, 167, 255, 0.08));
    color: var(--ym-accent);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 167, 255, 0.2);
}

.ym-nav a.active::before {
    width: calc(100% - 28px);
    background: var(--ym-accent);
}

/* Nav dropdown (Admin menu) */
.ym-nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ym-nav-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ym-nav-dropdown > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(226, 232, 240, 0.75);
    transform: translateY(1px);
}
.ym-nav-dropdown > a.active::before, .ym-nav-dropdown-menu > a:hover::before, .ym-nav-dropdown-menu > a.active::before {
    width: 0;
}


.ym-nav-dropdown:hover > a::after {
    border-top-color: #fff;
}

.ym-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 190px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Click-to-open: no hover behavior */

.ym-nav-dropdown-menu a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(226, 232, 240, 0.9);
    text-decoration: none;
}

.ym-nav-dropdown-menu a:hover {
    background: rgba(30, 167, 255, 0.12);
    color: #fff;
    transform: none;
}

.ym-nav-dropdown-menu a.active {
    background: linear-gradient(135deg, rgba(30, 167, 255, 0.18), rgba(30, 167, 255, 0.08));
    color: var(--ym-accent);
    font-weight: 600;
    box-shadow: none;
}

/* Alpine x-show uses inline display; keep a nice entrance */
.ym-nav-dropdown-menu[x-cloak] {
    display: none !important;
}

/* User Dropdown Menu */
.ym-user-dropdown {
    position: relative;
    margin-left: auto;
}

.ym-user-btn {
    background: rgba(30, 167, 255, 0.1);
    border: 1px solid rgba(30, 167, 255, 0.2);
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.ym-user-btn:hover {
    background: rgba(30, 167, 255, 0.15);
    border-color: rgba(30, 167, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 167, 255, 0.2);
}

.ym-user-name {
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ym-user-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.ym-user-btn:hover .ym-user-icon {
    opacity: 1;
}

.ym-user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease-out;
}

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

.ym-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease-out;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    font-weight: 500;
}

.ym-user-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(30, 167, 255, 0.15), rgba(30, 167, 255, 0.08));
    color: var(--ym-accent);
    transform: translateX(2px);
}

.ym-user-dropdown-item svg {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ym-user-dropdown-item:hover svg {
    opacity: 1;
}

/* Mobile Toggle Button */
.ym-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(30, 167, 255, 0.1);
    border: 1px solid rgba(30, 167, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    margin-left: auto;
    transition: all 0.25s ease;
}

.ym-mobile-toggle:hover {
    background: rgba(30, 167, 255, 0.15);
    border-color: rgba(30, 167, 255, 0.3);
}

.ym-mobile-toggle span {
    width: 22px;
    height: 2.5px;
    background: #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.ym-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

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

.ym-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
.ym-mobile-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.ym-mobile-nav.open {
    max-height: 700px;
    opacity: 1;
}
.ym-mobile-nav a, .ym-mobile-nav button {
    display: block;
    padding: 9px 20px;
    color: rgba(226, 232, 240, 0.85);
    text-decoration: none;
    border-radius: 8px;
    margin: 0 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
}

.ym-mobile-nav a svg,
.ym-mobile-nav button svg {
    margin-right: 8px;
    vertical-align: middle;
}

.ym-mobile-nav button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    margin: 0;
    text-align: left;
}

.ym-mobile-nav form {
    margin: 0 8px;
}
.ym-mobile-nav a::before, .ym-mobile-nav button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--ym-accent);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s ease;
}

.ym-mobile-nav a:hover, .ym-mobile-nav button:hover {
    background: rgba(30, 167, 255, 0.1);
    color: #fff;
    padding-left: 28px;
    transform: translateX(4px);
}

.ym-mobile-nav a:hover::before, .ym-mobile-nav button:hover::before {
    height: 60%;
}

.ym-mobile-nav a.active, .ym-mobile-nav button.active {
    background: linear-gradient(135deg, rgba(30, 167, 255, 0.15), rgba(30, 167, 255, 0.08));
    color: var(--ym-accent);
    font-weight: 600;
    padding-left: 28px;
    box-shadow: 0 2px 8px rgba(30, 167, 255, 0.15);
}

.ym-mobile-nav a.active::before, .ym-mobile-nav button.active::before {
    height: 60%;
}

.ym-mobile-nav-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.15);
    margin: 5px 8px;
}

.ym-user {
    display: none;
}

.ym-main {
    max-width: 1280px;
    margin: 26px auto 40px;
    padding: 0 24px 24px;
}

.ym-section-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #f9fafb;
}
.ym-section-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #f9fafb;
}

.ym-section-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--ym-muted);
}

/* Small accent pill for inline counts (e.g. Machinery totals) */
.ym-count-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: rgba(226, 232, 240, 0.95);
    background: rgba(30, 167, 255, 0.14);
    border: 1px solid rgba(30, 167, 255, 0.28);
    margin-left: 8px;
}

.ym-section {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.7));
    border-radius: 18px;
    padding: 18px 18px 22px;
    box-shadow: var(--ym-shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Narrow container: use for short create/edit forms */
.ym-section.ym-section-narrow {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

/* Consistent vertical rhythm between sections */
.ym-section + .ym-section {
    margin-top: 16px;
}

.ym-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
    gap: 16px;
}

.ym-grid-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ym-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Metrics grid: denser cards, smaller minimum width */
.ym-grid-metrics {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.ym-grid-metrics.ym-grid-metrics-spaced {
    margin-bottom: 24px;
}

.ym-card {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    border-radius: var(--ym-radius-card);
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 16px 16px 14px;
    color: #e5e7eb;
    margin-bottom: 16px;
}

form .ym-card, .ym-us-only-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* US-only registration fields: force them onto one line (2 columns) */
.ym-us-only-fields.ym-us-only-fields-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px) {
    .ym-us-only-fields.ym-us-only-fields-grid-2 {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

.ym-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 12px;
    flex-wrap: wrap;
}

.ym-card-header h2 {
    font-size: 16px;
    margin: 0;
    color: #f9fafb;
}

/* Small card header label (metrics/stat cards) */
.ym-card-header .ym-card-kicker {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--ym-muted);
}

/* Portal: pair card headers with `ym-card-header ym-card-header-split` (layout is on `.ym-card-header`). */
.ym-card-header > .ym-actions {
    flex-shrink: 0;
}

.ym-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ym-actions-block {
    display: flex;
    margin-bottom: 16px;
}

.ym-actions form {
    margin: 0;
}

.ym-actions .ym-inline {
    align-items: center;
}

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

/* Table actions: right-aligned, single line, width shrinks to content */
.ym-th-actions,
.ym-td-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Any actions cell in a table: single row (not .ym-card-header, which is outside td) */
.ym-table td .ym-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.ym-table td .ym-actions .ym-btn {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .ym-table td .ym-actions {
        flex-direction: column;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* Access management: edit page — current link context */
.ym-access-edit-summary-vessel {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 12px 0 0;
    font-size: 13px;
}

.ym-access-edit-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ym-muted);
    letter-spacing: 0.04em;
}

.ym-access-edit-summary-sep {
    color: var(--ym-muted);
    user-select: none;
}

.ym-muted-small {
    font-size: 12px;
    color: var(--ym-muted);
    font-weight: 500;
}

.ym-hint {
    color: var(--ym-muted);
    font-size: 12px;
    margin: 4px 0 0;
}

.ym-checkbox-label {
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.ym-checkbox-label-top {
    align-items: flex-start;
}

.ym-filter-group-narrow {
    max-width: 180px;
}

.ym-badge-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ym-note-preview {
    color: var(--ym-muted);
    font-size: 13px;
    margin-top: 4px;
    line-height: 1.4;
}

.ym-hidden {
    display: none !important;
}

.ym-small-muted {
    font-size: 11px;
    color: var(--ym-muted);
    margin-top: 6px;
}

.ym-table-th-wide {
    min-width: 260px;
}

.ym-table-row-section {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
}

.ym-flex-1 {
    flex: 1 1 auto;
}

.ym-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ym-form-row-wide-gap {
    gap: 12px;
}

.ym-stack-sm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ym-mt-sm {
    margin-top: 8px;
}

.ym-mt-md {
    margin-top: 16px;
}

.ym-mt-lg {
    margin-top: 20px;
}

.ym-card-actions.ym-card-actions-wrap {
    flex-wrap: wrap;
    gap: 8px;
}

.ym-form-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .ym-form-grid-2col {
        grid-template-columns: 1fr;
    }
}

.ym-notes-history {
    margin-top: 10px;
}

.ym-notes-history-title {
    margin-bottom: 6px;
}

.ym-notes-history-list {
    margin: 0;
    padding-left: 18px;
}

.ym-btn-nowrap {
    white-space: nowrap;
}

.ym-card-flush {
    margin: 0;
}
.ym-machinery-stack {
    display: grid;
    gap: 14px;
}

.ym-machinery-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ym-machinery-header-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.ym-machinery-header-row > label, .ym-machinery-header-col > label  {
    font-size: 14px;
    font-weight: 700;
    color: #f9fafb;
    letter-spacing: 0.01em;
}

.ym-form-group-compact {
    margin: 0;
}

.ym-stack-12 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ym-form-group-row {
    flex-direction: row;
    align-items: center;
}

.ym-checkbox-spacer {
    margin-right: 10px;
}

.ym-cursor-pointer {
    cursor: pointer;
}

.ym-form-grid-flush {
    margin: 0;
}

/* Calendar wrappers + legend (FullCalendar skin: ym-fullcalendar-portal.css) */
.ym-calendar-body {
    padding: 20px;
}

.ym-calendar-legend {
    padding: 0 20px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.ym-calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ym-calendar-legend-label {
    font-size: 13px;
    color: var(--ym-muted);
}

.ym-calendar-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.ym-calendar-swatch-overdue {
    background: #ef4444;
}

.ym-calendar-swatch-due-soon {
    background: #fbbf24;
}

.ym-calendar-swatch-ok {
    background: #22c55e;
}

.ym-dashboard-row {
    margin-bottom: 24px;
}

.ym-card-pad {
    padding: 20px;
}

.ym-card-metric {
    border-color: rgba(148, 163, 184, 0.35);
}

.ym-card-metric-accent {
    background: linear-gradient(135deg, rgba(30, 167, 255, 0.1) 0%, rgba(30, 167, 255, 0.05) 100%);
    border-color: rgba(30, 167, 255, 0.3);
}

.ym-card-metric-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.ym-card-metric-warn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.ym-card-metric-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.ym-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ym-metric-kicker {
    font-size: 12px;
    color: var(--ym-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ym-metric-value-danger {
    color: #ef4444;
}

.ym-metric-icon {
    font-size: 36px;
    opacity: 0.3;
    line-height: 1;
}

.ym-canvas-chart {
    max-height: 300px;
}

.ym-grid-2col-16 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 640px) {
    .ym-grid-2col-16 {
        grid-template-columns: 1fr;
    }
}

.ym-stat-kicker {
    font-size: 11px;
    color: var(--ym-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ym-stat-value {
    font-size: 24px;
    font-weight: 600;
}

/* Key/value blocks for detail pages */
.ym-kv {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
}

.ym-kv:last-child {
    border-bottom: none;
}

.ym-kv-label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ym-kv-value {
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
}

/* Visual variant for destructive sections (reusable) */
.ym-card-danger {
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08);
}

/* Card body padding helper (avoid inline styles) */
.ym-card-body {
    padding: 0;
}

/* Metrics card body */
.ym-metric-body {
    padding: 16px;
}

.ym-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--ym-accent);
}

.ym-metric-value.ym-metric-value-text {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.ym-metric-value.ym-metric-value-success {
    color: #22c55e;
}

.ym-metric-value.ym-metric-value-warn {
    color: #fbbf24;
}

.ym-metric-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ym-muted);
}

/* Inline count stepper (e.g. engines/generators) */
.ym-stepper {
    display: inline-flex;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

.ym-stepper .ym-stepper-input {
    width: 84px  !important;
    text-align: center;
    padding: 6px 10px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    min-height: 29px !important;
}

.ym-table-wrapper {
    overflow-x: auto;
}

.ym-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ym-table thead {
    background: rgba(15, 23, 42, 0.9);
}

.ym-table th,
.ym-table td {
    padding: 9px 10px;
    text-align: left;
}

.ym-table th {
    color: #94a3b8;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.ym-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.6);
}

.ym-table tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.3);
}

.ym-table tbody tr:hover {
    background: rgba(30, 64, 175, 0.35);
}

.ym-table-muted {
    font-size: 12px;
    color: var(--ym-muted);
}

.ym-table-cell-pre {
    white-space: pre-wrap;
    min-width: 220px;
    max-width: min(420px, 40vw);
    word-break: break-word;
}

/* Truncate long table cell text (single line) */
.ym-table-cell-ellipsis {
    max-width: min(420px, 40vw);
}

.ym-table-cell-ellipsis > span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ym-link {
    color: var(--ym-accent);
    text-decoration: none;
    font-weight: 500;
}

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

.ym-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--ym-radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.ym-badge-warning {
    background: #f97316;
    color: #111827;
}

.ym-badge-danger {
    background: #fb3b60;
    color: #111827;
}

.ym-badge-success {
    background: #22c55e;
    color: #052e16;
}

.ym-badge-info {
    background: rgba(30, 167, 255, 0.22);
    color: #e2e8f0;
    border: 1px solid rgba(30, 167, 255, 0.28);
}

.ym-badge-neutral {
    background: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.26);
}

.ym-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ym-list > li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.ym-list-primary {
    color: #94a3b8;
}

.ym-list-secondary {
    color: #e5e7eb;
    text-align: right;
    word-break: break-word;
}

/* Key/value readout: label column + value column (avoids space-between “dead air”) */
.ym-list-kv > li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: start;
}

.ym-list-kv .ym-list-secondary {
    text-align: left;
}

/* Stack a KV row: value (e.g. attachments grid) moves below and spans full width */
.ym-list-kv > li.ym-list-kv-stack .ym-list-secondary {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 6px;
}

@media (max-width: 640px) {
    /* Small screens: stack label/value on two rows to avoid awkward word breaking */
    .ym-list > li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 6px 0;
        border-bottom: 1px dashed rgba(148, 163, 184, 0.16);
    }

    .ym-list > li:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .ym-list-secondary {
        text-align: left;
        width: 100%;
    }

    /* Key/value list collapses to one column on small screens */
    .ym-list-kv {
        gap: 0 !important;
    }
    .ym-list-kv > li {
        grid-template-columns: 1fr;
    }

    .ym-list-kv .ym-list-secondary {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 4px;
    }
}

.ym-list-row.ym-list-kv {
    gap: 10px 20px;
}

.ym-list-row.ym-list-kv > li {
    flex: 0 1 auto;
    min-width: min(100%, 160px);
    max-width: 280px;
}

.ym-tabs-wrap {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    padding: 8px;
    border-radius: var(--ym-radius-pill);
    border: 1px solid rgba(148, 163, 184, 0.3);
    margin-bottom: 14px;
    max-width: 100%;
    width: 100%;
    position: relative;
}

.ym-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

@media (min-width: 900px) {
    .ym-tabs-wrap {
        display: inline-flex;
        width: fit-content;
        max-width: 100%;
    }
}

.ym-tabs::-webkit-scrollbar {
    display: none; /* WebKit */
}

.ym-tabs-wrap::before,
.ym-tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 26px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease-out;
    z-index: 2;
}

/* Fade overlays to hint horizontal scroll */
.ym-tabs-wrap::before {
    left: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0));
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
}

.ym-tabs-wrap::after {
    right: 0;
    background: linear-gradient(270deg, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0));
    border-top-right-radius: inherit;
    border-bottom-right-radius: inherit;
}

.ym-tabs-wrap.ym-tabs-fade-left::before {
    opacity: 1;
}

.ym-tabs-wrap.ym-tabs-fade-right::after {
    opacity: 1;
}

.ym-tabs a {
    text-decoration: none;
    color: #cbd5f5;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: var(--ym-radius-pill);
    transition: all 0.16s ease-out;
    flex: 0 0 auto;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.ym-tabs a:hover {
    background: rgba(148, 163, 184, 0.25);
}

.ym-tabs a.active {
    background: var(--ym-accent);
    color: #020617;
}

.ym-summary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .ym-summary-metrics {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.ym-card-metric.ym-card-metric-compact {
    padding: 12px 12px 10px;
}

.ym-card-metric.ym-card-metric-compact .ym-metric-kicker {
    margin-bottom: 2px;
}

.ym-card-metric.ym-card-metric-compact .ym-metric-value {
    font-size: 24px;
    height: 30px;
    display: flex;
    align-items: center;
}

.ym-card-metric.ym-card-metric-compact .ym-metric-value.ym-metric-value-text {
    font-size: 14px;
}

.ym-card-metric.ym-card-metric-compact .ym-metric-sub {
    margin-top: 2px;
}

.ym-tab-panel {
    margin-top: 4px;
}

/* Portal vessel (show) page: tab panels hidden until JS picks active panel */
.ym-vessel-page .ym-tab-panel {
    display: none;
}

/* Scoped tab panels (hide/show via JS by toggling .is-active) */
.ym-tabs-scope .ym-tab-panel {
    display: none;
}

.ym-tabs-scope .ym-tab-panel.is-active {
    display: block;
}

/* Prevent initial tab flash before JS activates correct panel */
.ym-tabs-scope.ym-tabs-pending .ym-tab-panel {
    display: none !important;
}

.ym-notes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ym-note-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.ym-note-title {
    font-weight: 600;
    color: #f9fafb;
}

.ym-note-meta {
    color: var(--ym-muted);
    font-size: 12px;
}

.ym-note-body {
    margin: 4px 0 0;
    font-size: 13px;
    color: #cbd5f5;
}

.ym-footer {
    margin-top: 16px;
    padding: 16px 0 24px;
    color: #64748b;
    font-size: 12px;
}

.ym-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.ym-footer-secondary {
    opacity: 0.8;
}

.ym-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ym-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ym-form-grid .ym-form-group {
    margin: 0;
}

.ym-form-grid .ym-form-grid-span-2 {
    grid-column: 1 / span 2;
}

.ym-form-grid-compact {  
    gap: 5px;
}
.ym-form-grid-compact input {
    padding: 6px 10px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    min-height: 29px !important;
}

textarea.ym-form-grid-compact {
    min-height: 64px !important;
}

@media (max-width: 640px) {
    .ym-form-grid {
        grid-template-columns: 1fr;
    }

    .ym-form-grid .ym-form-grid-span-2 {
        grid-column: auto;
    }
}

.ym-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.ym-form-group label {
    color: #e5e7eb;
    font-weight: 600;
}

.ym-required {
    color: #fb3b60;
}

.ym-form-group input:not([type="checkbox"]) {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--ym-form-control-bg);
    padding: 8px 12px;
    color: var(--ym-form-control-color);
    -webkit-text-fill-color: var(--ym-form-control-color);
    font-size: 14px;
    transition: all 0.18s ease-out;
    box-sizing: border-box;
    line-height: 1.4;
    min-height: 36px;
}

.ym-form-group textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--ym-form-control-bg);
    padding: 8px 12px;
    color: var(--ym-form-control-color);
    -webkit-text-fill-color: var(--ym-form-control-color);
    font-size: 14px;
    transition: all 0.18s ease-out;
    box-sizing: border-box;
    line-height: 1.4;
    min-height: 80px; /* Textarea needs more height */
    resize: vertical;
}

.ym-form-group input:focus,
.ym-form-group textarea:focus {
    outline: none;
    border-color: var(--ym-accent);
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
    background: var(--ym-form-control-bg-focus);
}

.ym-form-group input::placeholder,
.ym-form-group textarea::placeholder {
    color: #64748b;
}
.ym-form-group input:disabled,
.ym-form-group select:disabled,
.ym-form-group textarea:disabled {
    color: var(--ym-muted);
    -webkit-text-fill-color: var(--ym-muted);
    background-color: rgba(46, 56, 78, 0.6);
}
@media (max-width: 900px) {
    .ym-header {
        padding: 12px 20px;
    }
    
    .ym-header-inner {
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    
    .ym-logo-text {
        font-size: 13px;
    }
    
    .ym-logo-mark {
        font-size: 20px;
    }
    .ym-logo-mark img {
        height: 22px;
    }

    .ym-nav {
        display: none;
    }

    .ym-mobile-toggle {
        display: flex;
    }

    .ym-mobile-nav {
        display: flex;
    }

    .ym-user-dropdown {
        display: none;
    }

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

    .ym-main {
        padding: 0 16px 18px;
    }
}

/* Flash Messages */
.ym-flash-message {
    max-width: 1280px;
    margin: 20px 0;
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

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

/* Newly added card highlight */
.ym-flash-added {
    animation: ymFlashAdded 2s ease-out;
}

/* Accordion (reusable) */
.ym-accordion-card.is-collapsed .ym-accordion-body {
    display: none;
}

.ym-accordion-card .ym-card-header {
    margin-bottom: 0;
}

.ym-accordion-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ym-accordion-title {
    font-weight: 700;
    color: #f9fafb;
    letter-spacing: 0.01em;
    font-size: 14px;
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
}

.ym-accordion-card {
    padding: 12px 12px 10px;
    transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out, transform 0.16s ease-out;
    cursor: pointer;
}

.ym-accordion-card input,
.ym-accordion-card textarea,
.ym-accordion-card select {
    cursor: text;
}

.ym-accordion-card button,
.ym-accordion-card label,
.ym-accordion-card a {
    cursor: pointer;
}

.ym-accordion-card:hover {
    border-color: rgba(30, 167, 255, 0.42);
    box-shadow: 0 0 0 1px rgba(30, 167, 255, 0.14), var(--ym-shadow-soft);
    transform: translateY(-1px);
}

.ym-accordion-delete {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.35);
    color: rgba(226, 232, 240, 0.9);
    cursor: pointer;
    line-height: 1;
    font-size: 18px;
    padding: 0;
    transition: background 0.16s ease-out, border-color 0.16s ease-out, transform 0.16s ease-out;
    flex: 0 0 auto;
}

.ym-accordion-delete:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fff;
    transform: translateY(-1px);
}

.ym-accordion-delete:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.ym-accordion-toggle {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 0;
    margin: 0;
    color: rgba(226, 232, 240, 0.9);
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.16s ease-out, border-color 0.16s ease-out, transform 0.16s ease-out, color 0.16s ease-out;
}

.ym-accordion-toggle:hover {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.32);
    transform: translateY(-1px);
}

.ym-accordion-toggle::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(226, 232, 240, 0.8);
    border-bottom: 2px solid rgba(226, 232, 240, 0.8);
    transform: rotate(45deg);
    transition: transform 0.16s ease-out, border-color 0.16s ease-out;
    flex: 0 0 auto;
}

.ym-accordion-toggle:hover::after {
    border-color: rgba(226, 232, 240, 0.95);
}

.ym-accordion-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}

.ym-accordion-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
}

@keyframes ymFlashAdded {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 167, 255, 0), var(--ym-shadow-soft);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(30, 169, 255, 0.5), var(--ym-shadow-soft);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(30, 167, 255, 0), var(--ym-shadow-soft);
    }
}

.ym-flash-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.ym-flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.ym-flash-message ul {
    list-style: disc;
    margin: 8px 0 0;
    padding-left: 20px;
}

.ym-flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

/* Action Buttons */
.ym-btn,
.ym-btn-primary,
.ym-btn-secondary,
.ym-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.18s ease-out, color 0.18s ease-out, transform 0.18s ease-out, box-shadow 0.18s ease-out, border-color 0.18s ease-out;
    white-space: nowrap;
}

.ym-btn:focus-visible,
.ym-btn-primary:focus-visible,
.ym-btn-secondary:focus-visible,
.ym-btn-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
}

.ym-btn:disabled,
.ym-btn-primary:disabled,
.ym-btn-secondary:disabled,
.ym-btn-danger:disabled,
.ym-btn[aria-disabled="true"],
.ym-btn-primary[aria-disabled="true"],
.ym-btn-secondary[aria-disabled="true"],
.ym-btn-danger[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ym-btn:not(:disabled):hover,
.ym-btn-primary:not(:disabled):hover,
.ym-btn-secondary:not(:disabled):hover,
.ym-btn-danger:not(:disabled):hover {
    transform: translateY(-1px);
}

.ym-btn-primary {
    background: var(--ym-accent);
    color: #fff;
}

.ym-btn-primary:hover {
    background: #0d8fdf;
    box-shadow: 0 4px 8px rgba(30, 167, 255, 0.3);
}

.ym-btn-secondary {
    background: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

.ym-btn-secondary:hover {
    background: rgba(148, 163, 184, 0.32);
    color: #fff;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.2);
}

.ym-btn-danger {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

.ym-btn-danger:hover {
    background: rgba(220, 38, 38, 0.32);
    color: #fff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.ym-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Search/Filter Bar */
.ym-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.ym-filter-group {
    flex: 1;
}

.ym-filter-group-actions {
    flex: 0 0 auto;
}

.ym-filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--ym-muted);
    font-weight: 500;
}

.ym-filter-group input,
.ym-filter-group select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}

.ym-filter-group input:focus,
.ym-filter-group select:focus {
    outline: none;
    border-color: var(--ym-accent);
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
}

.ym-filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: -4px 0 16px;
    font-size: 13px;
    color: var(--ym-muted);
}

.ym-filter-summary-count {
    color: rgba(226, 232, 240, 0.92);
    font-weight: 500;
}

.ym-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ym-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(30, 167, 255, 0.1);
    border: 1px solid rgba(30, 167, 255, 0.26);
    color: rgba(255, 255, 255, 0.9);
}

/* Pagination */
.ym-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 16px 0;
    flex-wrap: wrap;
}

/* Base styles for all pagination elements */
.ym-pagination > a,
.ym-pagination > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.18s ease-out;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 1;
    font-weight: 500;
}

/* Page number buttons - fixed square size */
.ym-pagination-page {
    min-width: 36px;
    width: 36px;
    padding: 8px;
}

/* Previous/Next navigation buttons - auto width */
.ym-pagination-nav {
    min-width: auto;
    width: auto;
    padding: 8px 14px;
}

/* Dots separator */
.ym-pagination-dots {
    min-width: auto;
    width: auto;
    padding: 8px 4px;
}

/* Hover state for links */
.ym-pagination > a:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #fff;
    border-color: rgba(148, 163, 184, 0.3);
    transform: translateY(-1px);
}

/* Active page */
.ym-pagination > span.active {
    background: var(--ym-accent-soft);
    color: var(--ym-accent);
    border-color: var(--ym-accent);
    font-weight: 600;
    cursor: default;
    min-width: 36px;
    width: 36px;
    padding: 8px;
}

/* Disabled state */
.ym-pagination > span.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    min-width: auto;
    width: auto;
    padding: 8px 14px;
}

/* Responsive pagination */
@media (max-width: 600px) {
    .ym-pagination {
        gap: 4px;
    }
    
    .ym-pagination > a,
    .ym-pagination > span {
        min-height: 32px;
        font-size: 12px;
    }
    
    .ym-pagination-page {
        min-width: 32px;
        width: 32px;
        padding: 6px;
    }
    
    .ym-pagination-nav,
    .ym-pagination > span.disabled {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .ym-pagination > span.active {
        min-width: 32px;
        width: 32px;
        padding: 6px;
    }
    
    .ym-pagination-dots {
        padding: 6px 2px;
    }
}

/* Card Actions */
.ym-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

/* Auth Pages Styles */
.ym-auth-body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0b2a3c 0%, #0f354a 50%, #0b2a3c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ym-auth-container {
    width: 100%;
    max-width: 485px;
    padding: 24px;
}

.ym-auth-shell {
    margin-top: 12px;
    color: rgba(203, 213, 245, 0.86);
    font-size: 13px;
    line-height: 1.6;
}

.ym-auth-shell--center .ym-auth-top {
    text-align: center;
}

.ym-auth-register {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: stretch;    
    color:rgba(203, 213, 245, 0.86);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 32px;
}

.ym-auth-register-aside {
    position: relative;
    border-radius: 14px;
    padding: 18px 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(900px 600px at -10% -20%, rgba(30, 167, 255, 0.30), transparent 55%),
        radial-gradient(700px 520px at 110% 0%, rgba(251, 188, 60, 0.16), transparent 60%),
        linear-gradient(160deg, rgba(2, 6, 23, 0.75), rgba(15, 23, 42, 0.55));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ym-auth-register-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.10;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,0.22) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: radial-gradient(circle at 30% 10%, #000 0%, transparent 65%);
}

.ym-auth-register-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(203, 213, 245, 0.95);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ym-auth-register-heading {
    color: #f8fafc;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.ym-auth-register-subheading {
    margin-top: 10px;
}

.ym-auth-register-bullets {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 12px;
}

.ym-auth-register-bullets li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
}

.ym-auth-register-bullet-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(226, 232, 240, 0.92);
    background: rgba(30, 167, 255, 0.12);
    border: 1px solid rgba(30, 167, 255, 0.18);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.ym-auth-register-bullet-title {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ym-auth-register-bullet-desc {
    margin-top: 3px;
    font-size: 12px;
}

.ym-auth-register-aside-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ym-auth-register-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.ym-auth-register-mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(30, 167, 255, 1), rgba(251, 188, 60, 0.8));
    box-shadow: 0 0 0 3px rgba(30, 167, 255, 0.10);
}

.ym-auth-top-title {
    color: #f8fafc;
    font-weight: 600;
    font-size: 24px;    
}
.ym-auth-top-subtitle {
    margin-top: 6px;    
}
.ym-auth-register .ym-auth-form {
    gap: 16px;
}

.ym-auth-shell--center .ym-auth-form {
    margin-top: 15px;
}
.ym-auth-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 5px;
}

.ym-auth-choice {
    display: block;
    cursor: pointer;
}

.ym-auth-choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ym-auth-choice-card {
    display: grid;
    gap: 6px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.45);
    transition: transform 0.16s ease-out, border-color 0.16s ease-out, background 0.16s ease-out, box-shadow 0.16s ease-out;
    position: relative;
    overflow: hidden;
}

.ym-auth-choice-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(600px 220px at 25% 0%, rgba(30, 167, 255, 0.24), transparent 60%);
    transition: opacity 0.16s ease-out;
}

.ym-auth-choice-title,
.ym-auth-choice-desc,
.ym-auth-choice-meta {
    position: relative;
    z-index: 1;
}

.ym-auth-choice-title {
    color: #f8fafc;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.ym-auth-choice-desc {
    color: rgba(203, 213, 245, 0.86);
    font-size: 12px;
    line-height: 1.55;
}

.ym-auth-choice-meta {
    color: rgba(148, 163, 184, 0.9);
    font-size: 12px;
}

.ym-auth-choice-card:hover {
    transform: translateY(-1px);
    border-color: rgba(30, 167, 255, 0.28);
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.ym-auth-choice-input:focus-visible + .ym-auth-choice-card {
    outline: none;
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
    border-color: rgba(30, 167, 255, 0.45);
}

.ym-auth-choice-input:checked + .ym-auth-choice-card {
    border-color: rgba(30, 167, 255, 0.52);
    box-shadow: 0 0 0 1px rgba(30, 167, 255, 0.10), 0 14px 34px rgba(0, 0, 0, 0.30);
    background: rgba(15, 23, 42, 0.62);
}

.ym-auth-choice-input:checked + .ym-auth-choice-card::before {
    opacity: 1;
}

.ym-auth-choice-input:checked + .ym-auth-choice-card::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(30, 167, 255, 0.15);
    border: 1px solid rgba(30, 167, 255, 0.50);
    box-shadow: 0 0 0 3px rgba(30, 167, 255, 0.12);
}

.ym-auth-register-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ym-auth-register-legal {
    font-size: 12px;
}

@media (min-width: 760px) {
    .ym-auth-body.ym-auth-body--register .ym-auth-container {
        max-width: 860px;
    }
    .ym-auth-card {
        padding: 34px;
    }
    .ym-auth-register-fields {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 760px) {
    .ym-auth-register {
        grid-template-columns: 1fr;
    }
    .ym-auth-register-aside {
        display: none;
    }
}

.ym-auth-card {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.ym-auth-header {
    text-align: center;
}

.ym-auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ym-auth-logo .ym-logo-mark {
    font-size: 48px;
    line-height: 1;
}

.ym-auth-title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #f9fafb;
    letter-spacing: -0.5px;
}

.ym-auth-content {
    width: 100%;
}

.ym-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(148, 163, 184, 0.06);
}

fieldset.ym-form-group {
    border: none;
    padding: 0;
    margin: 0;
    background: none;
}

.ym-auth-card .ym-form-group:has(.ym-form-input-error) {
    border-color: rgba(239, 68, 68, 0.32);
}

.ym-form-label {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.ym-form-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--ym-form-control-bg);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    color: var(--ym-form-control-color);
    -webkit-text-fill-color: var(--ym-form-control-color);
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.18s ease-out;
    box-sizing: border-box;
    min-height: 36px; /* Consistent height with select */
}

.ym-form-input:focus {
    outline: none;
    border-color: var(--ym-accent);
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
    background: var(--ym-form-control-bg-focus);
}

.ym-form-input::placeholder {
    color: #64748b;
}

/* Fix Chrome/Edge autofill colors on dark inputs */
.ym-form-input:-webkit-autofill,
.ym-form-input:-webkit-autofill:hover,
.ym-form-input:-webkit-autofill:focus,
.ym-form-input:-webkit-autofill:active,
.ym-form-group input:not([type="checkbox"]):-webkit-autofill,
.ym-form-group input:not([type="checkbox"]):-webkit-autofill:hover,
.ym-form-group input:not([type="checkbox"]):-webkit-autofill:focus,
.ym-form-group input:not([type="checkbox"]):-webkit-autofill:active,
.ym-filter-group input:-webkit-autofill,
.ym-filter-group input:-webkit-autofill:hover,
.ym-filter-group input:-webkit-autofill:focus,
.ym-filter-group input:-webkit-autofill:active,
.ym-form input:-webkit-autofill,
.ym-form input:-webkit-autofill:hover,
.ym-form input:-webkit-autofill:focus,
.ym-form input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--ym-form-control-color);
    caret-color: var(--ym-form-control-color);
    box-shadow: 0 0 0px 1000px var(--ym-form-control-bg) inset;
    border-color: rgba(148, 163, 184, 0.25);
    transition: background-color 9999s ease-out, color 9999s ease-out;
}

.ym-form-input:-webkit-autofill:focus,
.ym-form-group input:not([type="checkbox"]):-webkit-autofill:focus,
.ym-filter-group input:-webkit-autofill:focus,
.ym-form input:-webkit-autofill:focus {
    box-shadow: 0 0 0 3px var(--ym-accent-soft), 0 0 0px 1000px var(--ym-form-control-bg-focus) inset;
    border-color: var(--ym-accent);
}

/* Date input calendar icon - Chrome/Safari/Edge */
.ym-form-input[type="date"]::-webkit-calendar-picker-indicator,
.ym-form-group input[type="date"]::-webkit-calendar-picker-indicator,
.ym-form input[type="date"]::-webkit-calendar-picker-indicator,
.ym-filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.9) brightness(1.2);
    opacity: 0.8;
    transition: opacity 0.18s ease-out;
}

.ym-form-input[type="date"]::-webkit-calendar-picker-indicator:hover,
.ym-form-group input[type="date"]::-webkit-calendar-picker-indicator:hover,
.ym-form input[type="date"]::-webkit-calendar-picker-indicator:hover,
.ym-filter-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.3);
}

.ym-form-input[type="date"]:focus::-webkit-calendar-picker-indicator,
.ym-form-group input[type="date"]:focus::-webkit-calendar-picker-indicator,
.ym-form input[type="date"]:focus::-webkit-calendar-picker-indicator,
.ym-filter-group input[type="date"]:focus::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5) sepia(1) saturate(5) hue-rotate(180deg);
    opacity: 1;
}

/* Date input calendar icon - Firefox */
.ym-form-input[type="date"]::-moz-calendar-picker-indicator,
.ym-form-group input[type="date"]::-moz-calendar-picker-indicator,
.ym-form input[type="date"]::-moz-calendar-picker-indicator,
.ym-filter-group input[type="date"]::-moz-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.9) brightness(1.2);
    opacity: 0.8;
    transition: opacity 0.18s ease-out;
}

.ym-form-input[type="date"]::-moz-calendar-picker-indicator:hover,
.ym-form-group input[type="date"]::-moz-calendar-picker-indicator:hover,
.ym-form input[type="date"]::-moz-calendar-picker-indicator:hover,
.ym-filter-group input[type="date"]::-moz-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.3);
}

.ym-form-input[type="date"]:focus::-moz-calendar-picker-indicator,
.ym-form-group input[type="date"]:focus::-moz-calendar-picker-indicator,
.ym-form input[type="date"]:focus::-moz-calendar-picker-indicator,
.ym-filter-group input[type="date"]:focus::-moz-calendar-picker-indicator {
    filter: invert(1) brightness(1.5) sepia(1) saturate(5) hue-rotate(180deg);
    opacity: 1;
}

/* Time input icon */
.ym-form-input[type="time"]::-webkit-calendar-picker-indicator,
.ym-form-group input[type="time"]::-webkit-calendar-picker-indicator,
.ym-form input[type="time"]::-webkit-calendar-picker-indicator,
.ym-filter-group input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.9) brightness(1.2);
    opacity: 0.8;
    transition: opacity 0.18s ease-out;
}

.ym-form-input[type="time"]::-webkit-calendar-picker-indicator:hover,
.ym-form-group input[type="time"]::-webkit-calendar-picker-indicator:hover,
.ym-form input[type="time"]::-webkit-calendar-picker-indicator:hover,
.ym-filter-group input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.3);
}

.ym-form-input[type="time"]:focus::-webkit-calendar-picker-indicator,
.ym-form-group input[type="time"]:focus::-webkit-calendar-picker-indicator,
.ym-form input[type="time"]:focus::-webkit-calendar-picker-indicator,
.ym-filter-group input[type="time"]:focus::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5) sepia(1) saturate(5) hue-rotate(180deg);
    opacity: 1;
}

.ym-form-input-error {
    border-color: rgba(239, 68, 68, 0.5);
}

.ym-form-input-error:focus {
    border-color: #fb3b60;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Select dropdown styling - match input fields exactly */
.ym-form-group select,
.ym-form select {
    width: 100%;
    padding: 8px 12px;
    padding-right: 32px; /* Space for dropdown arrow */
    background-color: var(--ym-form-control-bg);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    color: var(--ym-form-control-color);
    -webkit-text-fill-color: var(--ym-form-control-color);
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.18s ease-out;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    min-height: 36px; /* Match input height */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e2e8f0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}

/* Prevent duplicate background when select has ym-form-input class */
.ym-form-group select.ym-form-input,
.ym-form select.ym-form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e2e8f0' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px 12px !important;
}

.ym-form-group select:focus,
.ym-form select:focus {
    outline: none;
    border-color: var(--ym-accent);
    box-shadow: 0 0 0 3px var(--ym-accent-soft);
    background-color: var(--ym-form-control-bg-focus);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231ea7ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px 12px !important;
}

/* Prevent duplicate background on focus when select has ym-form-input class */
.ym-form-group select.ym-form-input:focus,
.ym-form select.ym-form-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231ea7ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px 12px !important;
}

.ym-form-group select.ym-form-input-error,
.ym-form select.ym-form-input-error {
    border-color: rgba(239, 68, 68, 0.5);
}

.ym-form-group select.ym-form-input-error:focus,
.ym-form select.ym-form-input-error:focus {
    border-color: #fb3b60;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Permission matrix: current scope differs from system default */
.ym-form-group select.ym-scope-select-nondefault,
.ym-form select.ym-scope-select-nondefault {
    border-color: rgba(239, 68, 68, 0.55);
    color: #fecaca;
}

.ym-form-group select.ym-scope-select-nondefault:focus,
.ym-form select.ym-scope-select-nondefault:focus {
    border-color: #fb3b60;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fecaca' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px 12px !important;
}

/* Select option styling */
.ym-form-group select option,
.ym-form select option {
    background: rgba(15, 23, 42, 0.95);
    color: var(--ym-form-control-color);
    padding: 8px;
}

/* Disable default select styling on mobile */
.ym-form-group select::-ms-expand,
.ym-form select::-ms-expand {
    display: none;
}

.ym-form-error {
    font-size: 12px;
    color: #fb3b60;
    display: block;
    margin-top: 4px;
}

.ym-link-btn {
    background: none;
    border: none;
    color: var(--ym-accent);
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}

.ym-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ym-modal-panel {
    width: calc(100% - 40px);
    max-width: 820px;
}

.ym-modal-panel-sm {
    max-width: 500px;
}

.ym-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ym-modal-header h2 {
    margin: 0;
}

.ym-modal-body {
    padding: 16px;
}

.ym-btn-circle {
    padding: 0 10px;
    border-radius: 999px;
}

.ym-card-actions-end {
    justify-content: flex-end;
}

.ym-alert {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid transparent;
}

.ym-alert-danger {
    background: rgba(251, 59, 96, 0.1);
    border-color: rgba(251, 59, 96, 0.3);
    color: #f9fafb;
}

.ym-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

.ym-error-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.ym-error-content {
    text-align: center;
    max-width: 480px;
    padding: 0 24px;
}

.ym-error-code {
    font-size: 96px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.ym-error-code-danger {
    color: #ef4444;
}

.ym-error-code-accent {
    color: var(--ym-accent);
}

.ym-error-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f9fafb;
    letter-spacing: -0.01em;
}

.ym-error-text {
    color: var(--ym-muted);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.ym-error-text-lg {
    margin-bottom: 32px;
}

.ym-error-callout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 32px;
}

.ym-error-callout p {
    color: #ef4444;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.ym-error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.ym-text-muted {
    color: var(--ym-muted);
}

.ym-mb-12 {
    margin-bottom: 12px;
}

.ym-branding-current-logo {
    margin-top: 10px;
}

.ym-branding-current-logo-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.ym-branding-current-logo-img {
    max-height: 48px;
}

.ym-auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.ym-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #cbd5f5;
}

.ym-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--ym-accent);
}

.ym-auth-link {
    font-size: 13px;
    color: var(--ym-accent);
    text-decoration: none;
    transition: color 0.18s ease-out;
}

.ym-auth-link:hover {
    color: #0d8fdf;
    text-decoration: underline;
}

.ym-auth-button {
    width: 100%;
    padding: 14px 20px;
    background: var(--ym-accent);
    color: #020617;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s ease-out;
    margin-top: 8px;
}

.ym-auth-button:hover {
    background: #0d8fdf;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 167, 255, 0.4);
}

.ym-auth-button:active {
    transform: translateY(0);
}

.ym-auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.ym-auth-alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.ym-auth-description {
    margin-top: 24px;
}

.ym-auth-description p {
    font-size: 13px;
    line-height: 1.6;
    color: #cbd5f5;
    text-align: center;
}

.ym-auth-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    text-align: center;
}

.ym-auth-footer .ym-auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #cbd5f5;
    text-decoration: none;
    transition: color 0.18s ease-out;
}

.ym-auth-inline-form {
    margin: 0;
}

.ym-auth-inline-form .ym-auth-link {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.ym-auth-footer-tight {
    margin-top: 10px;
}

.ym-auth-footer .ym-auth-link:hover {
    color: var(--ym-accent);
}

.ym-auth-actions {
    display: flex;
    justify-content: center;
}

.ym-empty {
    text-align: center !important;
    color: var(--ym-muted) !important;
    padding: 20px !important;
    font-size: 13px !important;
}

.ym-empty.ym-empty-compact-left {
    padding: 0 !important;
    text-align: left !important;
}

/* Responsive */
@media (max-width: 600px) {
    .ym-auth-container {
        padding: 16px;
    }

    .ym-auth-card {
        padding: 32px 24px;
    }

    .ym-auth-title {
        font-size: 24px;
    }

    .ym-auth-logo .ym-logo-mark {
        font-size: 40px;
    }
}

@media (max-width: 1200px) {
    .ym-header {
        padding: 14px 24px;
    }
    
    .ym-header-inner {
        gap: 16px;
    }
    
    .ym-nav {
        gap: 3px;
    }

    .ym-nav a {
        padding: 7px 12px;
        font-size: 12.5px;
    }
    
    .ym-user-name {
        max-width: 130px;
    }
}

/* -------------------------------------------------------------------------- */
/* Attachments upload (shared component)                                      */
/* -------------------------------------------------------------------------- */

.ym-attachments-hint {
    color: var(--ym-muted);
    font-size: 12px;
    margin: 0;
}

.ym-attachments-upload-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ym-attachments-upload-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ym-attachments-remaining {
    color: var(--ym-muted);
    font-size: 11px;
}

.ym-attachments-file-input {
    display: none;
}

.ym-attachments-grid.ym-attachments-existing {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ym-attachments-muted {
    color: var(--ym-muted);
    font-size: 12px;
    margin:0;
}

.ym-attachments-muted--mt {
    margin: 8px 0 0 0;
}

.ym-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 8px;
    grid-auto-rows: max-content;
    align-items: start;
    align-content: start;
}

.ym-attachments-embed .ym-attachments-grid,
.ym-attachments-embed .ym-attachments-queue {
    margin-top: 0;
}

@media (max-width: 640px) {
    .ym-attachments-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .ym-attachment-tile {
        padding: 6px;
        border-radius: 11px;
        min-height: 92px;
    }

    .ym-attachment-tile-thumb {
        border-radius: 9px;
    }

    .ym-attachment-tile-badge {
        font-size: 9px;
        letter-spacing: 0.2px;
    }

    .ym-attachment-tile-name {
        font-size: 11px;
    }
}

.ym-attachments-queue {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ym-attachment-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(15, 53, 74, 0.35);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.ym-attachment-upload-thumb {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ym-attachment-upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ym-attachment-upload-thumb-badge {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .3px;
    text-transform: uppercase;
    user-select: none;
    background: rgba(208, 124, 124, 0.75);
    color: #fff;
}

.ym-attachment-upload-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.88);
    width: 25%;
}

.ym-attachment-upload-status {
    font-size: 11px;
    color: var(--ym-muted);
    min-width: 46px;
    text-align: right;
}

@media (prefers-reduced-motion: no-preference) {
    .ym-attachment-fade-in {
        animation: ymFadeInUp 300ms ease-out both;
    }
    .ym-attachment-fade-out {
        animation: ymFadeOutDown 200ms ease-in both;
    }
    .ym-attachment-fade-out-scale {
        animation: ymFadeOutScale 300ms ease-in both;
        transform-origin: center center;
    }
    @keyframes ymFadeInUp {
        from {
            opacity: 0;
            transform: translateY(6px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    @keyframes ymFadeOutDown {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(6px);
        }
    }
    @keyframes ymFadeOutScale {
        from {
            opacity: 1;
            transform: scale(1);
        }
        to {
            opacity: 0;
            transform: scale(0);
        }
    }
}

.ym-attachment-tile {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    padding: 0px;
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-height: 106px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    isolation: isolate;
    transition: all 0.3s ease;
}

.ym-attachment-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(15, 53, 74, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transform: translateZ(0);
    z-index: 0;
}

.ym-attachment-tile > * {
    position: relative;
    z-index: 1;
}

@supports (-webkit-touch-callout: none) {
    .ym-attachment-tile::before {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: rgba(15, 53, 74, 0.72);
    }
    .ym-attachment-upload-row {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
}

.ym-attachment-tile-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    color: #fff;
}

.ym-attachment-tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ym-attachment-tile-badge {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: .3px;
    text-transform: uppercase;
    user-select: none;
    background: rgba(208, 124, 124, 0.75);
    color: #fff;
}

.ym-attachment-tile-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    border: 7px solid transparent;
    box-sizing: border-box;
    line-height: 1.3;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    overflow-wrap: anywhere;
    height: calc(2.6em + 14px); /* fallback for browsers without lh */
    height: calc(2lh + 14px);   /* 2 lines + border (7px*2) */
}

.ym-attachment-tile-name.ym-link {
    color: rgba(255, 255, 255, 0.88);
}

.ym-attachment-tile-name.ym-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.ym-attachment-upload-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
}

.ym-attachment-upload-progress-bar {
    height: 100%;
    width: 0;
    background: var(--ym-accent, #2563eb);
    transition: width 0.15s linear;
}

.ym-attachment-tile-delete,
.ym-attachment-upload-remove-btn,
.ym-attachment-delete-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    line-height: 1;
    font-size: 14px;
    padding: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.ym-attachment-tile .ym-attachment-tile-delete,
.ym-attachment-tile .ym-attachment-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
}

.ym-attachment-tile-delete:hover,
.ym-attachment-upload-remove-btn:hover,
.ym-attachment-delete-btn:hover {
    background: rgba(0, 0, 0, 0.55);
}

/* Crew: assign vessels */
.ym-assign-vessel-user-card {
    margin-bottom: 18px;
}

.ym-assign-vessel-user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.ym-callout {
    max-width: 1280px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

.ym-callout-info {
    background: rgba(30, 167, 255, 0.08);
    border: 1px solid rgba(30, 167, 255, 0.28);
    color: rgba(255, 255, 255, 0.88);
}

.ym-callout strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.ym-assign-vessel-legend {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 0;
}

.ym-assign-vessel-panel,
.ym-vessel-pick-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Group heading + grid for vessel tiles (assign-vessels, org lists, etc.) */
.ym-vessel-pick-org-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ym-muted);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ym-vessel-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .ym-vessel-pick-grid {
        grid-template-columns: 1fr;
    }
}

/* Shared vessel tile (checkbox assign mode or read-only link) */
.ym-vessel-pick-card {
    position: relative;
    border-radius: var(--ym-radius-card);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(30, 167, 255, 0.04);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transition:
        border-color 0.18s ease-out,
        box-shadow 0.18s ease-out,
        background 0.18s ease-out;
}

/* Left accent bar when a checkbox row is selected */
.ym-vessel-pick-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: var(--ym-radius-card) 0 0 var(--ym-radius-card);
    background: var(--ym-accent);
    transition: width 0.18s ease-out;
    pointer-events: none;
}

.ym-vessel-pick-card:hover {
    border-color: rgba(148, 163, 184, 0.38);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.ym-vessel-pick-card:has(.ym-vessel-pick-checkbox:checked) {
    border-color: rgba(30, 167, 255, 0.48);
    background: rgba(30, 167, 255, 0.12);
    box-shadow:
        0 0 0 1px rgba(30, 167, 255, 0.12),
        0 8px 22px rgba(15, 23, 42, 0.35);
}

.ym-vessel-pick-card:has(.ym-vessel-pick-checkbox:checked)::before {
    width: 4px;
}

a.ym-vessel-pick-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

a.ym-vessel-pick-card--link .ym-vessel-pick-body {
    padding: 12px 14px;
}

.ym-vessel-pick-card--display {
    opacity: 0.72;
}

.ym-vessel-pick-card--display .ym-vessel-pick-body {
    padding: 12px 14px;
}

.ym-vessel-pick-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    margin: 0;
    min-height: 100%;
    box-sizing: border-box;
}

.ym-vessel-pick-checkbox {
    margin-top: 4px;
    flex-shrink: 0;
    accent-color: var(--ym-accent, #1ea9ff);
}

.ym-vessel-pick-body {
    flex: 1;
    min-width: 0;
}

.ym-vessel-pick-name {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #f3f4f6;
    line-height: 1.3;
}

.ym-vessel-pick-line {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--ym-muted);
    line-height: 1.35;
}

.ym-vessel-pick-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ym-vessel-pick-dtdd {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    font-size: 12px;
    line-height: 1.35;
}

.ym-vessel-pick-dtdd dt {
    margin: 0;
    color: var(--ym-muted);
    font-weight: 500;
}

.ym-vessel-pick-dtdd dd {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    word-break: break-word;
}

/* Key/value rows: two columns inside vessel profile cards */
.ym-list-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
}

.ym-list-two-col > li {
    min-width: 0;
}

.ym-list-two-col .ym-list-item-full {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .ym-list-two-col {
        grid-template-columns: 1fr;
        gap: 0px;
    }
}

.ym-vessel-tab-stack [id^="vessel-"] {
    scroll-margin-top: 88px;
}

.ym-vessel-machinery-gap {
    margin-top: 1.75rem;
}

.ym-vessel-subheading {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #e5e7eb;
}

.ym-list-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px 30px;
}

