:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --border: #dde4ee;
    --border-strong: #c7d2df;
    --text: #172033;
    --muted: #66758a;
    --primary: #2357d6;
    --primary-hover: #1e49b5;
    --primary-soft: #e8efff;
    --success: #16834a;
    --success-soft: #e9f8ef;
    --warning: #b95f09;
    --warning-soft: #fff4dd;
    --danger: #c62828;
    --danger-soft: #ffeded;
    --night: #e0f2fe;
    --evening: #ffedd5;
    --morning: #f8fafc;
    --shadow: 0 8px 24px rgba(17, 24, 39, 0.07);
    --shadow-sm: 0 3px 12px rgba(17, 24, 39, 0.06);
    --radius-xl: 14px;
    --radius-lg: 12px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --sidebar-width: 280px;
    --transition: 0.2s ease;
    --font-main: "Segoe UI", "Noto Sans", "Arial", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
}

body.app-shell {
    min-height: 100vh;
}

body.rtl {
    direction: rtl;
}

body.ltr {
    direction: ltr;
}

.online-status-indicator {
    position: fixed;
    inset-inline-end: 14px;
    inset-block-end: 14px;
    z-index: 1200;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--success-soft);
    color: var(--success);
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.online-status-indicator.offline {
    background: var(--warning-soft);
    color: var(--warning);
}

.online-status-indicator.cloud-api {
    background: var(--primary-soft);
    color: var(--primary);
}

.api-mode-panel {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
}

.api-mode-title {
    margin: 0 0 8px;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text);
}

.api-mode-actions {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.api-mode-panel.expanded .api-mode-actions {
    display: flex;
}

.api-mode-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.api-mode-status {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
    word-break: break-word;
}

.api-advanced-toggle {
    margin-top: 10px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

html.embedded-admin-root,
body.embedded-admin {
    background: transparent;
}

body.embedded-admin.app-shell {
    min-height: auto;
}

body.embedded-admin .app-layout {
    display: block;
    min-height: auto;
}

body.embedded-admin .sidebar,
body.embedded-admin .topbar,
body.embedded-admin .app-footer {
    display: none;
}

body.embedded-admin .main-area {
    min-height: auto;
    padding: 0;
}

body.embedded-admin .panel {
    border-radius: 8px;
    box-shadow: none;
}

body.embedded-admin .position-form-panel,
body.embedded-admin .template-form-panel,
body.embedded-admin .assignment-form-panel {
    top: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

body.ltr .app-layout {
    flex-direction: row;
}

body.rtl .app-layout {
    flex-direction: row-reverse;
}

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-inline-end: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow);
    z-index: 10;
}

body.rtl .sidebar {
    border-inline-end: none;
    border-inline-start: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 8px 12px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.brand-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.87rem;
}

.sidebar-section-title {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-inline: 10px;
    margin-bottom: 8px;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 10px;
    color: var(--text);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.nav-item:hover {
    background: #eff6ff;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.nav-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}

.sidebar-footer-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.sidebar-footer-text {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.45;
}

.main-area {
    flex: 1;
    min-width: 0;
    padding: 28px;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}


.page-heading {
    min-width: 0;
}

.page-title {
    margin: 0;
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    line-height: 1.1;
    font-weight: 800;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.rtl .topbar-actions {
    justify-content: flex-start;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px;
    box-shadow: var(--shadow);

    direction: ltr;
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 9px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    font-size: 0.92rem;
    font-weight: 600;
}

.lang-btn:hover {
    background: #eff6ff;
    color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 22px;
}

.panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-body {
    padding: 24px;
}

.hero-card {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 35%),
        radial-gradient(circle at bottom right, rgba(96, 165, 250, 0.1), transparent 35%),
        #ffffff;
}

.hero-title {
    margin: 0;
    font-size: clamp(1.7rem, 2.4vw, 2.5rem);
    line-height: 1.1;
    font-weight: 800;
    max-width: 12ch;
}

.hero-text {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 60ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    min-height: 42px;
    white-space: nowrap;
}

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

.btn:focus-visible,
.lang-btn:focus-visible,
.nav-item:focus-visible,
.sidebar-toggle:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
    outline: 3px solid rgba(35, 87, 214, 0.22);
    outline-offset: 2px;
}

.btn:disabled,
.cell-btn:disabled,
.table-btn:disabled,
.shift-picker-option:disabled,
.entry-delete:disabled,
.entry-status-remove-btn:disabled,
.status-remove-btn:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-soft {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-soft:hover {
    background: #c7ddff;
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #ffc9c9;
}

.btn-danger:hover {
    background: #ffdede;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-btn {
    min-height: 36px !important;
    padding: 8px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--text) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    line-height: 1.1;
    white-space: nowrap;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.table-btn:hover {
    transform: translateY(-1px);
}

.table-btn.edit {
    background: var(--primary-soft) !important;
    border-color: #bfdbfe !important;
    color: var(--primary) !important;
}

.table-btn.edit:hover {
    background: #dbeafe !important;
}

.table-btn.delete {
    background: var(--danger-soft) !important;
    border-color: #fecaca !important;
    color: var(--danger) !important;
}

.table-btn.delete:hover {
    background: #fee2e2 !important;
}

.table-btn:focus-visible,
.settings-nav-item:focus-visible,
.settings-directory-tab:focus-visible,
.cell-btn:focus-visible,
.shift-picker-close:focus-visible,
.shift-picker-option:focus-visible,
.entry-delete:focus-visible,
.entry-status-remove-btn:focus-visible,
.status-remove-btn:focus-visible {
    outline: 3px solid rgba(35, 87, 214, 0.22);
    outline-offset: 2px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.section-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.stat-label {
    color: var(--muted);
    font-size: 0.87rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-subtext {
    font-size: 0.84rem;
    color: var(--muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-action {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #bfdbfe;
}

.quick-action-title {
    margin: 0 0 8px;
    font-weight: 800;
    font-size: 0.98rem;
}

.quick-action-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.9rem;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
}

.alert-item.warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.alert-item.info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.alert-item.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.alert-icon {
    font-size: 1rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.alert-content {
    min-width: 0;
}

.alert-title {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.alert-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.5;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.info-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.info-value {
    font-weight: 700;
    text-align: end;
}

body.rtl .info-value {
    text-align: start;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 700;
}

.mt-18 {
    margin-top: 18px;
}

.mt-22 {
    margin-top: 22px;
}

.mt-24 {
    margin-top: 24px;
}

.hidden {
    display: none !important;
}

/* Utilities for future pages */
.page-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
}

.empty-state-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
}

.empty-state-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

body.rtl .empty-state {
    align-items: flex-start;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 7px;
    font-weight: 600;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.table-shell {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.table-clean {
    width: 100%;
    border-collapse: collapse;
}

.table-clean th,
.table-clean td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: start;
}

.table-clean th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

body.rtl .table-clean th,
body.rtl .table-clean td {
    text-align: right;
}

body.ltr .table-clean th,
body.ltr .table-clean td {
    text-align: left;
}

@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {

    .app-layout,
    body.ltr .app-layout,
    body.rtl .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-inline-end: none !important;
        border-inline-start: none !important;
        border-bottom: 1px solid var(--border);
        border-radius: 0 0 24px 24px;
    }

    .main-area {
        padding: 18px;
    }

    .topbar,
    body.rtl .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .stats-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

.footer-left {
    margin-inline-end: auto;
}

body.rtl .footer-left {
    margin-inline-end: 0;
    margin-inline-start: auto;
}

@media (max-width: 560px) {

    .panel-body {
        padding: 18px;
    }

    .brand {
        padding-inline: 2px;
    }

    .lang-switcher {
        width: 100%;
        justify-content: space-between;
    }

    .lang-btn {
        flex: 1;
        text-align: center;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

.sidebar-toggle {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
}

.sidebar-toggle:hover {
    background: #f8fafc;
}

body.sidebar-collapsed {
    --sidebar-width: 88px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer {
    display: none;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 14px 10px;
}

body.sidebar-collapsed .nav-icon {
    width: auto;
    font-size: 1.05rem;
}

body.sidebar-collapsed .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

@media (max-width: 920px) {
    body.sidebar-collapsed {
        --sidebar-width: 100%;
    }

    body.mobile-sidebar-hidden .sidebar {
        gap: 0;
        padding-block: 14px;
    }

    body.mobile-sidebar-hidden .sidebar > div:not(.sidebar-top-row),
    body.mobile-sidebar-hidden .sidebar-footer {
        display: none;
    }
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: #f3f5f9;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 12px auto 18px auto;

    position: static;
}

.sidebar-toggle {

    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #f3f5f9;
    cursor: pointer;
}

.sidebar-toggle {
    width: 42px !important;
    height: 42px !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--text) !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.sidebar-toggle:hover {
    background: #f8fafc !important;
    border-color: #bfdbfe !important;
    transform: translateY(-1px);
}

.app-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 14px;
    flex-wrap: wrap;

    font-size: 0.85rem;
    color: var(--muted);


}

.footer-right {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-right a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.footer-right a:hover {
    text-decoration: underline;
}

body.rtl .app-footer {
    flex-direction: row-reverse;
}

.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
}

.app-modal-overlay.is-open {
    display: flex;
}

.app-modal {
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.app-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.app-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.app-modal-body {
    padding: 20px;
    color: var(--muted);
    line-height: 1.5;
    overflow: auto;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px 20px;
}

.app-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.app-select-trigger {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: start;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.app-select-trigger::after {
    content: "⌄";
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 1rem;
}

.app-select-trigger:hover,
.app-select-trigger:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.app-select-trigger:disabled {
    cursor: not-allowed;
    color: var(--muted);
    background: #eef2f7;
    box-shadow: none;
}

.app-select-trigger-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-select-modal {
    width: min(520px, 100%);
}

.app-select-options {
    display: grid;
    gap: 8px;
}

.app-select-option {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    text-align: start;
}

.app-select-option.is-selected {
    border-color: var(--primary);
    background: #e8f0ff;
    color: var(--primary);
}

body.rtl .app-select-trigger,
body.rtl .app-select-option {
    text-align: right;
}

/* Beta 0.12.1: shared mobile/RTL hardening for data-heavy pages. */
.table-clean {
    min-width: 720px;
}

.list-card,
.panel,
.schedule-shell {
    max-width: 100%;
}

body.rtl input,
body.rtl select,
body.rtl textarea {
    text-align: right;
}

body.rtl input[type="number"],
body.rtl input[type="time"],
body.rtl input[type="date"] {
    direction: ltr;
    text-align: right;
}

@media (max-width: 700px) {
    .main-content {
        padding: 18px 14px;
    }

    .topbar {
        align-items: stretch;
        gap: 12px;
    }

    .topbar-actions,
    .toolbar-actions,
    .form-actions,
    .table-actions {
        width: 100%;
    }

    .table-actions {
        justify-content: stretch;
    }

    .table-actions .table-btn,
    .table-actions .btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .page-title,
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.15;
    }

    .table-clean {
        min-width: 640px;
    }

    .empty-state-actions {
        width: 100%;
    }

    .empty-state-actions .btn {
        width: 100%;
    }
}
