/* Design System & Variables */
:root, [data-theme="dark"] {
    --bg-base: #0a0813;
    --bg-surface: rgba(20, 16, 38, 0.6);
    --bg-surface-hover: rgba(30, 25, 56, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(139, 92, 246, 0.4);
    
    /* Core Accents (Tailored Palette) */
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.35);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --warning: #f59e0b;
    
    /* Typography colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Animation transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Background Ball Gradients */
    --ball-gradient-1: radial-gradient(circle, rgba(139,92,246,0.3) 0%, rgba(99,102,241,0.05) 70%);
    --ball-gradient-2: radial-gradient(circle, rgba(236,72,153,0.2) 0%, rgba(219,39,119,0.02) 70%);

    /* Dynamic element backgrounds */
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-bg-focus: rgba(255, 255, 255, 0.06);
    --modal-overlay-bg: rgba(5, 4, 9, 0.6);
    --column-bg: rgba(255, 255, 255, 0.02);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-bg-hover: rgba(255, 255, 255, 0.06);
    --sidebar-item-active-bg: rgba(139, 92, 246, 0.15);
    --sidebar-item-hover-bg: rgba(255, 255, 255, 0.04);
    --header-bg: rgba(10, 8, 19, 0.4);
    --calendar-icon-filter: invert(1);
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-hover: rgba(241, 245, 249, 0.95);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-glow: rgba(139, 92, 246, 0.25);
    
    /* Core Accents */
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --primary-glow: rgba(109, 40, 217, 0.2);
    
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.1);
    
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-glow: rgba(220, 38, 38, 0.1);
    
    --warning: #d97706;
    
    /* Typography colors */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-inverse: #ffffff;

    /* Background Ball Gradients */
    --ball-gradient-1: radial-gradient(circle, rgba(139,92,246,0.12) 0%, rgba(99,102,241,0.02) 70%);
    --ball-gradient-2: radial-gradient(circle, rgba(236,72,153,0.08) 0%, rgba(219,39,119,0.01) 70%);

    /* Dynamic element backgrounds */
    --input-bg: rgba(15, 23, 42, 0.03);
    --input-bg-focus: rgba(15, 23, 42, 0.05);
    --modal-overlay-bg: rgba(15, 23, 42, 0.3);
    --column-bg: rgba(15, 23, 42, 0.02);
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-bg-hover: rgba(255, 255, 255, 1);
    --sidebar-item-active-bg: rgba(139, 92, 246, 0.1);
    --sidebar-item-hover-bg: rgba(15, 23, 42, 0.03);
    --header-bg: rgba(255, 255, 255, 0.45);
    --calendar-icon-filter: invert(0);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* 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.1);
    border-radius: 4px;
    transition: var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.4);
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Animations */
@keyframes pulseGlow {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.6; }
    50% { transform: scale(1.15) translate(3%, 5%); opacity: 0.8; }
}

@keyframes floatBall {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Glowing Background Balls */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ball {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
}

.ball-1 {
    width: 400px;
    height: 400px;
    background: var(--ball-gradient-1);
    top: 10%;
    left: 15%;
    animation: pulseGlow 12s infinite alternate ease-in-out;
}

.ball-2 {
    width: 500px;
    height: 500px;
    background: var(--ball-gradient-2);
    bottom: 10%;
    right: 15%;
    animation: pulseGlow 16s infinite alternate-reverse ease-in-out;
}

/* Typography & Links */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px 0 var(--danger-glow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--danger-glow);
    background: var(--danger-hover);
}

.btn-block {
    width: 100%;
}

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

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

.hidden {
    display: none !important;
}

/* Forms & Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    width: 100%;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group input, .input-group textarea, select {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 11px 14px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.error-msg {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 26px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.1);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Alert Boxes */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ==========================================================================
   AUTHENTICATION PAGE
   ========================================================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 15px var(--primary-glow));
    animation: floatBall 4s infinite ease-in-out;
}

.brand h1 {
    font-size: 28px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.brand h1 span {
    color: var(--primary);
}

.brand p {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-form h2 {
    font-size: 20px;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.forgot-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 13.5px;
    text-align: center;
    margin-top: -12px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-success-custom {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

/* ==========================================================================
   DASHBOARD PAGE & SIDEBAR
   ========================================================================== */
.dashboard-page {
    display: flex;
    height: 100vh;
}

.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: none;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.sidebar-header .logo i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.sidebar-content {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.boards-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.boards-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.boards-list li i {
    font-size: 14px;
    color: var(--text-muted);
}

.boards-list li.active {
    background: var(--sidebar-item-active-bg);
    color: var(--text-main);
    border-left: 3px solid var(--primary);
}

.boards-list li.active i {
    color: var(--primary);
}

.boards-list li:hover:not(.active) {
    background: var(--sidebar-item-hover-bg);
    color: var(--text-main);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-profile .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    border: 1px solid var(--border-color-glow);
    flex-shrink: 0;
}

.user-profile .user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-profile .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile .user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Skeleton loader list-items */
.skeleton-list-item {
    height: 36px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 6px;
    animation: fadeIn 1s infinite alternate;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.app-header {
    height: 72px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    gap: 16px;
    flex-wrap: nowrap;
    min-width: 0;
}

.board-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.board-info-header h2 {
    font-size: 20px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

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

.btn-icon-header {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

.btn-icon-header.btn-danger-header:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Workspace Canvas */
.board-workspace {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 24px 32px;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 80%;
    max-width: 450px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

.welcome-icon {
    font-size: 60px;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 20px;
}

.welcome-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.welcome-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.kanban-canvas {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    height: 100%;
    width: 100%;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 16px;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

.kanban-canvas::-webkit-scrollbar {
    height: 10px;
}

.kanban-canvas::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    margin: 0 4px;
}

.kanban-canvas::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.35);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.kanban-canvas::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Columns */
.kanban-column {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
    max-height: 100%;
    background: var(--column-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.kanban-column.drag-over {
    background: rgba(139, 92, 246, 0.05);
    border-color: var(--primary);
}

.column-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.column-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex: 1;
}

.column-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    width: 100%;
    outline: none;
    transition: var(--transition-fast);
}

.column-title:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-count {
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    color: var(--text-muted);
}

.column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100px;
}

/* Kanban Cards */
.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    cursor: grab;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    user-select: none;
}

.kanban-card:hover {
    background: var(--card-bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

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

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    word-break: break-word;
}

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

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.due-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.due-date-badge.overdue {
    color: #fca5a5;
}

.due-date-badge i {
    font-size: 10px;
}

/* Card Add Button / Inline Form */
.column-footer {
    padding: 12px 16px;
}

.btn-add-card-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.btn-add-card-trigger:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.card-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.2s ease;
}

.card-add-form textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 13px;
    resize: none;
    height: 60px;
    outline: none;
    transition: var(--transition-fast);
}

.card-add-form textarea:focus {
    border-color: var(--primary);
}

.card-add-actions {
    display: flex;
    gap: 6px;
}

/* Drag State Visuals */
.card-ghost {
    background: rgba(139, 92, 246, 0.1);
    border: 1px dashed var(--primary);
    border-radius: 8px;
    height: 60px;
    pointer-events: none;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 4, 9, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    animation: slideUp var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-card.modal-lg {
    max-width: 680px;
}

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

.modal-header h3 {
    font-size: 18px;
    color: var(--text-main);
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.modal-title-wrapper .title-icon {
    font-size: 18px;
    color: var(--text-muted);
}

.modal-title-editable {
    background: transparent;
    border: 1px solid transparent;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 6px;
    outline: none;
    flex: 1;
    transition: var(--transition-fast);
}

.modal-title-editable:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--text-main);
}

.modal-card form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Modal Sidebar Layout (Large Modals) */
.modal-body-layout {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    max-height: 70vh;
}

.modal-body-main {
    flex: 1.6;
    padding: 24px;
    overflow-y: auto;
}

.modal-body-sidebar {
    flex: 1;
    padding: 24px;
    background: rgba(255,255,255,0.01);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body-main textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px;
    border-radius: 8px;
    width: 100%;
    height: 180px;
    resize: none;
    outline: none;
    font-size: 14px;
    line-height: 1.5;
    transition: var(--transition-fast);
}

.modal-body-main textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-item .label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-item input {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

.sidebar-item input:focus {
    border-color: var(--primary);
}

.badge-column {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    align-self: flex-start;
}

.tags-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.actions-item {
    margin-top: auto;
    padding-top: 20px;
}

/* Members List in Share Modal */
#board-members-list {
    margin-top: 10px;
}

#board-members-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

#board-members-list li .member-name-email {
    display: flex;
    flex-direction: column;
}

#board-members-list li .member-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

#board-members-list li .member-email {
    font-size: 12px;
    color: var(--text-muted);
}

#board-members-list li .member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#board-members-list li .member-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

/* Shared Board Badge in Sidebar */
.badge-shared {
    font-size: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Theme Toggle Button styles */
.btn-theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-theme-toggle:hover {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.btn-theme-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    font-size: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: all var(--transition-fast);
}
.btn-theme-toggle-floating:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE SCREENS)
   ========================================================================== */
/* Desktop rules for mobile-only elements */
.mobile-bottom-nav {
    display: none;
}
#btn-close-sidebar-mobile {
    display: none;
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE SCREENS - FULL SYSTEM)
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent iOS auto-zoom on inputs */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Overall Layout */
    .dashboard-page {
        overflow: hidden;
        height: 100vh;
        width: 100vw;
    }

    .app-layout {
        position: relative;
        overflow: hidden;
        height: 100%;
        width: 100%;
    }

    .main-content {
        width: 100% !important;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Collapsible Sidebar Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        z-index: 1001;
        width: 300px;
        max-width: 86vw;
        height: 100vh;
        border-right: 1px solid var(--border-color);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
        background: var(--bg-surface);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
    }

    #btn-close-sidebar-mobile {
        display: inline-flex !important;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
    }
    
    /* Sliding overlay backdrop */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 1000;
        transition: opacity var(--transition-normal);
    }
    
    .sidebar-overlay.hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* Top Header Bar */
    .app-header {
        padding: 0 12px;
        height: 56px;
        flex-shrink: 0;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    #btn-toggle-sidebar {
        display: inline-flex !important;
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 10px;
        flex-shrink: 0;
        margin-right: 4px !important;
    }

    .board-info-header {
        gap: 8px;
        overflow: hidden;
        min-width: 0;
        flex: 1;
        display: flex;
        align-items: center;
    }

    .board-info-header h2 {
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        max-width: none !important;
    }
    
    .board-actions {
        gap: 4px;
        flex-shrink: 0;
    }

    .btn-icon-header {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 12px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    
    .header-actions .btn {
        padding: 0 !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        font-size: 14px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }

    .header-actions .btn .btn-label,
    .header-actions .btn span:not(.badge) {
        display: none !important;
    }

    #btn-open-create-card {
        background: var(--primary) !important;
        color: #ffffff !important;
        box-shadow: 0 2px 10px var(--primary-glow) !important;
    }

    /* Workspaces Safe-area & Bottom padding for mobile dock */
    .board-workspace,
    .notes-workspace,
    .settings-workspace,
    .reports-workspace,
    .diagrams-workspace,
    .my-tasks-workspace,
    .admin-workspace {
        padding: 14px 12px calc(76px + env(safe-area-inset-bottom, 0px)) 12px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Kanban Canvas & Columns with smooth touch snapping */
    .kanban-canvas {
        gap: 14px;
        padding: 0 4px calc(76px + env(safe-area-inset-bottom, 0px)) 4px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 12px;
    }

    .kanban-column {
        width: calc(100vw - 44px) !important;
        min-width: calc(100vw - 44px) !important;
        max-width: 340px !important;
        flex: 0 0 calc(100vw - 44px) !important;
        scroll-snap-align: center;
        border-radius: 14px;
        max-height: calc(100vh - 170px);
    }

    .column-cards {
        max-height: calc(100vh - 270px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-card {
        padding: 14px;
        border-radius: 12px;
    }

    /* Mobile Bottom Navigation Dock */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--bg-surface);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
        z-index: 950;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 10.5px;
        font-weight: 500;
        cursor: pointer;
        padding: 6px 0;
        transition: all var(--transition-fast);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-btn i {
        font-size: 16px;
        transition: transform var(--transition-fast), color var(--transition-fast);
    }

    .mobile-nav-btn.active {
        color: var(--primary);
        font-weight: 700;
    }

    .mobile-nav-btn.active i {
        transform: scale(1.15);
        color: var(--primary);
        filter: drop-shadow(0 0 8px var(--primary-glow));
    }

    /* Notes Module on Mobile (No Horizontal Scrollbar) */
    .notes-workspace {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .notes-header {
        margin-bottom: 16px !important;
    }

    .notes-header h2 {
        font-size: 22px !important;
    }

    .notes-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .notes-categories-panel {
        padding: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    #notes-categories-list {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
        gap: 8px !important;
        max-width: 100% !important;
    }

    #notes-categories-list::-webkit-scrollbar {
        display: none;
    }

    #notes-categories-list .category-item {
        flex-shrink: 0;
        padding: 8px 14px;
        border-radius: 20px;
    }

    .notes-main-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden;
        box-sizing: border-box;
        gap: 16px !important;
    }

    .notes-header-row {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .notes-header-row h3 {
        font-size: 18px !important;
    }

    .notes-header-row .btn {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    .notes-controls-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .notes-tabs {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
        padding: 4px !important;
        box-sizing: border-box;
    }

    .notes-tabs::-webkit-scrollbar {
        display: none;
    }

    .note-tab {
        padding: 6px 14px !important;
        font-size: 12.5px !important;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .notes-search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    #notes-advanced-filters {
        width: 100% !important;
        max-width: calc(100vw - 28px) !important;
        left: 0 !important;
        right: 0 !important;
        top: 44px !important;
    }

    .notes-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .note-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 16px !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    .note-card-title {
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        min-width: 0 !important;
        font-size: 15px !important;
    }

    .note-card-body {
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        min-width: 0 !important;
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    /* Settings Module on Mobile (Modern & Polished) */
    .settings-workspace {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .settings-header {
        margin-bottom: 16px !important;
    }

    .settings-header h2 {
        font-size: 22px !important;
        margin-bottom: 2px !important;
    }

    .settings-header p {
        font-size: 13px !important;
    }

    .settings-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .settings-nav {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 6px !important;
        gap: 6px !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid var(--border-color) !important;
        max-width: 100% !important;
    }

    .settings-nav::-webkit-scrollbar {
        display: none;
    }

    .settings-tab {
        padding: 8px 14px !important;
        font-size: 13px !important;
        font-weight: 600;
        flex-shrink: 0;
        border-radius: 10px !important;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .settings-tab.active {
        background: var(--primary) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px var(--primary-glow);
    }

    .settings-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        gap: 16px !important;
    }

    .settings-card {
        padding: 18px 16px !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .settings-card h3 {
        font-size: 16px !important;
    }

    .settings-form-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
    }

    .settings-theme-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .theme-option-card {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    .settings-action-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .settings-action-card .btn {
        width: 100% !important;
        justify-content: center;
        height: 42px;
        font-size: 13.5px;
        border-radius: 10px;
    }

    .settings-export-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .settings-export-buttons .btn {
        width: 100% !important;
        justify-content: center;
        height: 44px;
        font-size: 13.5px;
        border-radius: 10px;
    }

    #form-profile-settings button[type="submit"],
    #form-notification-settings button[type="submit"] {
        width: 100% !important;
        justify-content: center;
        height: 44px;
        font-size: 14px;
        border-radius: 12px;
    }

    /* My Tasks Module on Mobile (Modern Card Transformation & Responsive Layout) */
    .my-tasks-workspace {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .my-tasks-header {
        margin-bottom: 16px !important;
    }

    .my-tasks-header h2 {
        font-size: 22px !important;
        margin-bottom: 2px !important;
    }

    .my-tasks-header p {
        font-size: 13px !important;
    }

    .my-tasks-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .my-tasks-main-panel {
        padding: 16px 14px !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        gap: 16px !important;
    }

    .my-tasks-controls-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .task-tabs {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
        padding: 4px !important;
        box-sizing: border-box;
    }

    .task-tabs::-webkit-scrollbar {
        display: none;
    }

    .task-tab {
        padding: 6px 14px !important;
        font-size: 12.5px !important;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .tasks-search-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .tasks-table-wrapper {
        overflow-x: visible !important;
        width: 100% !important;
    }

    .my-tasks-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
    }

    .my-tasks-table thead {
        display: none !important;
    }

    .my-tasks-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .task-row {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        padding: 14px !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid var(--border-color) !important;
        margin-bottom: 0 !important;
        gap: 8px 10px !important;
        position: relative;
        transition: all 0.2s ease !important;
    }

    .task-row.completed {
        opacity: 0.65;
        background: rgba(255, 255, 255, 0.01) !important;
    }

    .task-col-check {
        order: 1;
        padding: 0 !important;
        width: 22px !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0;
        border: none !important;
    }

    .task-col-check .task-checkbox {
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
    }

    .task-col-title {
        order: 2;
        padding: 0 !important;
        flex: 1 1 calc(100% - 34px) !important;
        min-width: 0 !important;
        border: none !important;
    }

    .task-col-title .task-title-text {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: var(--text-main);
        word-break: break-word;
        line-height: 1.4;
    }

    .task-hover-actions {
        opacity: 1 !important;
        display: flex !important;
        gap: 6px;
        flex-shrink: 0;
    }

    .task-hover-actions .btn-icon-sm {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px;
        border-radius: 6px;
    }

    .task-col-priority {
        order: 3;
        padding: 0 0 0 32px !important;
        display: inline-flex !important;
        align-items: center !important;
        border: none !important;
    }

    .task-col-priority .priority-badge-pill {
        padding: 3px 10px !important;
        font-size: 10.5px !important;
    }

    .task-col-deadline {
        order: 4;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        font-size: 11.5px !important;
        border: none !important;
        color: var(--text-muted) !important;
    }

    .task-col-assignee {
        order: 5;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        margin-left: auto !important;
        border: none !important;
    }

    .task-col-assignee .note-author-badge {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }

    .quick-notes-panel {
        padding: 16px 14px !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .quick-notes-panel h3 {
        font-size: 15px !important;
    }

    /* Reports Module on Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .charts-container {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .bottom-row {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* Diagrams & Flowchart Module on Mobile */
    .diagrams-gallery-view {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .diagrams-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .diagrams-header-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px !important;
    }

    /* Diagram Visual Canvas on Mobile */
    .diagram-editor-topbar {
        height: auto !important;
        min-height: 52px;
        padding: 8px 12px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .diagram-editor-topbar #btn-close-diagram-editor span {
        display: none;
    }

    .diagram-editor-topbar #btn-diagram-save span {
        display: none;
    }

    .diagram-editor-topbar #btn-diagram-export-toggle span {
        display: none;
    }

    #diagram-active-title {
        font-size: 14px !important;
        min-width: 110px !important;
        max-width: 140px !important;
    }

    .topbar-center {
        gap: 4px !important;
    }

    .topbar-center .btn-icon-header {
        width: 28px !important;
        height: 28px !important;
    }

    /* Compact Bottom Dock for Diagram Shapes on Mobile */
    .diagram-shapes-toolbar {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        bottom: 16px !important;
        flex-direction: row !important;
        padding: 6px 12px !important;
        border-radius: 30px !important;
        max-width: calc(100vw - 24px) !important;
        overflow-x: auto !important;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
    }

    .diagram-shapes-toolbar .toolbar-divider {
        width: 1px;
        height: 20px;
        margin: 0 4px;
    }

    .shape-tool-btn {
        width: 34px !important;
        height: 34px !important;
        flex-shrink: 0;
    }

    /* Floating Properties Bar on Mobile */
    .diagram-properties-bar {
        left: 12px !important;
        right: 12px !important;
        top: 60px !important;
        max-width: none !important;
        flex-wrap: wrap !important;
        padding: 8px 12px !important;
    }

    /* Modals on Mobile */
    .modal-card {
        width: 94% !important;
        max-width: 94% !important;
        max-height: 88vh !important;
        border-radius: 18px !important;
    }

    .modal-card.modal-lg {
        width: 95% !important;
        max-width: 95% !important;
    }

    .modal-body-layout {
        flex-direction: column !important;
        max-height: 75vh;
        overflow-y: auto;
    }

    .modal-body-sidebar {
        border-left: none !important;
        border-top: 1px solid var(--border-color) !important;
        padding: 16px 18px !important;
        background: rgba(255, 255, 255, 0.02);
    }

    .modal-header {
        padding: 16px 20px !important;
    }

    .modal-footer {
        padding: 14px 20px !important;
    }

    /* Auth Page on Mobile */
    .auth-container {
        max-width: 100%;
        padding: 10px;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .brand {
        margin-bottom: 20px;
    }

    .logo-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .brand h1 {
        font-size: 24px;
    }
}

/* Calendar Styles */
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
}
.calendar-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 8px;
}
.calendar-header-bar h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    min-width: 180px;
    text-align: center;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.calendar-cell {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background var(--transition-fast);
    min-height: 110px;
}
[data-theme="light"] .calendar-cell {
    background: rgba(15, 23, 42, 0.01);
}
.calendar-cell.other-month {
    opacity: 0.25;
}
.calendar-cell.today {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.03);
}
.calendar-cell-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    align-self: flex-start;
}
.calendar-cell.today .calendar-cell-num {
    color: var(--primary);
    background: var(--primary-glow);
    padding: 2px 6px;
    border-radius: 50%;
}
.calendar-cell-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 80px;
}
.calendar-card-item {
    font-size: 11px;
    font-weight: 500;
    background: var(--primary-glow);
    color: var(--primary);
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all var(--transition-fast);
}
.calendar-card-item:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

/* Comments List Styles */
.comment-input-wrapper {
    display: flex;
    flex-direction: column;
}
.comment-input-wrapper textarea {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13px;
    resize: none;
    outline: none;
    transition: border-color var(--transition-fast);
}
.comment-input-wrapper textarea:focus {
    border-color: var(--primary);
}
.card-comments-list li {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.card-comments-list li:last-child {
    border-bottom: none;
}
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.comment-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}
.comment-time {
    font-size: 11px;
    color: var(--text-muted);
}
.comment-text {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
    word-break: break-word;
}
.btn-delete-comment {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: color var(--transition-fast);
}
.btn-delete-comment:hover {
    color: var(--danger);
}

/* Priority & Assignee Badges on Cards */
.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.priority-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
}

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

.priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fde047;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-low {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-assignee {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.alert-info {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #c084fc;
}

/* Sidebar Navigation Items */
.nav-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
}
.nav-item:hover {
    background: var(--sidebar-item-hover-bg);
    color: var(--text-main);
}
.nav-item.active {
    background: var(--sidebar-item-active-bg);
    color: var(--text-main);
    font-weight: 600;
}
.nav-item.active i {
    color: var(--primary);
}

/* ==========================================================================
   NOTES MODULE (Caso de Uso 07)
   ========================================================================== */
.color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid transparent;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.note-card {
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    position: relative;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border-left: 4px solid var(--primary);
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

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

.note-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-word;
}

.note-card-pin-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color var(--transition-fast);
}

.note-card-pin-btn.pinned {
    color: var(--warning);
}

.note-card-pin-btn:hover {
    color: var(--text-main);
}

.note-card-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.notes-search-wrapper:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.category-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-main) !important;
}

.note-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main) !important;
}

.note-author-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary);
    border: 1px solid var(--border-color-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.note-card-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   MY TASKS MODULE (Protótipo Figura 7)
   ========================================================================== */
.tasks-search-wrapper:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.task-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main) !important;
}

.task-row {
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.task-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.task-row.completed {
    opacity: 0.6;
}

.task-row.completed .task-title-cell {
    text-decoration: line-through;
    color: var(--text-muted);
}

.priority-badge-pill {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
}

.priority-badge-alta {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-badge-media {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.priority-badge-baixa {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.quick-notes-bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.quick-notes-bullet-item::before {
    content: "•";
    color: var(--primary);
    font-size: 16px;
    line-height: 1;
}

/* Dark Mode Accessibility & Visibility Fixes */

/* 1. Select options styling to prevent white-on-white text in Chrome/Edge */
select option {
    background-color: var(--bg-base);
    color: var(--text-main);
}

/* 2. Date input picker indicator visibility */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: var(--calendar-icon-filter, invert(1));
}

/* 3. Autocomplete input visibility & styling */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-base) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 4. Calendar card items text contrast in dark mode */
[data-theme="dark"] .calendar-card-item {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.45);
    font-weight: 600;
}

/* 5. Placeholder color for better readability in dark mode */
::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.6 !important;
}

/* ==========================================================================
   DIAGRAMS & FLOWCHART MODULE (CANVAS VISUAL)
   ========================================================================== */
.diagrams-workspace {
    animation: fadeIn 0.3s ease;
}

.template-card {
    transition: all var(--transition-fast);
}

.template-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-glow);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.template-card h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 2px 0;
}

.template-card span {
    font-size: 12px;
    color: var(--text-muted);
}

.template-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Diagrams Grid & Cards */
.diagrams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.diagram-card {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.diagram-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-glow);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.diagram-card-preview {
    height: 140px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.diagram-card-preview-icon {
    font-size: 40px;
    color: var(--primary);
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.diagram-card:hover .diagram-card-preview-icon {
    opacity: 0.9;
    transform: scale(1.1);
}

.diagram-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.diagram-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diagram-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.diagram-card-actions {
    display: flex;
    gap: 4px;
}

/* Modal Template Option */
.modal-template-option {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: var(--input-bg);
    transition: var(--transition-fast);
    font-size: 12px;
    color: var(--text-muted);
}

.modal-template-option i {
    font-size: 18px;
}

.modal-template-option:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.modal-template-option.active {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary);
    font-weight: 600;
}

/* ==========================================================================
   INTERACTIVE CANVAS EDITOR
   ========================================================================== */
.diagram-editor-workspace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: var(--bg-base);
}

.diagram-editor-topbar {
    height: 58px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    z-index: 40;
    flex-shrink: 0;
}

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

.diagram-title-container {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

#diagram-active-title {
    background: transparent;
    border: none;
    border-bottom: 1px dashed transparent;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
    transition: var(--transition-fast);
    min-width: 180px;
}

#diagram-active-title:hover, #diagram-active-title:focus {
    border-bottom-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

.edit-hint-icon {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
}

.save-status {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.save-status.saved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.save-status.saving {
    background: rgba(245, 158, 11, 0.15);
    color: #facc15;
}

.save-status.unsaved {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.divider-vertical {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 4px;
}

.zoom-text {
    font-size: 12px;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
    color: var(--text-muted);
}

/* Dropdown Menu Custom */
.dropdown-menu-custom {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.dropdown-item {
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-main);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
    width: 100%;
}

.dropdown-item:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Canvas Stage Layout */
.diagram-stage-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
}

/* Floating Shapes Toolbar */
.diagram-shapes-toolbar {
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.shape-tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

.shape-tool-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 12px var(--primary-glow);
}

.toolbar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Shape Previews in Toolbar */
.shape-preview {
    border: 2px solid currentColor;
}

.shape-preview-terminal {
    width: 22px;
    height: 12px;
    border-radius: 10px;
}

.shape-preview-process {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

.shape-preview-decision {
    width: 16px;
    height: 16px;
    transform: rotate(45deg);
}

.shape-preview-database {
    width: 16px;
    height: 18px;
    border-radius: 4px;
    border-top-left-radius: 8px 4px;
    border-top-right-radius: 8px 4px;
    border-bottom-left-radius: 8px 4px;
    border-bottom-right-radius: 8px 4px;
}

.shape-preview-checkpoint {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border-width: 2px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.shape-preview-io {
    width: 20px;
    height: 14px;
    transform: skewX(-15deg);
}

.shape-preview-document {
    width: 18px;
    height: 16px;
    border-radius: 2px 2px 0 0;
    border-bottom-style: dashed;
}

.shape-preview-note {
    width: 16px;
    height: 16px;
    background: #fde047;
    border: 1px solid #ca8a04;
    border-radius: 2px;
}

/* Viewport & Canvas Layers */
.diagram-canvas-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: default;
    background-color: var(--bg-base);
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

[data-theme="light"] .diagram-canvas-viewport {
    background-image: radial-gradient(rgba(15, 23, 42, 0.15) 1.5px, transparent 1.5px);
}

.diagram-canvas-viewport.no-grid {
    background-image: none !important;
}

.diagram-canvas-viewport.panning {
    cursor: grab !important;
}

.diagram-canvas-viewport.panning-active {
    cursor: grabbing !important;
}

.diagram-canvas-transform {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-origin: 0 0;
}

/* SVG Connection Layer */
.diagram-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 10000px;
    height: 10000px;
    pointer-events: none;
    overflow: visible;
    z-index: 5;
}

.connector-path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5px;
    pointer-events: stroke;
    cursor: pointer;
    transition: stroke 0.2s, stroke-width 0.2s;
}

.connector-path:hover {
    stroke: #38bdf8;
    stroke-width: 3.5px;
}

.connector-path.selected {
    stroke: #38bdf8;
    stroke-width: 3.5px;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
}

.temp-connector {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 2.5px;
    stroke-dasharray: 6;
    pointer-events: none;
}

.connector-label-bg {
    fill: var(--bg-surface);
    stroke: var(--border-color);
    stroke-width: 1;
    rx: 6;
    pointer-events: auto;
    cursor: pointer;
    transition: stroke 0.2s, fill 0.2s;
}

.connector-label-bg:hover {
    stroke: #38bdf8;
    fill: rgba(56, 189, 248, 0.15);
}

.connector-label-text {
    font-size: 11.5px;
    font-weight: 600;
    fill: var(--text-main);
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
}

/* HTML Nodes Layer */
.diagram-nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 10;
}

.diagram-node {
    position: absolute;
    user-select: none;
    cursor: move;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.diagram-node:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.diagram-node.selected {
    outline: 2px solid #38bdf8;
    outline-offset: 3px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Node Shape Styles */
.node-shape-terminal {
    border-radius: 9999px;
}

.node-shape-process {
    border-radius: 10px;
}

.node-shape-decision {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.node-shape-decision::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--node-bg, #f59e0b);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    z-index: 1;
    transition: box-shadow 0.2s;
}

.node-shape-decision.selected::before {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.node-shape-decision .node-content {
    position: relative;
    z-index: 2;
    padding: 14px 18px;
}

.node-shape-database {
    border-radius: 18px / 12px;
    position: relative;
}

.node-shape-database::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 1;
}

.node-shape-checkpoint {
    border-radius: 50%;
    outline: 3px double rgba(255, 255, 255, 0.45);
    outline-offset: -5px;
}

.node-shape-io {
    transform: skewX(-14deg);
    border-radius: 6px;
}

.node-shape-io .node-content {
    transform: skewX(14deg);
}

.node-shape-document {
    border-radius: 8px 8px 14px 0;
}

.node-shape-note {
    border-radius: 4px;
    box-shadow: 3px 6px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.node-shape-text {
    background: transparent !important;
    border: 1.5px dashed transparent !important;
    box-shadow: none !important;
}

.node-shape-text:hover, .node-shape-text.selected {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Node Resize Handle */
.node-resize-handle {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 10px;
    height: 10px;
    background: #38bdf8;
    border: 2px solid #ffffff;
    border-radius: 3px;
    cursor: nwse-resize;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
}

.diagram-node.selected .node-resize-handle {
    opacity: 1;
}

.node-resize-handle:hover {
    transform: scale(1.3);
    background: var(--primary);
}

/* Inline Connector Label Popover */
.diagram-connector-popover {
    position: absolute;
    z-index: 60;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    padding: 14px;
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.2s ease;
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.popover-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-popover-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-popover-close:hover {
    color: var(--danger);
}

.popover-quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.quick-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-pill:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.popover-input-group {
    display: flex;
    gap: 6px;
}

.popover-input-group input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--transition-fast);
}

.popover-input-group input:focus {
    border-color: var(--primary);
}

.btn-popover-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    text-align: left;
    padding: 4px 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition-fast);
}

.btn-popover-clear:hover {
    color: var(--danger);
}

/* Card Miniature SVG Preview */
.diagram-card-preview svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.node-content {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
    outline: none;
    cursor: text;
}

/* Magnetic Connection Ports */
.node-port {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #38bdf8;
    border: 2px solid #ffffff;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    cursor: crosshair;
    z-index: 25;
}

.diagram-node:hover .node-port, .diagram-node.selected .node-port {
    opacity: 0.85;
}

.node-port:hover {
    opacity: 1 !important;
    transform: scale(1.4);
    background: var(--primary);
}

.port-top {
    top: -6px;
    left: calc(50% - 6px);
}

.port-right {
    right: -6px;
    top: calc(50% - 6px);
}

.port-bottom {
    bottom: -6px;
    left: calc(50% - 6px);
}

.port-left {
    left: -6px;
    top: calc(50% - 6px);
}

/* Floating Properties Bar */
.diagram-properties-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.prop-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.color-palette {
    display: flex;
    gap: 6px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.15s;
    padding: 0;
}

.color-dot:hover {
    transform: scale(1.25);
}

.prop-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.prop-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.prop-btn.danger:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
}

/* Canvas Hints Badge */
.canvas-hints-badge {
    position: absolute;
    bottom: 16px;
    right: 20px;
    z-index: 30;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    pointer-events: none;
}

/* ==========================================================================
   ADMIN ACCESS & USER MANAGEMENT STYLES
   ========================================================================== */
.badge-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-status-pill.badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-status-pill.badge-success {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.32);
}

.badge-status-pill.badge-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.32);
}

.badge-status-pill.badge-admin {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.btn-action-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.btn-action-admin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-action-admin.btn-approve {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.btn-action-admin.btn-approve:hover:not(:disabled) {
    background: #10b981;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-action-admin.btn-reject {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-action-admin.btn-reject:hover:not(:disabled) {
    background: #ef4444;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-action-admin.btn-toggle-admin {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.btn-action-admin.btn-toggle-admin:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

.btn-action-admin.btn-delete-user {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 7px 10px;
}

.btn-action-admin.btn-delete-user:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

#admin-users-table-body tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.badge-pending {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 14px rgba(245, 158, 11, 0.7);
    }
}

/* ==========================================================================
   AUTH ANDROID APP DOWNLOAD CARD
   ========================================================================== */
.auth-android-download {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.auth-android-download .divider-text {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.btn-android-download {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(99, 102, 241, 0.12));
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.btn-android-download:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(99, 102, 241, 0.22));
    border-color: rgba(34, 197, 94, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.2);
}

.android-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.android-download-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex-grow: 1;
}

.android-download-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    line-height: 1.2;
}

.android-download-sub {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
}

.download-arrow {
    color: #22c55e;
    font-size: 15px;
    transition: transform 0.2s ease;
}

.btn-android-download:hover .download-arrow {
    transform: translateY(2px);
}
