/* ==========================================================================
   Patient Pipeline Scrumboard - Premium UI/UX Design System
   Dual Theme: Light Mode & Dark Mode with Glassmorphism & Smooth Transitions
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. Theme Tokens & CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Dark Theme (Default) */
    --bg-main: #0b0f19;
    --bg-surface: #131927;
    --bg-card: #1c2436;
    --bg-card-hover: #242f45;
    --bg-column: #161e2e;
    --bg-header: #101623;
    --bg-input: #121824;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.16);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.5);
    
    /* Stage Accent Colors */
    --color-appointment: #0d9488;
    --color-in-progress: #10b981;
    --color-doctor: #6366f1;
    --color-payment: #f43f5e;
    --color-medicine: #a855f7;
    --color-delivery: #f97316;
    --color-done: #22c55e;
    --color-reminder: #eab308;
    
    --radius-full: 9999px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-column: #e2e8f0;
    --bg-header: #ffffff;
    --bg-input: #ffffff;
    
    --border-color: #cbd5e1;
    --border-highlight: #64748b;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --shadow-sm: 0 3px 10px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.25);
}

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

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --------------------------------------------------------------------------
   3. Main Header Navigation Bar
   -------------------------------------------------------------------------- */
.app-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.app-header-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.app-header-logo:hover {
    transform: scale(1.03);
}

.brand-title-group h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-title-group p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Search Bar */
.search-wrapper {
    position: relative;
    width: 380px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px 10px 40px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Right Tools Header Group */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Theme Switcher Toggle Pill */
.theme-switch-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.theme-switch-btn:hover {
    border-color: var(--border-highlight);
    transform: translateY(-1px);
}

.theme-switch-icon {
    color: #eab308;
    font-size: 0.9rem;
}

.user-profile-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #0d9488, #10b981);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* --------------------------------------------------------------------------
   4. Control Toolbar & Sub-header
   -------------------------------------------------------------------------- */
.sub-header-bar {
    padding: 20px 28px 10px 28px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.pipeline-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.pipeline-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.action-controls-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Date Range Navigator */
.date-picker-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.date-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.date-btn:hover {
    color: var(--text-primary);
}

.date-picker-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.today-chip {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Primary Action Buttons */
.btn-primary-action {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* --------------------------------------------------------------------------
   5. Stages Legend & Summary Pills Bar
   -------------------------------------------------------------------------- */
.stages-summary-container {
    padding: 6px 28px 16px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.stage-summary-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
}

.stage-summary-chip:hover {
    border-color: var(--border-highlight);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chip-count {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 1px 7px;
    border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   6. Kanban Board Grid & Columns
   -------------------------------------------------------------------------- */
.kanban-viewport {
    padding: 0 28px 28px 28px;
    flex: 1;
    display: flex;
    gap: 18px;
    overflow-x: auto;
    align-items: stretch;
}

.kanban-viewport::-webkit-scrollbar {
    height: 8px;
}
.kanban-viewport::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.kanban-stage-column {
    min-width: 290px;
    max-width: 320px;
    width: 100%;
    background: var(--bg-column);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 230px);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.kanban-stage-column.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Stage Column Header */
.column-stage-header {
    padding: 14px 18px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: var(--shadow-sm);
}

.stage-title-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-weight: 800;
}

/* Column Cards List Container */
.cards-scroll-container {
    padding: 14px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cards-scroll-container::-webkit-scrollbar {
    width: 5px;
}
.cards-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.empty-column-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 160px;
    color: var(--text-muted);
    gap: 8px;
    font-size: 0.85rem;
}

.empty-column-icon {
    font-size: 2.2rem;
    opacity: 0.3;
}

/* --------------------------------------------------------------------------
   7. Premium Patient Card Component
   -------------------------------------------------------------------------- */
.patient-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: grab;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.patient-card-item:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.patient-card-item.dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

/* Card Header: Code & Priority */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-id-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6366f1;
    letter-spacing: 0.3px;
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.priority-pill {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.priority-normal {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.priority-urgent {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
}

.priority-vip {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.patient-name-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Card Details Meta */
.card-meta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item i {
    width: 14px;
    color: var(--text-muted);
}

/* In Progress Reminder Selector Box */
.in-progress-reminder-box {
    background: rgba(234, 179, 8, 0.1);
    border: 1px dashed rgba(234, 179, 8, 0.35);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin: 4px 0;
}

.reminder-box-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #eab308;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.reminder-select-control {
    width: 100%;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.reminder-select-control:focus {
    border-color: #eab308;
}

/* Card Action Toolbar */
.card-actions-toolbar {
    display: flex;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.card-btn {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.card-btn:hover {
    border-color: var(--border-highlight);
    transform: translateY(-1px);
}

.card-btn-edit {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.3);
}

.card-btn-edit:hover {
    background: #6366f1;
    color: white;
}

.card-btn-delete {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.3);
}

.card-btn-delete:hover {
    background: #f43f5e;
    color: white;
}

/* --------------------------------------------------------------------------
   8. Modals & Overlays
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-backdrop.active .modal-card {
    transform: translateY(0);
}

.modal-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header-title {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.form-field-group {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.field-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.field-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modal-action-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-modal-cancel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-save {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* --------------------------------------------------------------------------
   9. Light Mode Specific Drag Zone & Contrast Overrides
   -------------------------------------------------------------------------- */
[data-theme="light"] .kanban-stage-column {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .patient-card-item {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .patient-card-item:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

[data-theme="light"] .kanban-stage-column.drag-over {
    border: 2px dashed #6366f1;
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .kanban-viewport::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

[data-theme="light"] .kanban-viewport::-webkit-scrollbar-track {
    background: #cbd5e1;
}

[data-theme="light"] .cards-scroll-container::-webkit-scrollbar-thumb {
    background: #94a3b8;
}

/* Password Visibility Toggle Component */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 42px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

/* Profile Settings Modal & Avatar Component */
.user-profile-badge-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 12px 4px 6px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile-badge-btn:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.avatar-preview-box {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 auto 12px auto;
    object-fit: cover;
    border: 3px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tab-nav-row {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-nav-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.tab-nav-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

/* --------------------------------------------------------------------------
   10. Appointments Management & Data Table Styling
   -------------------------------------------------------------------------- */
.filter-toolbar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.filter-group-flex {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-control-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--text-primary);
}

.filter-control-item label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.filter-control-item input, .filter-control-item select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* Data Table Container */
.data-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.appointments-table th, .appointments-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.appointments-table th {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.appointments-table tbody tr {
    transition: var(--transition);
}

.appointments-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.appointments-table tbody tr.selected-row {
    background: rgba(99, 102, 241, 0.12);
}

/* Custom Checkbox */
.custom-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

/* Floating Bulk Action Bar */
.bulk-actions-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-full);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bulk-actions-bar.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.bulk-count-badge {
    background: #6366f1;
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.btn-bulk-delete {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
    transition: var(--transition);
}

.btn-bulk-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.6);
}

/* ==========================================================================
   11. Comprehensive Mobile Responsiveness & Touch Optimization
   ========================================================================== */

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .app-header {
        padding: 12px 18px;
        gap: 12px;
    }

    .search-wrapper {
        width: 260px;
    }

    .kanban-viewport {
        padding: 0 18px 18px 18px;
        gap: 14px;
    }

    .kanban-stage-column {
        min-width: 270px;
    }

    .sub-header-bar {
        padding: 16px 18px 10px 18px;
    }

    .stages-summary-container {
        padding: 6px 18px 12px 18px;
    }
}

/* Mobile Devices & Tablets (<= 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Main Navigation Header */
    .app-header {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 12px;
        position: static;
    }

    .brand-wrapper {
        justify-content: space-between;
        width: 100%;
    }

    .brand-title-group h1 {
        font-size: 1.05rem;
    }

    .brand-title-group p {
        font-size: 0.7rem;
    }

    .app-header-logo {
        height: 38px;
    }

    .search-wrapper {
        width: 100%;
    }

    .header-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }

    .header-actions .theme-switch-btn,
    .header-actions .btn-primary-action {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    /* Sub Header Bar */
    .sub-header-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px 10px 16px;
        gap: 12px;
    }

    .pipeline-info h2 {
        font-size: 1.2rem;
    }

    .action-controls-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .date-picker-box {
        width: 100%;
        justify-content: space-between;
        padding: 8px 12px;
    }

    .btn-primary-action.btn-open-patient-modal {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 0.95rem;
    }

    /* Stages Summary Pills Bar - Touch Scroll */
    .stages-summary-container {
        padding: 6px 16px 12px 16px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .stages-summary-container::-webkit-scrollbar {
        display: none;
    }

    .stage-summary-chip {
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: 0.78rem;
    }

    /* Kanban Viewport & Columns - Touch Swipe Snap */
    .kanban-viewport {
        padding: 0 16px 20px 16px;
        gap: 14px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-stage-column {
        min-width: 82vw;
        max-width: 88vw;
        scroll-snap-align: center;
        max-height: calc(100vh - 280px);
    }

    /* Modals for Mobile Touch */
    .modal-backdrop {
        padding: 12px;
    }

    .modal-card {
        padding: 20px 16px;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: var(--radius-md);
    }

    /* Form Fields Grid to Single Column */
    .modal-card form div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .modal-action-row {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 18px;
    }

    .btn-modal-cancel, .btn-modal-save {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    /* Filter Toolbar on List View Page */
    .filter-toolbar-card {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        gap: 12px;
    }

    .filter-group-flex {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-control-item {
        width: 100%;
        justify-content: space-between;
    }

    /* Data Tables Horizontal Scroll */
    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .appointments-table th, .appointments-table td {
        padding: 10px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Floating Bulk Action Bar */
    .bulk-actions-bar {
        width: 92vw;
        padding: 8px 16px;
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        bottom: 14px;
    }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
    .kanban-stage-column {
        min-width: 88vw;
        max-width: 92vw;
    }

    .brand-title-group h1 {
        font-size: 0.95rem;
    }

    .header-actions .theme-switch-btn span,
    .header-actions .btn-primary-action span {
        display: inline;
    }
}

/* ==========================================================================
   Staff Tasks Module CSS (Matches Screenshot Layout & Styling)
   ========================================================================== */

/* Top KPI Stats Cards Grid */
.task-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.task-kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.task-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-highlight);
}

.task-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.task-kpi-icon.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.task-kpi-icon.in-progress {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.task-kpi-icon.done {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.task-kpi-icon.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.task-kpi-content h3 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.task-kpi-content p {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* Tasks Module Layout (2-Column: Left Form, Right Board/List) */
.tasks-layout-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .tasks-layout-wrapper {
        grid-template-columns: 1fr;
    }
    .task-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .task-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Left Form Card */
.task-form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.task-form-header {
    background: #0ea5e9;
    color: #ffffff;
    padding: 16px 22px;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-form-body {
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.task-form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    width: 100%;
    transition: var(--transition);
}

.task-form-control:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

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

.btn-assign-task {
    background-color: #0891b2;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    margin-top: 6px;
}

.btn-assign-task:hover {
    background-color: #0e7490;
    transform: translateY(-1px);
}

/* Right Main Section */
.task-main-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Task Toolbar Controls */
.task-toolbar-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-toolbar-left, .task-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.view-toggle-pill {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 3px;
}

.btn-view-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-view-toggle.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Filter controls */
.filter-date-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-filter-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.82rem;
}

.btn-icon-filter {
    background: #0284c7;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-filter:hover {
    background: #0369a1;
}

.btn-reset-filter {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-reset-filter:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Kanban Board Columns */
.task-kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

@media (max-width: 1200px) {
    .task-kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .task-kanban-board {
        grid-template-columns: 1fr;
    }
}

.task-kanban-column {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    min-height: 680px;
}

.task-column-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: lowercase;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.task-column-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.06);
    margin: 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    min-height: 300px;
}

.task-column-body.drag-over {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.05);
}

.task-empty-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin: auto;
}

/* Individual Task Card */
.task-card-item {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: grab;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.task-card-item:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.task-card-item:active {
    cursor: grabbing;
}

.task-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.task-priority-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.task-priority-badge.urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.task-priority-badge.high {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.task-priority-badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.task-priority-badge.low {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.task-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.task-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;

    /* Multi-line truncation */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-avatar-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
}

.task-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-task-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    transition: var(--transition);
}

.btn-task-action:hover {
    color: #ef4444;
}

/* List Table View */
.task-list-view {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   8. Task Card Redesign & Update Status Modal (Matching Screenshot)
   -------------------------------------------------------------------------- */
.task-card-item {
    background-color: #161e2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 22px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card-item:hover {
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.task-card-top-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.task-priority-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-priority-pill.medium {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.task-priority-pill.high, .task-priority-pill.urgent {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.task-priority-pill.low {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.task-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 800;
    background: rgba(224, 231, 255, 0.95);
    color: #3b82f6;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-status-pill.in_progress {
    background: #dbeafe;
    color: #2563eb;
}

.task-status-pill.done {
    background: #d1fae5;
    color: #059669;
}

.task-status-pill.cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.task-status-pill.pending {
    background: #fef3c7;
    color: #d97706;
}

.task-card-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #ffffff;
    margin-top: 2px;
    line-height: 1.35;
}

.task-card-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Latest Staff Note Pill Box */
.task-latest-note-box {
    background: #1e293b;
    border-left: 3px solid #10b981;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.84rem;
    color: #e2e8f0;
    font-weight: 600;
    margin: 4px 0;
}

.task-latest-note-box .latest-label {
    color: #ffffff;
    font-weight: 800;
    margin-right: 4px;
}

/* Progress Indicator */
.task-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.task-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
}

.task-progress-pct {
    color: #ef4444;
    font-weight: 800;
}

.task-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    overflow: hidden;
}

.task-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* User Meta Info */
.task-meta-users {
    font-size: 0.84rem;
    color: #ffffff;
    font-weight: 700;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    row-gap: 4px;
}

.task-meta-users .creator-name {
    color: #0ea5e9;
    font-weight: 800;
}

.task-meta-users .assignee-name {
    color: #10b981;
    font-weight: 800;
}

/* Task Action Bar at Bottom */
.task-card-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.task-date-chip {
    font-size: 0.82rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 5px 10px;
}

.task-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-task-info {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-task-info:hover {
    background: #ffffff;
    transform: scale(1.05);
}

.btn-task-update-modal {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-task-update-modal:hover {
    background: #088395;
    border-color: #088395;
    color: #ffffff;
}

.btn-task-delete {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #ef4444;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-task-delete:hover {
    background: #fee2e2;
    transform: scale(1.05);
}

/* ===== Update Task Status Modal — Exact Screenshot Match ===== */
.task-update-modal-card {
    background-color: #1e2535 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    max-width: 480px !important;
    width: 95% !important;
    border-radius: 12px !important;
    padding: 24px 26px 28px 26px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}

.task-update-modal-card .modal-header-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #e2e8f0 !important;
}

.task-update-modal-card .btn-close-modal {
    color: #94a3b8 !important;
    background: transparent !important;
    border: none !important;
    font-size: 1.4rem !important;
    line-height: 1 !important;
    cursor: pointer;
}

.task-update-modal-card .field-label {
    color: #cbd5e1 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

.task-update-modal-card .field-input {
    background-color: #131c2e !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 11px 14px !important;
    font-size: 0.9rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.task-update-modal-card .field-input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

/* Progress Slider — blue fill via JS inline bg, white track */
.task-progress-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    outline: none;
    margin: 10px 0 6px 0;
    cursor: pointer;
}

.task-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
    transition: transform 0.15s ease;
}

.task-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.task-progress-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
}

.slider-ticks-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 4px;
}

/* Save Update button — full-width teal exactly like screenshot */
.btn-save-task-update {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.btn-save-task-update:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.4);
}

.btn-save-task-update:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}








/* --------------------------------------------------------------------------
   14. Notification Bell, Dropdown & Toast Alerts
   -------------------------------------------------------------------------- */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
}

.notif-bell-btn {
    position: relative;
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
}

.notif-bell-btn.has-unread i {
    animation: notifBellShake 2.2s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes notifBellShake {
    0%, 70%, 100% { transform: rotate(0deg); }
    75% { transform: rotate(12deg); }
    80% { transform: rotate(-10deg); }
    85% { transform: rotate(8deg); }
    90% { transform: rotate(-6deg); }
    95% { transform: rotate(3deg); }
}

.notif-badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.5);
    line-height: 1;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    z-index: 4000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

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

.notif-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-primary);
}

.notif-mark-all-btn {
    background: transparent;
    border: none;
    color: #6366f1;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.notif-mark-all-btn:hover {
    background: rgba(99, 102, 241, 0.14);
}

.notif-dropdown-body {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.notif-item:hover {
    background: var(--bg-card-hover);
}

.notif-item.unread {
    background: rgba(99, 102, 241, 0.08);
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.16);
    color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}

.notif-item-text {
    flex: 1;
    min-width: 0;
}

.notif-item-text h5 {
    margin: 0 0 3px 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.notif-item-text p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.notif-item-time {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-empty {
    padding: 30px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.notif-empty i {
    font-size: 1.8rem;
    opacity: 0.35;
}

.notif-dropdown-foot {
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.notif-dropdown-foot a {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0ea5e9;
    text-decoration: none;
}

.notif-dropdown-foot a:hover {
    text-decoration: underline;
}

/* Floating Toast Alerts */
.notif-toast-stack {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notif-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 330px;
    max-width: calc(100vw - 44px);
    padding: 13px 14px;
    background: var(--bg-surface);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-left: 4px solid #6366f1;
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    animation: notifToastIn 0.32s ease;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.notif-toast.hide {
    opacity: 0;
    transform: translateX(20px);
}

@keyframes notifToastIn {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}

.notif-toast-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.18);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-toast-text {
    flex: 1;
    min-width: 0;
}

.notif-toast-text h5 {
    margin: 0 0 3px 0;
    font-size: 0.83rem;
    font-weight: 800;
    color: var(--text-primary);
}

.notif-toast-text p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.notif-toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.notif-toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 620px) {
    .notif-dropdown {
        position: fixed;
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* --------------------------------------------------------------------------
   15. Attendance Module
   -------------------------------------------------------------------------- */
.attendance-main {
    padding: 20px 16px 40px 16px;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* Punch Card */
.punch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.punch-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.punch-avatar {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    overflow: hidden;
    border: 2px solid rgba(99, 102, 241, 0.4);
}

.punch-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.punch-info h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.punch-info p {
    margin: 2px 0 8px 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.punch-times {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.punch-times strong {
    color: var(--text-primary);
    font-weight: 700;
}

.punch-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.punch-clock {
    font-family: "Outfit", "Inter", monospace;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 1px;
    line-height: 1;
}

.punch-shift-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.punch-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.btn-punch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    color: #fff;
}

.btn-punch-in {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}

.btn-punch-out {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.32);
}

.btn-punch:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

.btn-punch:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Status chips */
.att-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* KPI grid override - 5 cards */
.att-kpi-grid {
    grid-template-columns: repeat(5, 1fr);
}

/* Filter toolbar extras */
.att-filter-card {
    margin-bottom: 18px;
}

.att-quick-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.att-chip {
    padding: 8px 14px;
    font-size: 0.78rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
}

.att-chip:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
}

.att-admin-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Table cells */
.att-user-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.att-user-name {
    font-weight: 700;
    color: var(--text-primary);
}

.att-user-role {
    font-size: 0.68rem;
    font-weight: 700;
    color: #10b981;
}

.att-note-cell {
    max-width: 220px;
    white-space: normal;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.att-icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.76rem;
    cursor: pointer;
    margin-left: 5px;
    transition: var(--transition);
}

.att-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-highlight);
}

.att-icon-btn.att-delete:hover {
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.45);
}

/* Mobile card list (hidden on desktop) */
.att-card-list {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.att-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.att-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.att-card-head h4 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
}

.att-card-head span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.att-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.att-card-grid label {
    display: block;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.att-card-grid strong {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 700;
}

.att-card-note {
    margin: 10px 0 0 0;
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.att-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.att-card-actions .att-icon-btn {
    flex: 1;
    margin-left: 0;
    text-align: center;
}

.att-empty-card {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 26px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Modal form helpers */
.att-form-row {
    display: flex;
    gap: 12px;
}

.att-form-row .form-field-group {
    flex: 1;
}

.att-alert {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
}

.att-alert-error {
    background: rgba(244, 63, 94, 0.14);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.att-alert-success {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* --------------------------------------------------------------------------
   16. Mobile Navigation Toggle & PWA Install Button
   -------------------------------------------------------------------------- */
.nav-toggle-btn {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-label-mobile {
    display: none;
}

.btn-pwa-install {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-pwa-install:hover {
    background: rgba(16, 185, 129, 0.24);
    transform: translateY(-1px);
}

.btn-pwa-install.visible {
    display: inline-flex;
}

/* --------------------------------------------------------------------------
   17. Responsive - Tablet & Mobile for Tasks / Attendance / PWA
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .att-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .tasks-layout-wrapper {
        grid-template-columns: 1fr;
    }

    .task-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Collapsible header nav */
    .nav-toggle-btn {
        display: inline-flex;
    }

    .app-header {
        position: relative;
    }

    .header-actions {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .header-actions.open {
        display: flex !important;
    }

    .header-actions .theme-switch-btn,
    .header-actions .btn-primary-action {
        width: 100%;
        flex: none;
        justify-content: flex-start;
        padding: 11px 14px;
        font-size: 0.85rem;
    }

    .nav-label-mobile {
        display: inline;
    }

    .user-profile-badge-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 8px 12px;
    }

    /* display:block stops the button from stretching to the dropdown's height */
    .notif-bell-wrapper {
        display: block;
        width: 100%;
        position: relative;
    }

    .notif-bell-btn {
        width: 100%;
        height: auto;
        justify-content: flex-start;
    }

    .notif-badge-count {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
    }

    .btn-pwa-install.visible {
        display: flex;
        width: 100%;
        justify-content: center;
    }

    /* Attendance page */
    .attendance-main {
        padding: 16px 12px 90px 12px;
    }

    .punch-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .punch-right {
        align-items: stretch;
    }

    .punch-clock {
        font-size: 1.7rem;
        text-align: center;
    }

    .punch-shift-note {
        text-align: center;
    }

    .punch-btn-row {
        flex-direction: row;
    }

    .btn-punch {
        flex: 1;
        justify-content: center;
        padding: 13px 10px;
    }

    .att-kpi-grid,
    .task-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .task-kpi-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .task-kpi-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .task-kpi-content h3 {
        font-size: 1.2rem;
    }

    /* Swap the wide table for stacked cards */
    .att-table-wrap {
        display: none;
    }

    .att-card-list {
        display: flex;
    }

    .att-quick-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }

    .att-chip,
    .att-admin-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .att-form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Tasks board - one column at a time with snap */
    .task-kanban-board {
        grid-template-columns: none;
        display: flex;
        overflow-x: auto;
        gap: 12px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .task-kanban-column {
        min-width: 84vw;
        scroll-snap-align: center;
    }

    .task-toolbar-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .task-toolbar-left,
    .task-toolbar-right {
        flex-wrap: wrap;
        width: 100%;
    }

    .task-filter-input {
        flex: 1;
        min-width: 0 !important;
    }

    /* Toasts full width at the bottom */
    .notif-toast-stack {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .notif-toast {
        width: 100%;
    }

    /* Dropdown stays absolute so it never stretches the bell button */
    .notif-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .att-kpi-grid,
    .task-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .att-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .punch-times {
        gap: 6px 12px;
        font-size: 0.74rem;
    }

    .punch-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.05rem;
    }
}

/* Safe area padding for installed PWA on notched phones */
@supports (padding: max(0px)) {
    .app-header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}


/* --------------------------------------------------------------------------
   18. Module Access / Permission chips
   -------------------------------------------------------------------------- */
.perm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 260px;
}

.perm-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.28);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.perm-chip.perm-all {
    background: rgba(168, 85, 247, 0.16);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.32);
}

.perm-chip.perm-none {
    background: rgba(244, 63, 94, 0.14);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.3);
}

.perm-check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perm-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
}

.perm-check-row:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
}

.perm-check-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #10b981;
    cursor: pointer;
    flex-shrink: 0;
}

.perm-check-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.perm-check-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.perm-admin-note {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    font-size: 0.85rem;
    line-height: 1.55;
    font-weight: 600;
}
