/* -------------------------------------------------------------
   TeamFlow Premium Stylesheet
   Theme: Sleek Dark Slate & Vibrant Accents (Glassmorphism inspired)
   ------------------------------------------------------------- */

/* Custom Typography & Resets */
:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Premium Palette Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);
    
    --color-todo: #ef4444;      /* Crimson Red */
    --color-progress: #f59e0b;  /* Warm Amber */
    --color-review: #3b82f6;    /* Bright Blue */
    --color-done: #10b981;      /* Emerald Green */
    
    --color-todo-bg: rgba(239, 68, 68, 0.12);
    --color-progress-bg: rgba(245, 158, 11, 0.12);
    --color-review-bg: rgba(59, 130, 246, 0.12);
    --color-done-bg: rgba(16, 185, 129, 0.12);
    
    /* Text Colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    /* Shadows & Transitions */
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Container */
.app-container {
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* App Header & Brand */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    box-shadow: var(--shadow-soft);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: var(--shadow-glow);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: -2px;
}

/* Role Switcher Pill Bar */
.role-switcher-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switcher-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.role-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.role-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.role-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.role-btn.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Avatars Style */
.avatar-mini {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.avatar-large {
    width: 52px;
    height: 52px;
    font-size: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.avatar-may { background: linear-gradient(135deg, #ec4899, #f43f5e); } /* Pink/Rose */
.avatar-nan { background: linear-gradient(135deg, #8b5cf6, #d946ef); } /* Purple/Fuchsia */
.avatar-eye { background: linear-gradient(135deg, #06b6d4, #3b82f6); } /* Cyan/Blue */

/* Workspace / Main Content */
.app-content {
    flex: 1;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: block;
}

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

/* Page Section Headers */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}

.section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Metrics Dashboard Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.total { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.metric-icon.todo { background: var(--color-todo-bg); color: var(--color-todo); }
.metric-icon.progress { background: var(--color-progress-bg); color: var(--color-progress); }
.metric-icon.review { background: var(--color-review-bg); color: var(--color-review); }
.metric-icon.done { background: var(--color-done-bg); color: var(--color-done); }

.metric-info h3 {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.metric-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Split Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Panel Card Container */
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.panel-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.panel-body {
    padding: 22px;
}

/* Team Progress List (Manager View) */
.team-progress-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.member-progress-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.name-status {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
}

.task-count {
    font-size: 12px;
    color: var(--text-muted);
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

/* Progress bar graphics */
.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-may { background: linear-gradient(to right, #ec4899, #f43f5e); }
.bar-nan { background: linear-gradient(to right, #8b5cf6, #d946ef); }
.bar-eye { background: linear-gradient(to right, #06b6d4, #3b82f6); }

/* Forms Style */
.interactive-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.required {
    color: #f43f5e;
}

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

input[type="text"],
select,
textarea,
input[type="date"] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
    width: 100%;
}

input[type="text"]:focus,
select:focus,
textarea:focus,
input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

textarea {
    resize: vertical;
}

/* Beautiful custom select design styling */
select option {
    background-color: #111827;
    color: #fff;
}

/* Buttons style */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10.5px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #ef4444;
    color: #fff;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

/* Master Table Design */
.overflow-x {
    overflow-x: auto;
}

.task-count-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.master-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.master-table th {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.master-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
}

.master-table tr:last-child td {
    border-bottom: none;
}

.master-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.empty-row td {
    padding: 40px !important;
    color: var(--text-muted);
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.todo { background: var(--color-todo-bg); color: var(--color-todo); }
.status-badge.progress { background: var(--color-progress-bg); color: var(--color-progress); }
.status-badge.review { background: var(--color-review-bg); color: var(--color-review); }
.status-badge.done { background: var(--color-done-bg); color: var(--color-done); }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-badge.todo .status-dot { background-color: var(--color-todo); }
.status-badge.progress .status-dot { background-color: var(--color-progress); }
.status-badge.review .status-dot { background-color: var(--color-review); }
.status-badge.done .status-dot { background-color: var(--color-done); }

/* Deadline Alerts formatting */
.deadline-badge {
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.deadline-badge.overdue {
    color: #f87171;
    font-weight: 700;
}

.deadline-badge.overdue svg {
    color: #ef4444;
}

/* Actions in Table */
.btn-action-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action-icon:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.btn-action-icon.danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Kanban Header Layout */
.kanban-header-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.member-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.member-title-wrapper h2 {
    font-size: 20px;
    color: #fff;
    font-weight: 700;
}

/* Kanban Board Layout (Columns grid) */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

.kanban-column {
    background: rgba(10, 15, 26, 0.65);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 580px;
    max-height: 750px;
}

.column-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
}

.column-title-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-todo { background-color: var(--color-todo); }
.dot-progress { background-color: var(--color-progress); }
.dot-review { background-color: var(--color-review); }
.dot-done { background-color: var(--color-done); }

.column-header h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

.column-count-badge {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* Drop Zone Area */
.kanban-dropzone {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 4px;
    min-height: 480px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.kanban-dropzone.dragover {
    background: rgba(99, 102, 241, 0.05);
    outline: 2px dashed rgba(99, 102, 241, 0.4);
    outline-offset: 2px;
}

/* Task Card Style */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: grab;
    transition: var(--transition-smooth);
    position: relative;
    user-select: none;
    overflow: hidden;
}

.task-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    background: var(--bg-card-hover);
}

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

.task-card.dragging {
    opacity: 0.4;
    transform: scale(0.96);
    border-style: dashed;
    border-color: var(--primary);
    box-shadow: none;
}

/* Task card side accent color bar */
.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.task-card.todo::before { background-color: var(--color-todo); }
.task-card.progress::before { background-color: var(--color-progress); }
.task-card.review::before { background-color: var(--color-review); }
.task-card.done::before { background-color: var(--color-done); }

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

.task-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-card-dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-card-date {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card-date.overdue {
    color: #f87171;
    font-weight: 600;
}

/* Modals styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.static-date-display {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 10px 14px;
    font-size: 14px;
}

.modal-actions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-right-buttons {
    display: flex;
    gap: 12px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2937;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 2000;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: var(--color-done-bg);
    color: var(--color-done);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
}

/* App Footer Styling */
.app-footer {
    text-align: center;
    padding: 24px 0 8px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.app-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Responsive Rules */
@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .left-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .kanban-column {
        min-height: 400px;
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 18px;
        padding: 16px;
    }
    
    .role-switcher-container {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .role-switcher {
        width: 100%;
        overflow-x: auto;
    }
    
    .role-btn {
        flex: 1;
        justify-content: center;
        white-space: nowrap;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .left-col {
        grid-template-columns: 1fr;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .modal-card {
        width: 92%;
        margin: auto;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

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

/* -------------------------------------------------------------
   Cloud Sync Status Indicators (Full-stack Upgrade)
   ------------------------------------------------------------- */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
    transition: var(--transition-fast);
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.sync-status.online {
    color: var(--color-done);
    background: var(--color-done-bg);
    border-color: rgba(16, 185, 129, 0.2);
}
.sync-status.online .sync-dot {
    background-color: var(--color-done);
    box-shadow: 0 0 8px var(--color-done);
    animation: pulseSync 2s infinite;
}

.sync-status.offline {
    color: var(--color-progress);
    background: var(--color-progress-bg);
    border-color: rgba(245, 158, 11, 0.2);
}
.sync-status.offline .sync-dot {
    background-color: var(--color-progress);
    box-shadow: 0 0 8px var(--color-progress);
}

.sync-status.loading {
    color: var(--color-review);
    background: var(--color-review-bg);
    border-color: rgba(59, 130, 246, 0.2);
}
.sync-status.loading .sync-dot {
    background-color: var(--color-review);
    animation: pulseSync 1s infinite;
}

@keyframes pulseSync {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

