/* ================================================================ */
/* GLOBAL VARIABLES & FOUNDATION STYLES */
/* ================================================================ */

/* Variable system */
/*
This palette uses a combination of powder, sky, and deep blue hues, plus light indigo for accents.
The subtle shifts make the UI dynamic and layered, while still feeling cohesive and easy on the eyes.
It's "blue" but not dull or monochromatic.
*/

:root {
    /* Core Palette */
    --color-bg-main: #e8f0fa;
    --color-bg-surface: #fafdff;
    --color-bg-card: #fff;
    --color-bg-accent: #dae4f2;

    --color-text-main: #174d79;
    --color-text-muted: #5376a2;
    --color-text-accent: #99c7ea;
    --color-text-dim: #34495e;

    --color-primary: #3570ba;
    --color-primary-dark: #234578;
    --color-primary-xdark: #132440;
    --color-primary-gradient-start: var(--color-primary);
    --color-primary-gradient-end: #2997bc;
    --color-primary-gradient: linear-gradient(90deg, var(--color-primary-gradient-start) 0%, var(--color-primary-gradient-end) 100%);
    --color-primary-gradient-hover: linear-gradient(90deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);

    --color-secondary: #e5eefc;
    --color-secondary-text: var(--color-primary-dark);
    --color-secondary-hover: #d1def6;
    --color-secondary-border: #aec0df;

    --color-accent: #7ca1c9;

    --color-warning: #A23E48;
    --color-warning-dark: #7F2E36;

    --color-success: #66BB6A;
    --color-danger: #D32F2F;
    --color-danger-hover: #b12020;
    --color-info: #42A5F5;
    --color-disabled-bg: #ecf3fa;
    --color-disabled-text: #a3b3c7;

    --color-surface-alt: #dae4f2;
    --color-surface-alt-hover: #b9c9e1;
    --color-surface-alt-text: var(--color-primary-dark);

    --focus-ring: #cbe5ff;

    /* Notes Tab Variables */
    --notes-border: #ddd;
    --input-focus: #007bff;
    --notes-text: #333;
    --notes-text-muted: #666;
    --notes-text-placeholder: #999;
    --notes-bg: #fff;
    --notes-bg-hover: #f8f9fa;
    --notes-bg-completed: #b4f0b4;
    --notes-character-count-bg: rgba(255, 255, 255, 0.9);
    --notes-edit-hover-bg: #e3f2fd;
    --notes-edit-hover-text: #1976d2;
    --notes-delete-hover-bg: #ffebee;
    --notes-delete-hover-text: #d32f2f;
    --notes-focus-shadow: rgba(0, 123, 255, 0.1);

    /* Care Plan Modal Colors */
    --care-plan-tab-bg: var(--color-bg-surface);
    --care-plan-tab-active: var(--color-primary);
    --care-plan-tab-hover: var(--color-secondary-hover);
    --care-plan-option-bg: var(--color-bg-card);
    --care-plan-option-bg-hover: var(--color-bg-accent);
    --care-plan-option-bg-selected: #d1f5d1;
    --care-plan-option-bg-selected-hover: #b9f5b9;
    --care-plan-option-border: var(--color-secondary-border);
    --care-plan-priority-high: #ffebee;
    --care-plan-priority-medium: #fff3e0;
    --care-plan-priority-low: #f3e5f5;
    --care-plan-priority-critical: #fce4ec;
    --care-plan-notes-bg: #f8f9fa;
    --care-plan-header-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);

    /* Shadows */
    --shadow-main: 0 8px 40px rgba(51, 102, 170, 0.13), 0 1.5px 7px rgba(40, 60, 100, 0.10);
    --header-shadow: 0 8px 40px rgba(44, 101, 175, 0.13), 0 1.5px 7px rgba(28, 44, 77, 0.1);
    --shadow-btn: 0 2px 8px rgba(85, 102, 221, 0.06);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* Spacing (use multiples) */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Font sizes */
    --font-xs: 0.85rem;
    --font-sm: 1rem;
    --font-md: 1.15rem;
    --font-lg: 1.3rem;
    --font-xl: 1.5rem;

    /* Inputs */
    --input-bg: #ecf3fa;
    --input-bg-disabled: #e9ecef;
    --input-border: #7ca1c9;
    --input-border-disabled: #ced4da;
    --input-focus: var(--color-primary);
    --input-radius: var(--radius-md);

    --max-width: 1600px;
    --sidebar-width: 250px;
    --header-height: 60px;

    /* Gradients */
    --header-gradient: linear-gradient(100deg, var(--color-bg-surface) 70%, #e5eefc 100%);
    --sidebar-gradient: linear-gradient(150deg, var(--color-primary-xdark) 75%, #273454 100%);
    --color-delete-gradient-light: linear-gradient(90deg, rgba(207, 46, 46, 0.24), rgba(233, 67, 67, 0.24));
    --color-delete-gradient: linear-gradient(90deg, var(--color-danger), #e94343);
    --color-delete-gradient-hover: linear-gradient(90deg, var(--color-danger-hover), #dd3434);

    /* Shift Status Colors */
    --shift-open: linear-gradient(90deg, var(--color-primary) 0%, #285197 100%);
    /* True, deep brand blue */
    --shift-open-text: #fff;

    --shift-pending: linear-gradient(90deg, #f7ce6c 0%, #ffd867 100%);
    --shift-pending-text: var(--color-primary-dark);

    --shift-tentative: linear-gradient(90deg, #b19cd9 0%, #6a89cc 100%);
    --shift-tentative-text: var(--color-primary-dark);

    --shift-confirmed: linear-gradient(90deg, #81e4c6 0%, #4fd2be 100%);
    /* Vibrant aqua/light green-blue */
    --shift-confirmed-text: var(--color-primary-dark);

    --shift-in-progress: linear-gradient(90deg, #c9e265 0%, #7ed957 100%);
    /* Lime/green, bright and active */
    --shift-in-progress-text: var(--color-primary-dark);

    --shift-completed: linear-gradient(90deg, #66bb6a 0%, #43a047 100%);
    --shift-completed-text: #fff;

    --shift-canceled: linear-gradient(90deg, #bdbdbd 0%, #dadada 100%);
    --shift-canceled-text: var(--color-primary-dark);

    --shift-extra: linear-gradient(90deg, #dae4f2 0%, #e8f0fa 100%);
    --shift-extra-text: var(--color-primary-dark);

    --shift-finalized: linear-gradient(90deg, #d946ef 0%, #a855f7 100%);
    /* Vibrant fuchsia/pink-purple for finalized shifts */
    --shift-finalized-text: #fff;

    --shift-needs-review: linear-gradient(90deg, #a23e48 0%, #ffb1b1 100%);
    /* Red/rose gradient (recycled from clock-out-missed) for shifts needing admin attention */
    --shift-needs-review-text: #fff;
}

/* Utility Classes For Spacing */
.mt-xs {
    margin-top: var(--space-xs);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-xs {
    margin-bottom: var(--space-xs);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.p-xs {
    padding: var(--space-xs);
}

.p-sm {
    padding: var(--space-sm);
}

.p-md {
    padding: var(--space-md);
}

.p-lg {
    padding: var(--space-lg);
}

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

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

.text-ul-hover:hover {
    text-decoration: underline;
}

.w-100 {
    width: 100%;
}

.center-block {
    display: block;
    width: 100%;
    text-align: center;
}

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

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--color-bg-main);
    color: var(--color-text-main);
    font-size: var(--font-sm);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-main);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

h1 {
    font-size: var(--font-xl);
}

h2 {
    font-size: var(--font-lg);
}

h3 {
    font-size: var(--font-md);
}

body.no-scroll {
    overflow: hidden;
}

/* ================================================================ */
/* LAYOUT - MAIN, HEADER, SIDEBAR */
/* ================================================================ */

main {
    position: relative;
    /* Dashboard class should sit to the right of sidebar and below header */
    margin-left: var(--sidebar-width, 250px);
    padding: 0 var(--space-md) var(--space-md) var(--space-md);
    /* Additional distance from header and sidebar */
    margin-top: var(--header-height, 60px);
    /* Fill the rest of the space */
    min-height: calc(100vh - var(--header-height, 60px));
    background: var(--color-bg-main);
    transition: margin 0.2s;
}

@media (max-width: 1100px) {
    main {
        margin-left: 0;
        /* Sidebar becomes overlay or full width */
        margin-top: var(--header-height, 60px);
        padding: var(--space-md);
    }
}

@media (max-width: 700px) {
    main {
        margin-left: 0;
        /* Sidebar is collapsed/overlays */
        margin-top: var(--header-height, 60px);
        padding: var(--space-sm);
    }
}

/* Navbar, Sidebar, Layout */
header {
    background: var(--header-gradient);
    color: var(--text-main);
    box-shadow: var(--header-shadow);
    padding: 0.3em 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1000;
}

header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: var(--header-light-strip);
    opacity: 0.11;
    pointer-events: none;
    z-index: 1;
}

.logo {
    margin-left: var(--sidebar-width);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: var(--sidebar-gradient);
    box-shadow: var(--sidebar-shadow);
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    /* border-right: var(--sidebar-border); */
    color: #fff;
    padding-top: 90px;
    box-shadow: 3px 0 16px rgba(40, 60, 100, 0.07);
    z-index: 1001;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li {
    padding: 15px 24px;
    margin-left: 0.25em;
    margin-right: 0.25em;
    margin-bottom: 0.1em;
    text-align: left;
    border-radius: 8px;
    transition: background 0.14s;
}

.sidebar nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.04rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    display: block;
    padding: 0.1em 0.1em;
    transition: all 0.14s;
}

.sidebar nav ul li:hover {
    background: var(--color-primary);
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    color: var(--color-text-accent);
}

/* Template Layout */
.user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.2em;
    font-size: 1.01em;
    margin-left: 0;
}

/* Organization Dropdown - Minimal Header Style */
.org-select-block {
    display: flex;
    align-items: center;
}

.org-select-block select {
    width: auto;
    min-width: 120px;
    max-width: 200px;
    padding: 0.35em 2em 0.35em 0.75em;
    margin-bottom: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-primary-dark);
    background-color: transparent;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23234578' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5em center;
    background-size: 12px;
}

.org-select-block select:hover {
    border-color: var(--color-primary);
    background-color: var(--color-secondary);
}

.org-select-block select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.org-select-block .create-org-btn {
    padding: 0.35em 0.75em;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ================================================================ */
/* HEADER NOTIFICATIONS & PROFILE DROPDOWN */
/* ================================================================ */

/* Notification Bell */
.header-notifications {
    position: relative;
}

.notification-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    color: var(--color-primary-dark);
    cursor: pointer;
    transition: all 0.15s ease;
}

.notification-bell:hover {
    background: var(--color-secondary);
    border-color: var(--color-primary);
}

.notification-bell svg {
    width: 18px;
    height: 18px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-secondary-border);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-secondary-border);
    background: var(--color-bg-surface);
}

.notification-dropdown-header span {
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.95rem;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.mark-all-read:hover {
    background: var(--color-secondary);
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--color-secondary-border);
    background: var(--color-bg-surface);
    text-align: center;
}

.notification-see-all {
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.notification-see-all:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-secondary-border);
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--color-bg-surface);
}

.notification-item.unread {
    background: var(--color-secondary);
}

.notification-item.unread:hover {
    background: var(--color-secondary-hover);
}

.notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon-default {
    background: var(--color-secondary);
    color: var(--color-primary);
}

.notification-icon-warning {
    background: #fff3e0;
    color: #f57c00;
}

.notification-icon-success {
    background: #e8f5e9;
    color: #43a047;
}

.notification-icon-danger {
    background: #ffebee;
    color: #e53935;
}

.notification-icon-info {
    background: #e3f2fd;
    color: #1e88e5;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-main);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-link {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

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

.notification-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.notification-dismiss {
    flex-shrink: 0;
    padding: 4px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: all 0.15s;
}

.notification-item:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss:hover {
    background: var(--color-secondary);
    color: var(--color-danger);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notification-actions .btn-mark-read {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.notification-item:hover .notification-actions .btn-mark-read {
    opacity: 1;
}

.notification-actions .btn-mark-read:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

.notification-empty,
.notification-loading {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Profile Dropdown */
.header-profile {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: transparent;
    border: 1px solid var(--color-accent);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-button:hover {
    background: var(--color-secondary);
    border-color: var(--color-primary);
}

.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-chevron {
    color: var(--color-primary-dark);
    transition: transform 0.2s;
}

.profile-button:hover .profile-chevron {
    transform: translateY(2px);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-secondary-border);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--color-secondary-border);
    background: var(--color-bg-surface);
}

.profile-dropdown-name {
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.profile-dropdown-email {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--color-secondary-border);
    margin: 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--color-text-main);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.profile-dropdown-item:hover {
    background: var(--color-bg-surface);
}

.profile-dropdown-item svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.profile-dropdown-logout {
    color: var(--color-danger);
}

.profile-dropdown-logout svg {
    color: var(--color-danger);
}

.profile-dropdown-logout:hover {
    background: #ffebee;
}

@media (max-width: 1100px) {
    .navbar {
        flex-direction: row;
        gap: 1em;
        padding: 0.7em 0.5em;
    }

    .sidebar {
        width: 98vw;
        left: 1vw;
    }
}

@media (max-width: 700px) {
    .navbar {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md) var(--space-xs);
    }

    .sidebar {
        width: 100vw;
        left: 0;
        padding-top: var(--header-height);
    }
}

@media (max-width: 600px) {

    .navbar,
    .sidebar {
        padding: var(--space-sm);
    }
}

/* ================================================================ */
/* GLOBAL COMPONENTS - BUTTONS, FORMS, MODALS */
/* ================================================================ */

/* Unified Button System */
.btn {
    display: inline-block;
    padding: var(--space-xs);
    font-size: var(--font-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-btn);
    cursor: pointer;
    transition: background 0.15s, color 0.12s, transform 0.14s;
}

.btn:disabled,
.btn:disabled {
    background: var(--color-disabled-bg);
    color: var(--color-disabled-text);
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

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

.btn-primary:not([disabled]):hover,
.btn-primary:not([disabled]):focus-visible {
    background: var(--color-primary-gradient-hover);
    transform: translateY(-2px) scale(1.03);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-secondary-text);
    border: 1.5px solid var(--color-secondary-border);
    box-shadow: var(--shadow-btn);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--color-secondary-hover);
    color: var(--color-primary-dark);
    transform: translateY(-2px) scale(1.03);
}

.btn-cancel {
    background: var(--color-surface-alt);
    color: var(--color-surface-alt-text);
}

.btn-cancel:hover,
.btn-cancel:focus-visible {
    background: var(--color-surface-alt-hover);
    color: var(--color-primary-dark);
}

.btn-warning {
    background: var(--color-warning);
    color: #fff;
}

.btn-warning:hover {
    background: var(--color-warning-dark);
}

.btn-approve {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: #fff;
}

.btn-approve:not([disabled]):hover,
.btn-approve:not([disabled]):focus-visible {
    background: linear-gradient(135deg, #388e3c 0%, #1b5e20 100%);
    transform: translateY(-2px) scale(1.03);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--input-border);
    color: var(--color-text-main);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--color-bg-accent);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.btn-outline.btn-danger {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: var(--color-delete-gradient-light);
}

.btn-outline.btn-danger:hover {
    background: var(--color-delete-gradient);
    color: white;
    border-color: var(--color-danger-hover);
}

.btn-outline.btn-warning {
    border-color: var(--color-warning);
    color: var(--color-warning);
    background: transparent;
}

.btn-outline.btn-warning:hover {
    background: var(--color-warning);
    color: white;
}

/* Utility */
.button-row {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

@media (max-width: 600px) {
    .button-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

.delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    background: var(--color-delete-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md, 6px);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.delete-btn:hover {
    background: var(--color-delete-gradient-hover);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.delete-btn:active {
    transform: scale(0.98);
}

.delete-icon {
    width: 1.25em;
    height: 1.25em;
    stroke: currentColor;
}

/* Form & Input Styles */
label {
    display: block;
    font-size: var(--font-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--input-radius);
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    color: var(--color-text-main);
    font-size: var(--font-xs);
    margin-bottom: var(--space-sm);
    resize: none;
    transition: border-color 0.15s, box-shadow 0.13s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--color-disabled-bg);
    color: var(--color-disabled-text);
    cursor: not-allowed;
    opacity: 0.85;
}

input[type="checkbox"],
input[type="radio"] {
    width: 12px;
    margin: 0;
    accent-color: var(--color-primary);
    box-shadow: none;
    cursor: pointer;
}

span.required {
    color: var(--color-danger);
}

.form-group {
    margin-bottom: var(--space-sm);
}

.form-validation-error-message {
    color: var(--color-warning);
    font-style: italic;
    font-size: var(--font-xs);
    margin-top: var(--space-xs);
}

.svg-gradients {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    visibility: hidden;
}

.main-svg-gradient stop:first-of-type {
    stop-color: var(--color-primary-gradient-start)
}

.main-svg-gradient stop:last-of-type {
    stop-color: var(--color-primary-gradient-end)
}

.full-width-container {
    flex-grow: 1;
}

/* Card & Modal Styles */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

/* Global modal styling */
.modal {
    max-height: 90vh;
    background: white;
    overflow-y: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-main);
    line-height: 1;
    margin-left: var(--sidebar-width, 250px);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-tabs {
    display: flex;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--input-border);
    box-shadow: var(--header-shadow);
    overflow-x: auto;
}

/* Scrollable content area */
.modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Takes up remaining space */
    overflow-y: auto;
    /* Makes this section scrollable */
    padding: 1rem;
    background: var(--color-bg-surface);
}

.modal-btn-group {
    display: flex;
    justify-content: space-between;
    flex-shrink: 0 !important;
    align-items: center;
    border-top: 1px solid var(--color-secondary-border);
    gap: var(--space-md);
    padding: var(--space-sm);
    min-height: 7%;
}

/* Custom scrollbar for webkit browsers */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1d0e9;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #7ca1c9;
}

dialog::backdrop {
    z-index: 1000;
}

/* ================================================================ */
/* VIEW CLIENTS PAGE */
/* ================================================================ */

/* Toolbar full width, sticky on top of dashboard if desired */
.toolbar-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 2;
    gap: var(--space-md);
}

#filter-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
}

#filter-container select,
#filter-container input {
    margin-bottom: 0px;
}

/* Responsive toolbar stacking on mobile */
@media (max-width: 700px) {
    .toolbar-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
        padding: var(--space-md);
    }
}

/* Create-profile-container always centered horizontally */
#create-profile-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    padding: var(--space-sm);
}


#profile-form-container {
    padding: var(--space-md);
    background-color: var(--color-bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}


/* Profile cards container: stack and center */
.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

/* Floating, animated profile cards */
.profile-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-md);
    width: 100%;
    transition: box-shadow 0.3s;
    position: relative;
}

.profile-card:hover,
.profile-card:focus-within {
    box-shadow: 0 10px 28px rgba(51, 102, 170, 0.16), 0 2px 8px rgba(40, 60, 100, 0.10);
    z-index: 3;
}

.profile-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.icon-container {
    display: flex;
    gap: var(--space-sm);
}

.profile-icon {
    width: 28px;
    height: 28px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.18s, transform 0.18s cubic-bezier(.25, .8, .25, 1);
    cursor: pointer;
    padding-top: var(--space-xs);
    background: transparent;
    border-radius: 50%;
    box-shadow: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
    fill: none;
}

.profile-card:hover .profile-icon,
.profile-card:focus-within .profile-icon {
    opacity: 1;
}

.profile-icon:hover,
.profile-icon:focus {
    transform: scale(1.2);
    box-shadow: var(--shadow-card);
    background: var(--color-bg-main);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fae9b0;
    color: #856404;
}

.status-none {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive cards: wider on desktop, full on mobile */
@media (max-width: 700px) {
    .profile-card {
        padding: var(--space-md);
    }

    .icon-container {
        top: var(--space-sm);
        right: var(--space-sm);
        gap: var(--space-xs);
    }

    .profile-icon {
        width: 20px;
        height: 20px;
    }
}

/* ================================================================ */
/* SHIFT DETAILS, RECURRENCE & NOTES MODALS */
/* ================================================================ */

/* Checkbox Styling */
.checkbox-group {
    display: flex;
    justify-content: left;
    align-items: center;
    white-space: nowrap;
    max-width: 40%;
    gap: 5px;
}

.checkbox-group input[type="radio"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.checkbox-group input[type="radio"]:disabled + label {
    color: var(--text-secondary, #666);
    cursor: not-allowed;
}

.shift-duration-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    gap: 10px;
}

.clickable-form-span {
    color: #34495e;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.clickable-form-span:hover {
    transform: translateY(-2px);
    text-decoration: underline;
}

.clickable-form-span.disabled {
    font-style: italic;
    font-size: small;
    text-decoration: none;
}

.clickable-form-span.disabled:hover {
    transform: none;
    text-decoration: none;
}

/* Shift Modal Overlays */
#shift-modal-overlay,
#care-plan-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.4);
}

#shift-details-modal,
#confirm-shift-modal,
#care-plan-details-modal {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Fixed dimensions */
    width: min(90vw, 850px);
    height: min(85vh, 700px);
    min-width: 350px;
    min-height: 500px;
}

.modal-title-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-bottom: 1px solid var(--color-secondary-border);
    flex-shrink: 0;
}

.modal-title-row h2 {
    font-size: var(--font-lg);
    color: var(--color-primary-dark);
    margin: 0;
}

.dialog-close-button {
    background: transparent;
    border: none;
    font-size: 2.3rem;
    color: var(--color-primary-dark);
    cursor: pointer;
    transition: color 0.14s;
    margin-left: var(--space-md);
    line-height: 1;
}

.dialog-close-button:hover {
    color: var(--color-danger);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-sm);
    margin-bottom: var(--space-sm);
}

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

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    background: none;
    padding: 0;
}

.form-section hr {
    border: none;
    border-top: 1.5px solid var(--color-bg-accent);
}

.shift-datetime-input {
    display: flex;
    width: 150px;
    gap: var(--space-sm);
}

.readonly-field {
    background-color: var(--input-bg-disabled, #e9ecef) !important;
    color: var(--color-text-muted, #6c757d) !important;
    cursor: not-allowed !important;
    opacity: 0.65;
}

.shift-duration-group label {
    font-weight: 500;
    color: var(--color-primary-dark);
    margin-bottom: 0;
}

#duration {
    font-style: italic;
    color: var(--color-text-muted);
}

.clickable-form-span {
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline dotted;
    margin-right: var(--space-md);
    font-size: var(--font-xs);
    font-weight: 500;
    transition: color 0.14s;
}

.clickable-form-span:hover {
    color: var(--color-primary-dark);
    text-decoration: underline solid;
}



/* Tabs for Notes */
.tab-btn {
    background: white;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--notes-text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--notes-text);
    background-color: var(--color-bg-accent);
}

.tab-btn.active {
    color: var(--input-focus);
    border-bottom-color: var(--input-focus);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.note-container {
    position: relative;
}

.note-container textarea {
    width: 100%;
    min-height: 120px;
    font-family: inherit;
    resize: none;
    overflow-y: auto;
    transition: border-color 0.2s ease;
}


#time-group {
    display: flex;
    flex-direction: row;
}

#time-group input {
    width: 100%;
    max-width: 150px;
    text-align: center;
    margin: var(--space-sm) var(--space-sm) var(--space-sm) 0;
}

.recurrence-time-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recurrence-time-group label {
    width: 100%;
    text-align: left;
}

.recurrence-time-group input {
    width: 25%;
    margin: 3px;
}

#shift-recurrence-container {
    align-content: center;
    justify-content: center;
    width: 100%;
}

#recurrence-type {
    display: grid;
    align-items: center;
    /* vertically center items */
    align-content: center;
    width: 150px;
    padding-right: 5px;
    border-color: black;
    border-right: 1px solid black;
}

#recurrence-pattern-container {
    display: flex;
    flex-direction: row;
    margin-bottom: var(--space-sm);
}

.week-part {
    display: flex;
    justify-content: center;
}

#recurrence-range-container {
    display: flex;
    flex-direction: row;
    margin-top: 1rem;
}

.recurrence-row {
    display: flex;
    flex-direction: row;
    justify-items: left;
    align-items: center;
    margin: 4px;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.recurrence-row input[type="radio"] {
    margin-left: 1.5rem;
}

.recurrence-row input[type="number"] {
    max-width: 60px;
    min-width: 50px;
}

#daily-frequency,
#weekly-frequency,
#monthly-frequency {
    justify-items: left;
    margin-left: 10px;
}

#recurrence-modal .modal-btn-group {
    justify-content: center;
}

.recurrence-description {
    word-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* ================================================================ */
/* RATE DIALOGS */
/* ================================================================ */

.new-rate-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    padding: var(--space-md);
    border: none;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* ================================================================ */
/* RESPONSIVE DESIGN */
/* ================================================================ */

/* Responsive Helpers */
@media (max-width: 1100px) {
    .navbar {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md) var(--space-sm);
    }

    .sidebar {
        width: 98vw;
        left: 1vw;
    }
}

@media (max-width: 700px) {
    .navbar {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-md) var(--space-xs);
    }

    .sidebar {
        width: 100vw;
        left: 0;
        padding-top: var(--header-height);
    }
}

@media (max-width: 600px) {

    .card,
    .modal {
        padding: var(--space-md);
    }

    .navbar,
    .sidebar {
        padding: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .care-plan-modal {
        width: 98vw;
        max-height: 95vh;
    }

    .care-plan-header {
        padding: var(--space-md);
    }

    .care-plan-body {
        padding: var(--space-md);
    }

    .footer-actions {
        flex-direction: column;
        width: 100%;
    }
}

.choices__inner {
    border: 1px solid var(--care-plan-option-border);
    border-radius: var(--radius-md);
}

/* ========================================
   ERROR PARTIAL
   ======================================== */

.error-partial {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    margin: var(--space-sm) 0;
}

.error-partial-icon {
    flex-shrink: 0;
    color: var(--color-danger);
}

.error-partial-icon svg {
    display: block;
}

.error-partial-content {
    flex: 1;
    min-width: 0;
}

.error-partial-message {
    color: #991b1b;
    font-size: var(--font-sm);
    line-height: 1.5;
}

/* ========================================
   ONBOARDING BANNER
   ======================================== */

#onboarding-banner-container {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width, 250px);
    right: 0;
    z-index: 2000;
}

.onboarding-banner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.55) 0%, rgba(53, 112, 186, 0.55) 100%);
    backdrop-filter: blur(4px);
    color: var(--color-text-main);
    padding: var(--space-xs) var(--space-md);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: var(--font-xs);
}

.onboarding-banner-title {
    font-weight: 600;
    font-size: var(--font-sm);
    white-space: nowrap;
}

.onboarding-steps {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255, 255, 255, 0.35);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.onboarding-step.completed {
    background: rgba(255, 255, 255, 0.45);
}

.onboarding-step.locked {
    opacity: 0.5;
}

.onboarding-step.current {
    animation: onboardingGlow 1.5s infinite alternate;
}

@keyframes onboardingGlow {
    from {
        box-shadow: 0 0 5px -5px rgba(72, 199, 116, 0.8);
    }

    to {
        box-shadow: 0 0 10px 6px rgba(72, 199, 116, 0.7);
    }
}

.onboarding-step-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font: bold;
    font-weight: 600;
    font-size: 10px;
    flex-shrink: 0;
}

.onboarding-step.completed .onboarding-step-indicator {
    background: var(--color-success);
}

.onboarding-step-title {
    color: var(--color-text-muted);
    font: bold;
    font-size: var(--font-xs);
}

.onboarding-step-locked {
    color: var(--color-text-disabled);
    font-size: var(--font-xs);
    opacity: 0.6;
}

.onboarding-step .btn-sm {
    padding: 2px 8px;
    font-size: 11px;
    background: white;
    color: var(--color-primary-dark);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.onboarding-step .btn-sm:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.onboarding-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

.onboarding-dismiss-permanent {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--color-primary-dark);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.onboarding-dismiss-permanent:hover {
    background: white;
    transform: translateY(-1px);
}

.onboarding-dismiss-temp {
    background: rgba(255, 255, 255, 0.85);
    border: none;
    color: var(--color-text-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    border-radius: 3px;
    transition: background 0.2s;
}

.onboarding-dismiss-temp:hover {
    background: white;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #onboarding-banner-container {
        left: 0;
    }
}

@media (max-width: 600px) {
    .onboarding-banner {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .onboarding-banner-title {
        display: none;
    }

    .onboarding-dismiss-permanent {
        display: none;
    }
}

/* ========================================
   NO ORGANIZATION MESSAGE
   ======================================== */

.no-org-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: var(--space-lg);
}

.no-org-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: var(--space-lg);
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.no-org-icon {
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
}

.no-org-icon svg {
    opacity: 0.8;
}

.no-org-card h2 {
    color: var(--color-text-main);
    margin-bottom: var(--space-md);
    font-size: var(--font-xl);
}

.no-org-card p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.no-org-hint {
    font-size: var(--font-sm);
    margin-bottom: var(--space-lg) !important;
}

.no-org-card .btn {
    margin-top: var(--space-md);
}

/* ========================================
   SUCCESS DIALOGS
   ======================================== */

.success-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    padding: var(--space-lg);
    text-align: center;
    min-width: 320px;
    max-width: 450px;
    animation: successDialogFadeIn 0.3s ease-out;
}

.success-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

@keyframes successDialogFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.success-dialog h2 {
    color: var(--color-primary-dark);
    font-size: var(--font-lg);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.success-dialog h2::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    background: var(--color-success);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    flex-shrink: 0;
}

.success-dialog p {
    color: var(--color-text-muted);
    font-size: var(--font-sm);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.success-dialog button,
.success-dialog .btn {
    background: var(--color-primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.14s;
    box-shadow: var(--shadow-btn);
}

.success-dialog button:hover,
.success-dialog .btn:hover {
    background: var(--color-primary-gradient-hover);
    transform: translateY(-2px) scale(1.03);
}

.success-dialog button:focus-visible,
.success-dialog .btn:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-size: 0.9rem;
    animation: toastSlideIn 0.3s ease-out;
}

.toast-info {
    background: #6c757d;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-slide-out {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   CREATE OR JOIN ORG MESSAGE
   ======================================== */

/* ========================================
   LOADING SPINNERS (shared utilities)
   ======================================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-secondary-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--color-text-muted);
    min-height: 100px;
}

.loading-placeholder .spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
}

/* Button loading state */
.btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.btn.loading .btn-spinner {
    display: inline-block;
}

.btn.loading .btn-label {
    opacity: 0.7;
}

/* HTMX native indicator support */
.htmx-request .htmx-indicator {
    display: inline-block !important;
}

.htmx-request .htmx-label {
    opacity: 0.7;
}