/**
 * MyWorkflow - Premium Notion-like Theme
 * Clean, minimal UI inspired by Notion
 */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #5b6b7a;
    --primary-hover: #4f5d6a;
    --primary-light: rgba(91, 107, 122, 0.14);

    /* Accent Colors */
    --accent-blue: #5b6b7a;
    --accent-green: #16a34a;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;

    /* Background Colors */
    --bg-primary: #f7f6f3;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f1ee;
    --bg-card: #ffffff;
    --bg-glass: #ffffff;

    /* Text Colors */
    --text-primary: #2f3437;
    --text-secondary: #6b7280;
    --text-muted: #9aa0a6;
    --text-inverse: #ffffff;
    --gantt-project-color: #0d9488;

    /* Border Colors */
    --border-color: #e6e3df;
    --border-light: #efedea;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.10);
    --shadow-xl: 0 20px 32px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 0 rgba(0, 0, 0, 0);

    /* Glassmorphism (disabled for Notion-like look) */
    --glass-bg: #ffffff;
    --glass-border: #e6e3df;
    --glass-blur: 0px;

    /* Action Colors (subtle) */
    --action-bg: #efedea;
    --action-bg-hover: #e7e4e0;
    --action-border: #e2dfdb;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 0.4s;

    /* Font */
    --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }
}


/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f7f6f3;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f1ee;
    --bg-card: #ffffff;
    --bg-glass: #ffffff;
    --text-primary: #2f3437;
    --text-secondary: #6b7280;
    --text-muted: #9aa0a6;
    --text-inverse: #ffffff;
    --border-color: #e6e3df;
    --border-light: #efedea;
    --glass-bg: #ffffff;
    --glass-border: #e6e3df;
    --action-bg: #efedea;
    --action-bg-hover: #e7e4e0;
    --action-border: #e2dfdb;
}

/* Dark Theme Variables (Notion-like) */
[data-theme="dark"] {
    --primary: #9aa0a6;
    --primary-hover: #b0b6bd;
    --primary-light: rgba(154, 160, 166, 0.16);

    --accent-blue: #9aa0a6;
    --accent-green: #22c55e;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-pink: #db2777;

    --bg-primary: #191919;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #262626;
    --bg-card: #1f1f1f;
    --bg-glass: #1f1f1f;

    --text-primary: #e8e6e3;
    --text-secondary: #a8a8a8;
    --text-muted: #8b8b8b;
    --gantt-project-color: #2dd4bf;

    --border-color: #2f2f2f;
    --border-light: #3a3a3a;
    --action-bg: #2a2a2a;
    --action-bg-hover: #333333;
    --action-border: #3a3a3a;

    --glass-bg: #1f1f1f;
    --glass-border: #2f2f2f;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: none;
    z-index: -1;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

p {
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--primary-hover);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Layout - App Container
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    z-index: 100;
    transition: width var(--transition-normal);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    padding: var(--spacing-md);
}

.sidebar.collapsed .logo-area h2,
.sidebar.collapsed .nav-item>span:not(.nav-badge),
.sidebar.collapsed .nav-section-title {
    display: none;
}

.sidebar.collapsed .logo-icon {
    margin: 0 auto;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    position: relative;
}

/* 배지는 collapsed 상태에서도 항상 보이도록 */
.sidebar.collapsed .nav-badge {
    display: inline-flex !important;
    position: absolute;
    top: 6px;
    right: 6px;
    margin-left: 0;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.logo-icon:hover {
    background: var(--bg-primary);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-icon:active {
    transform: scale(0.95);
}

.logo-area h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i,
.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    margin-left: auto;
}

.nav-badge-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.nav-badge-danger {
    background: #ef4444;
    color: var(--text-inverse);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    transition: all 0.2s;
}

[data-theme="dark"] .count-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.tab.active .count-badge {
    background: var(--primary);
    color: var(--text-inverse);
}

.nav-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 var(--spacing-md) var(--spacing-sm);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
    overflow-x: auto;
    /* Enable horizontal scroll for wide content like Calendar */
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: 20px;
    /* Aligns with sidebar brand border (24+44+20=88px) */
    border-bottom: 1px solid var(--border-color);
}

.page-title h2 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-xs);
}

.page-title p {
    color: var(--text-muted);
    font-size: 13px;
}

.sidebar-toggle-zap {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-light);
    color: var(--primary);
}

.sidebar-toggle-zap:hover {
    background: var(--action-bg-hover) !important;
    border-color: var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
}

.user-profile .dropdown-menu {
    z-index: 1000;
    margin-top: 8px;
}

.user-profile .dropdown-item i {
    flex-shrink: 0;
}

/* Header Center - Top Navigation */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 var(--spacing-xl);
}

.top-nav-tabs {
    display: flex;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-lg);
    gap: 4px;
}

.top-nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    white-space: nowrap;
}

.top-nav-tab:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .top-nav-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.top-nav-tab.active {
    background: var(--bg-primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .top-nav-tab.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.top-nav-tab i {
    width: 16px;
    height: 16px;
}

@media (max-width: 1024px) {
    .header-center {
        display: none;
    }
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 16px;
}

/* ============================================
   Cards (Glassmorphism)
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

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

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

/* ============================================
   Statistics Cards
   ============================================ */
.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-xs);
}

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

.stat-change {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 12px;
    margin-top: var(--spacing-sm);
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--action-bg);
    color: var(--text-primary);
    width: auto;
    /* Changed from 100% to auto */
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 1px solid var(--action-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--action-bg-hover);
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-red);
    color: var(--text-inverse);
}

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

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: var(--spacing-xl);
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================
   Task Items
   ============================================ */
.task-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.task-item:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.task-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.task-item.drag-over {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.task-item.drag-over-top {
    border-top: 3px solid var(--primary);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.task-item.drag-over-bottom {
    border-bottom: 3px solid var(--primary);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.task-item-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    cursor: pointer;
    width: 100%;
}

.task-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: grab;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.task-item:hover .task-drag-handle {
    opacity: 1;
}

.task-drag-handle:active {
    cursor: grabbing;
    opacity: 1;
}

.task-drag-handle:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

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

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.task-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.task-checkbox.checked::after {
    content: '✓';
    color: var(--text-inverse);
    font-size: 12px;
    font-weight: bold;
}

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

.task-title {
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-badge-indicator {
    background: var(--accent-red);
    color: var(--text-inverse);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    vertical-align: middle;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 12px;
    color: var(--text-muted);
}

.task-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    /* Push badges to the right side before actions */
    margin-right: var(--spacing-lg);
}

/* Inline Actions */
.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.btn-action {
    width: 28px;
    height: 28px;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.btn-action.delete:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    color: var(--text-inverse);
    font-size: 9px;
    font-weight: bold;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1px solid var(--bg-primary);
}

/* ============================================
   Premium Task Detail Modal
   ============================================ */
.modal-header-premium {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-primary);
}

.premium-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.metadata-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    font-size: 13px;
}

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

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

.meta-value {
    color: var(--text-primary);
    font-weight: 600;
}

.meta-select,
.meta-input {
    border: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.meta-select:hover,
.meta-input:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.modal-body-premium {
    padding: var(--spacing-xl);
    max-height: calc(90vh - 180px);
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Memo Modal Specific Styles */
.memo-modal-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-light);
}

.memo-modal-body {
    padding: var(--spacing-xl);
}

.memo-form-group {
    margin-bottom: var(--spacing-lg);
}

.memo-form-group:first-child {
    margin-bottom: var(--spacing-md);
}

.memo-title-input {
    font-size: 18px;
    font-weight: 600;
    padding: 14px 18px;
    border: 2px solid var(--border-light);
}

.memo-title-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.memo-content-textarea {
    min-height: 180px;
    padding: 16px 18px;
    font-size: 15px;
    line-height: 1.7;
    border: 2px solid var(--border-light);
    resize: vertical;
}

.memo-content-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.memo-options-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.color-selection-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.color-label {
    margin-bottom: 0;
    font-size: 12px;
}

.memo-modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.memo-footer-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-left: auto;
}

.memo-footer-actions .btn {
    min-width: 100px;
    padding: 10px 20px;
    font-weight: 600;
}

.memo-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    position: relative;
    padding-left: 5px;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--border-light);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
}

.activity-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.rich-comment-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--spacing-xl);
}

.editor-toolbar {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tool-btn:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.comment-textarea {
    width: 100%;
    border: none;
    background: transparent;
    padding: var(--spacing-lg);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    min-height: 100px;
}

.comment-textarea:focus {
    outline: none;
}

.btn-register {
    border-radius: var(--radius-md) !important;
    padding: 8px 20px !important;
}

.modal-footer-premium {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-secondary);
    min-height: 70px;
}

.modal-footer-premium .btn {
    width: auto !important;
    min-width: 80px;
}

#memo-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

.comment-item {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    transition: background var(--transition-fast);
}

.comment-item:hover {
    background: var(--bg-secondary);
}

.comment-item.comment-reply {
    border-left: 2px solid var(--border-color);
    padding-left: var(--spacing-md);
    margin-left: var(--spacing-md);
}

.comment-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.comment-text {
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.5;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.comment-date {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.btn-reply {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-reply:hover {
    color: var(--primary);
    background: var(--bg-tertiary);
}

.comment-replies {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
}

.reply-input-container {
    margin-top: var(--spacing-sm);
    margin-left: var(--spacing-md);
}

.reply-input-container .comment-input-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-input-container .comment-input-area input {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.reply-input-container .comment-input-area .btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.comment-date {
    font-size: 11px;
    color: var(--text-muted);
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
}

.priority-low {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

.status-pending {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-progress {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.status-done {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

/* ============================================
   Project Cards
   ============================================ */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.project-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.btn-edit-project-name,
.btn-delete-project {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.2s;
    border-radius: var(--radius-sm);
}

.btn-edit-project-name:hover {
    opacity: 1;
    background: var(--bg-tertiary);
    color: var(--primary);
}

.btn-delete-project:hover {
    opacity: 1;
    background: var(--bg-tertiary);
    color: var(--danger);
}

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

.project-progress {
    margin-top: var(--spacing-md);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

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

/* Phase Badge */
.phase-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.phase-1 {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
}

.phase-2 {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.phase-3 {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

/* ============================================
   Kanban Board
   ============================================ */
.kanban-container {
    display: flex;
    gap: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-lg);
}

.kanban-column {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.kanban-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
}

.kanban-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
}

.kanban-tasks {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-height: 200px;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px dashed transparent;
    transition: all var(--transition-fast);
}

.kanban-tasks.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: grab;
    transition: all var(--transition-fast);
}

.kanban-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-light);
}

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

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    /* Added flex to help with footer stickiness */
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-md {
    max-width: 650px !important;
}

.modal-xl {
    max-width: 1000px !important;
}

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

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

.modal-title {
    font-weight: 600;
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Minimalist Modal Enhancements */
.modal-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.modal-footer-minimal {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    gap: var(--spacing-md);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid transparent;
}

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

.input-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 13px;
}

.dependency-selector {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

.dependency-selector select {
    border: none;
    background: transparent;
    padding: 2px;
}

.help-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 2px;
}

.action-input-group {
    display: flex;
    gap: var(--spacing-sm);
    background: var(--bg-tertiary);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.action-input-group .form-input {
    border: none;
    background: transparent;
}

.checklist-compact,
.comments-compact {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

/* Scrollbar styling for compact lists */
.checklist-compact::-webkit-scrollbar,
.comments-compact::-webkit-scrollbar {
    width: 4px;
}

.checklist-compact::-webkit-scrollbar-thumb,
.comments-compact::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* ============================================
   Toast / Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--spacing-xl);
    /* Move to TOP */
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    /* Enable clicks for close button */
    display: flex;
    align-items: flex-start;
    /* Better for multi-line text */
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
    max-width: 480px;
    /* Increased max-width */
}

/* Shortcuts Modal */
.shortcut-list {
    display: flex;
    flex-direction: column;
}

.shortcut-item {
    padding: var(--spacing-md) 0;
}

.kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    color: var(--text-primary);
    box-shadow: 0 2px 0 var(--border-color);
    margin: 0 2px;
}

[data-theme="dark"] .kbd {
    background: var(--bg-secondary);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(-100%);
        /* Slide from TOP */
        opacity: 0;
    }

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

.toast.success {
    border-left: 4px solid var(--accent-green);
}

.toast.error {
    border-left: 4px solid var(--accent-red);
}

.toast.warning {
    border-left: 4px solid var(--accent-yellow);
}

.toast.info {
    border-left: 4px solid var(--accent-blue);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: keep-all;
    /* Better for Korean */
    overflow-wrap: break-word;
    /* Ensure it doesn't overflow */
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   Loading States
   ============================================ */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--spacing-xl) auto;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-light) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.tab {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

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

.tab.active {
    background: var(--action-bg);
    color: var(--text-primary);
    border: 1px solid var(--action-border);
}

/* ============================================
   Dropdown Menu
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--accent-red);
}

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

/* ============================================
   Search Input
   ============================================ */
.search-wrapper {
    position: relative;
}

.search-wrapper input {
    padding-left: 40px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ============================================
   Tags
   ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   Memo Cards (Google Keep Style)
   ============================================ */
.memo-grid {
    column-count: auto;
    column-width: 280px;
    column-gap: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.memo-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: visible;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: var(--spacing-lg);
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 6px solid var(--memo-accent, var(--border-color));
    z-index: 1;
}

.memo-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--memo-accent, var(--primary));
}

.memo-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--memo-accent, transparent);
    opacity: 0.15;
    /* Subtlest tint of the chosen pastel */
    pointer-events: none;
    border-radius: inherit;
    z-index: -1;
}

.memo-card.pinned::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 32px 32px 0;
    border-color: transparent var(--accent-yellow) transparent transparent;
    z-index: 1;
}

.memo-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.memo-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: var(--spacing-sm);
}

.memo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

.memo-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Premium Note Workspace (StackEdit Style)
   ============================================ */
/* ============================================
   Compact Note Workspace Redesign
   ============================================ */
.note-workspace-container.compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    height: calc(100vh - 160px);
    position: relative;
}

.note-main {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: visible !important;
    /* Allow overlay to pop out */
}

/* Floating Explorer Dropdown (Premium Refined) */
.note-explorer-floating {
    position: absolute;
    top: 52px;
    left: 12px;
    width: 320px;
    z-index: 1000;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.25));
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: top left;
}

.note-explorer-floating.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
}

.explorer-inner {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-height: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.explorer-header-mini {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.search-wrapper.mini {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    padding: 0 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    /* Precise gap for alignment */
    height: 34px;
}

.search-wrapper.mini .form-input {
    font-size: 13px;
    height: 100%;
    padding: 0;
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    width: 100%;
}

.search-wrapper.mini .search-icon {
    color: var(--text-muted);
}

.explorer-list-mini {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.note-item {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.note-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.note-item.active {
    background: var(--primary);
    border-color: var(--primary-hover);
}

.note-item.active .note-item-title {
    color: var(--text-inverse);
}

.note-item.active .note-item-date {
    color: rgba(255, 255, 255, 0.7);
}

.note-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item-date {
    font-size: 11px;
    color: var(--text-muted);
}

.note-folder {
    margin-bottom: var(--spacing-sm);
}

.note-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.note-folder-header-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    cursor: pointer;
}

.note-folder-header:hover {
    background: var(--action-bg);
}

.note-folder-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.note-folder:hover .note-folder-actions {
    opacity: 1;
}

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

.btn-icon-sm:hover {
    background: var(--action-bg);
    color: var(--text-primary);
}

.note-item {
    position: relative;
}

.note-item-action {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.note-item:hover .note-item-action {
    opacity: 1;
}

.note-folder-header i {
    color: var(--accent-yellow);
}

.note-folder-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Drag and Drop Styles */
.note-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.note-item[draggable="true"] {
    cursor: grab;
}

.note-item[draggable="true"]:active {
    cursor: grabbing;
}

.note-folder-header.drag-over {
    background: var(--primary-light) !important;
    border: 2px dashed var(--primary);
    transform: scale(1.02);
}

.note-folder-header.drag-over .note-folder-header-main {
    color: var(--primary);
}

.note-folder-content {
    margin-left: var(--spacing-md);
    margin-top: var(--spacing-xs);
}

/* Enhanced Toolbar Tooltips & Actions */
.note-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    /* Reduced padding for smaller icons */
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
    flex-wrap: wrap;
    min-height: 50px;
    /* Reduced height for smaller icons */
}

.toolbar-group {
    display: flex;
    gap: 8px;
    /* Slightly more air */
}

.toolbar-divider {
    width: 2px;
    height: 18px;
    /* Reduced by 50% */
    background: var(--border-light);
    margin: 0 8px;
    opacity: 0.6;
}

.tool-btn {
    width: 26px;
    /* Reduced by 50% */
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
    border: none;
    cursor: pointer;
}

.tool-btn:hover {
    background: var(--bg-primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.note-content-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
}

.premium-title-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    padding: 4px 0 4px var(--spacing-md);
}

.note-split-view {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.editor-pane {
    border-right: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.premium-note-editor {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    padding: 32px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.preview-pane {
    background: var(--bg-primary);
    overflow-y: auto;
    padding: 32px;
}

/* Sync Status Indicator (Premium Refined) */
.sync-status {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sync-status.saving {
    color: var(--accent-yellow);
    animation: pulseSync 1.5s infinite;
}

.sync-status.success {
    color: var(--accent-green);
}

@keyframes pulseSync {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

#manual-save-btn {
    transition: all 0.2s;
}

#manual-save-btn:active {
    transform: scale(0.92);
}

/* Markdown Rendering Engine Polish */
.markdown-body {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.7;
}

.markdown-body h1 {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-size: 1.8em;
}

.markdown-body h2 {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 4px;
    margin-bottom: 12px;
    font-size: 1.4em;
}

.markdown-body blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 16px;
    color: var(--text-muted);
    font-style: italic;
}

.markdown-body code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--border-light);
}

.markdown-body img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.markdown-body li {
    margin-bottom: 6px;
}

/* Scrollbar Polishing */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* ============================================
   Views Toggle
   ============================================ */
.view-section {
    animation: fadeIn 0.3s ease;
}

.view-section.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
        padding: var(--spacing-md);
    }

    .sidebar .logo-area h2,
    .sidebar .nav-item>span:not(.nav-badge),
    .sidebar .nav-section-title {
        display: none;
    }

    /* 배지는 작은 화면에서도 항상 보이도록 */
    .sidebar .nav-badge {
        display: inline-flex !important;
        position: absolute;
        top: 6px;
        right: 6px;
        margin-left: 0;
        z-index: 10;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .sidebar .nav-item {
        position: relative;
        justify-content: center;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .header {
        gap: var(--spacing-sm);
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        padding-top: var(--spacing-xs);
    }
}

@media (max-width: 768px) {
    #mobile-menu-btn {
        display: flex !important;
        background: var(--bg-secondary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }

    #mobile-menu-btn:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    #sidebar-toggle-btn {
        display: none !important;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        width: var(--sidebar-width);
        transition: left var(--transition-normal);
        z-index: 100;
        height: 100vh;
        overflow-y: auto;
        background: var(--bg-secondary);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
        padding: var(--spacing-lg);
    }

    .sidebar.collapsed .logo-area h2,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .nav-section-title {
        display: block;
    }

    .sidebar.collapsed .logo-icon {
        margin: 0;
    }

    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    [data-theme="light"] .sidebar-overlay {
        background: rgba(0, 0, 0, 0.3);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar .logo-area h2,
    .sidebar .nav-item span,
    .sidebar .nav-section-title {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
        padding-top: 60px;
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        padding-bottom: var(--spacing-md);
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .header-right {
        justify-content: flex-start;
        width: 100%;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .kanban-container {
        flex-direction: column;
    }

    .kanban-column {
        max-width: none;
    }

    /* Admin View Mobile Styles */
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .admin-toolbar .search-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .admin-toolbar .flex {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }

    .admin-toolbar .form-select {
        width: 100% !important;
    }

    #admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    #admin-stats-grid .card.glass-card {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .stat-value-sm {
        font-size: 20px;
    }

    .card-title-sm {
        font-size: 11px;
    }

    /* Sidebar Menu Mobile Styles */
    .sidebar {
        background: var(--bg-secondary);
        border-right: 1px solid var(--border-color);
    }

    .sidebar .logo-area {
        border-bottom-color: var(--border-color);
    }

    .sidebar .logo-area h2 {
        color: var(--text-primary);
    }

    .sidebar .nav-item {
        color: var(--text-secondary);
    }

    .sidebar .nav-item:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .sidebar .nav-item.active {
        background: var(--primary-light);
        color: var(--primary);
    }

    .sidebar .nav-section-title {
        color: var(--text-muted);
    }

    .sidebar .nav-badge {
        color: var(--text-inverse);
    }

    /* Admin Table Mobile Styles */
    #view-admin table {
        font-size: 12px;
    }

    #view-admin table th,
    #view-admin table td {
        padding: var(--spacing-sm) !important;
        font-size: 12px;
    }

    #view-admin table th:first-child,
    #view-admin table td:first-child {
        min-width: 100px;
    }

    #view-admin table th:nth-child(2),
    #view-admin table td:nth-child(2) {
        min-width: 150px;
    }

    #view-admin .card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #view-admin .card>div[style*="overflow-x"] {
        -webkit-overflow-scrolling: touch;
    }

    /* Announcement Section Mobile Styles - Force readable text in light theme */
    .announcement-section,
    .notice-section,
    .announcement-box,
    .notice-box,
    [class*="announcement"],
    [class*="notice"],
    [id*="announcement"],
    [id*="notice"] {
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    /* Force all text inside announcement sections to be visible */
    .announcement-section *,
    .notice-section *,
    .announcement-box *,
    .notice-box *,
    [class*="announcement"] *,
    [class*="notice"] *,
    [id*="announcement"] *,
    [id*="notice"] * {
        color: var(--text-primary) !important;
    }

    /* Override white text specifically */
    [data-theme="light"] .announcement-section *,
    [data-theme="light"] .notice-section *,
    [data-theme="light"] .announcement-box *,
    [data-theme="light"] .notice-box *,
    [data-theme="light"] [class*="announcement"] *,
    [data-theme="light"] [class*="notice"] *,
    [data-theme="light"] [id*="announcement"] *,
    [data-theme="light"] [id*="notice"] * {
        color: var(--text-primary) !important;
    }

    .announcement-title,
    .notice-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary) !important;
        margin-bottom: var(--spacing-sm);
    }

    .announcement-content,
    .notice-content,
    .announcement-text,
    .notice-text {
        font-size: 13px;
        line-height: 1.6;
        color: var(--text-secondary) !important;
    }

    .announcement-link,
    .notice-link {
        color: var(--primary) !important;
        text-decoration: none;
        font-size: 12px;
        font-weight: 500;
        margin-top: var(--spacing-sm);
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    .announcement-link:hover,
    .notice-link:hover {
        color: var(--primary-hover) !important;
        text-decoration: underline;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-muted {
    color: var(--text-muted);
}

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

.text-success {
    color: var(--accent-green);
}

.text-warning {
    color: var(--accent-yellow);
}

.text-danger {
    color: var(--accent-red);
}

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

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

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

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

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

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

.flex {
    display: flex;
}

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

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

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   Calendar
   ============================================ */
.calendar-grid {
    width: 100%;
    height: calc(100vh - 200px);
    /* Fits inside viewport */
    display: flex;
    flex-direction: column;
    position: relative;
    /* For loader positioning */
}

.calendar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--bg-primary-rgb, 247, 246, 243), 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: var(--radius-md);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.calendar-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-secondary);
}

.calendar-loader-text {
    font-size: 14px;
    font-weight: 500;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: var(--spacing-xs);
    flex-shrink: 0;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    padding: var(--spacing-sm);
}

.calendar-body {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    /* Proportional rows */
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calendar-day {
    height: 100%;
    /* Fill the grid cell */
    background: var(--bg-secondary);
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow-y: auto;
    /* Internal scrolling */
    display: flex;
    flex-direction: column;
}

.calendar-day::-webkit-scrollbar {
    width: 4px;
}

.calendar-day::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.calendar-day:hover {
    background: var(--bg-tertiary);
}

.calendar-day.today {
    background: var(--primary-light);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: var(--spacing-xs);
}

.calendar-day.today .calendar-day-number {
    color: var(--primary);
}

.calendar-event {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event.past-event {
    opacity: 0.4;
    filter: grayscale(0.3);
}

/* ============================================
   AI Chat & Dashboard Redesign
   ============================================ */
.ai-dashboard {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--spacing-lg);
    height: calc(100vh - 160px);
    /* Adjust based on your header */
    min-height: 600px;
}

.ai-chat-pane {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.ai-chat-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-status-orb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ai-status-orb.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.ai-message-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    background: var(--bg-secondary);
}

.ai-message {
    display: flex;
    gap: var(--spacing-lg);
    max-width: 85%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.ai-message.user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--text-inverse);
}

.ai-message-bubble {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-message-content {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-size: 14.5px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.ai-message.assistant .ai-message-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-top-left-radius: 2px;
}

.ai-message.user .ai-message-content {
    background: var(--primary);
    color: var(--text-inverse);
    border-top-right-radius: 2px;
}

.ai-message-time {
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 4px;
}

.ai-message.user .ai-message-time {
    text-align: right;
}

/* Action Tray */
.ai-action-tray {
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.ai-input-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.ai-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.ai-textarea {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 14px;
    resize: none;
    color: var(--text-primary);
    max-height: 200px;
    outline: none;
}

.ai-input-actions {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}

.ai-send-btn {
    border-radius: var(--radius-md);
    padding: 6px 16px;
    gap: 8px;
}

.ai-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--spacing-sm);
}

/* Intel Pane (Sidebar) */
.ai-intel-pane {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.intel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-briefing-viewer {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    min-height: 200px;
}

.ai-suggested-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.suggest-chip {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.suggest-chip:hover {
    background: var(--action-bg-hover);
    border-color: var(--text-muted);
    transform: translateX(4px);
}

/* Inbox View Custom Styles */
.inbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.inbox-item-content {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* AI Task Candidates in Chat */
.ai-task-candidates {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-task-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.ai-task-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.ai-task-card-info {
    flex: 1;
    min-width: 0;
}

.ai-task-card-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-task-card-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-task-preview {
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
}

.memo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memo-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.memo-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* ============================================
   Search Results
   ============================================ */
.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}

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

.search-result-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.search-result-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

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

/* Notification Center */
.notification-center {
    position: fixed;
    top: 80px;
    right: var(--spacing-xl);
    width: 350px;
    max-height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

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

.notif-list {
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.notif-item.unread {
    border-left: 3px solid var(--primary);
    background: var(--primary-light);
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-info {
    background: var(--primary-light);
    color: var(--primary);
}

.notif-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.notif-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-yellow);
}

.notif-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.notif-content {
    flex: 1;
    font-size: 13px;
}

.notif-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* ============================================
   Premium Memo Modal Styles
   ============================================ */
.form-group-premium {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.premium-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-input-large {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.premium-input-large::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.premium-input-large:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.premium-textarea-large {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    resize: vertical;
    min-height: 150px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.premium-textarea-large::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.premium-textarea-large:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.premium-options-row {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.checkbox-wrapper-premium {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    padding: 8px 0;
    transition: all 0.2s;
}

.checkbox-wrapper-premium:hover {
    opacity: 0.8;
}

.checkbox-wrapper-premium input {
    display: none;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-wrapper-premium input:checked+.checkbox-mark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-mark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper-premium input:checked+.checkbox-mark::after {
    display: block;
}

.checkbox-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Color Picker Premium */
.color-picker-premium {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--spacing-sm);
}

.color-token-wrapper {
    position: relative;
}

.color-token-wrapper input[type="radio"] {
    display: none;
}

.color-token-wrapper label {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-token-wrapper label:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.color-token-wrapper input[type="radio"]:checked+label {
    transform: scale(1.1);
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--primary-light), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-premium-save {
    padding: 10px 24px !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px;
}

/* Modal View Management */
.task-modal-view.hidden,
.settings-section-view.hidden {
    display: none;
}

/* ============================================
   Settings Overhaul
   ============================================ */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--spacing-xl);
    min-height: 500px;
    align-items: start;
}

.settings-sidebar {
    position: sticky;
    top: 0;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-nav-item i {
    color: var(--text-muted);
    transition: color 0.2s;
}

.settings-nav-item:hover {
    background: var(--action-bg-hover);
    color: var(--text-primary);
}

.settings-nav-item:hover i {
    color: var(--text-primary);
}

/* Keyboard Shortcuts Modal */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.shortcut-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.shortcut-group-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

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

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-keys kbd {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 24px;
    text-align: center;
}

.shortcut-desc {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    text-align: right;
    margin-right: var(--spacing-md);
}

/* Guide Styles */
.guide-content {
    line-height: 1.6;
}

.guide-step {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.guide-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.guide-step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.guide-step-content {
    flex: 1;
}

.guide-step-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.guide-step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: var(--spacing-xs) 0;
    line-height: 1.6;
}

.guide-step-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.code-block {
    background: var(--bg-tertiary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    margin: var(--spacing-sm) 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    word-break: break-all;
}

.alert-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--accent-yellow);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-sm);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: start;
    gap: var(--spacing-xs);
}

.guide-tip {
    background: var(--primary-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-lg);
}

.guide-tip ul {
    margin: var(--spacing-xs) 0 0 0;
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.guide-tip li {
    margin: var(--spacing-xs) 0;
    line-height: 1.6;
}

.guide-tip a {
    color: var(--primary);
    text-decoration: underline;
}

/* Button Success State */
.btn-success {
    background: var(--accent-green);
    color: var(--text-inverse);
    border-color: var(--accent-green);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-success:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Readonly Input Style */
input[readonly] {
    cursor: not-allowed;
    opacity: 0.8;
}

.settings-nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-nav-item.active i {
    color: var(--primary);
}

/* Theme Selection */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.theme-option {
    cursor: pointer;
}

.theme-preview {
    aspect-ratio: 16/10;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    padding: 8px;
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
    transition: all 0.2s;
    overflow: hidden;
}

.theme-option:hover .theme-preview {
    border-color: var(--text-muted);
}

[data-theme="light"] .theme-option[data-theme-val="light"] .theme-preview,
[data-theme="dark"] .theme-option[data-theme-val="dark"] .theme-preview {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.preview-sidebar {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-line {
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.preview-line.short {
    width: 40%;
}

.preview-line.long {
    width: 80%;
}

.light-preview {
    background: #f7f6f3;
}

.dark-preview {
    background: #191919;
}

.dark-preview .preview-sidebar {
    background: #262626;
}

.dark-preview .preview-line {
    background: #3a3a3a;
}

.theme-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-name {
    font-size: 13px;
    font-weight: 500;
}

.theme-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    position: relative;
}

[data-theme="light"] .theme-option[data-theme-val="light"] .theme-radio,
[data-theme="dark"] .theme-option[data-theme-val="dark"] .theme-radio {
    border-color: var(--primary);
    background: var(--primary);
}

[data-theme="light"] .theme-option[data-theme-val="light"] .theme-radio::after,
[data-theme="dark"] .theme-option[data-theme-val="dark"] .theme-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* AI Key UI */
.ai-key-status {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    color: var(--text-primary);
    font-size: 13px;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

/* Comment & Item Styles */
.comment-bubble {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 13px;
    position: relative;
}

.comment-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.ai-badge {
    font-size: 9px;
    padding: 1px 4px;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: 4px;
    margin-left: 4px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 0;
}

.checklist-item.completed span {
    text-decoration: line-through;
    opacity: 0.6;
}

/* ============================================
   Gantt Chart
   ============================================ */
.gantt-card {
    overflow: hidden;
    padding: 0;
}

.gantt-container {
    display: flex;
    overflow-x: hidden;
    overflow-y: visible;
    /* 메인 페이지 스크롤을 위해 visible로 변경 */
    min-height: 320px;
    height: auto;
    /* 내용에 따라 늘어나도록 설정 */
}

.gantt-container.hidden {
    display: none !important;
}

.gantt-sidebar {
    flex-shrink: 0;
    width: 360px;
    min-width: 360px;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-right: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.gantt-sidebar-header {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 70px 70px;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.gantt-th-task {
    grid-column: 1;
}

/* .gantt-th-project removed */

.gantt-th-priority {
    grid-column: 2;
}

.gantt-th-status {
    grid-column: 3;
}

#gantt-sidebar-rows,
#project-detail-gantt-sidebar-rows {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.gantt-project-header {
    display: grid;
    grid-template-columns: 1fr 70px 70px;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--gantt-project-color);
    align-items: center;
    min-height: 36px;
    box-sizing: border-box;
}

.gantt-cell-project-header {
    grid-column: 1 / -1;
    font-weight: 600;
    color: var(--gantt-project-color);
}

.gantt-project-header-row {
    min-height: 36px;
    height: 36px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    box-sizing: border-box;
}

.gantt-sidebar-row {
    display: grid;
    grid-template-columns: 1fr 70px 70px;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    cursor: move;
    transition: background var(--transition-fast);
    align-items: center;
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.gantt-sidebar-row:hover {
    background: var(--action-bg-hover);
}

.gantt-draggable-row {
    user-select: none;
}

.gantt-draggable-row.gantt-dragging {
    opacity: 0.5;
}

.gantt-draggable-row.gantt-drag-over-top {
    border-top: 2px solid var(--primary);
}

.gantt-draggable-row.gantt-drag-over-bottom {
    border-bottom: 2px solid var(--primary);
}

.gantt-cell-task {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: var(--text-primary);
}

.gantt-cell-project {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    color: var(--gantt-project-color);
}

.gantt-cell-priority,
.gantt-cell-status {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-timeline-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gantt-timeline-toolbar {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* Gantt Pill Tabs */
.gantt-pill-tabs {
    display: flex;
    background: var(--bg-tertiary);
    padding: 3px;
    border-radius: var(--radius-md);
    gap: 2px;
}

.pill-tab {
    padding: 4px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.pill-tab:hover {
    color: var(--text-primary);
}

.pill-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.toolbar-divider {
    width: 1px;
    height: 16px;
    background: var(--border-color);
    margin: 0 var(--spacing-xs);
}

.gantt-timeline-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.gantt-day-header {
    padding: var(--spacing-sm) 0;
    text-align: center;
    border-right: 1px solid var(--border-light);
}

.gantt-day-header.weekend {
    background: rgba(0, 0, 0, 0.04);
    color: #7c8a9a;
}

.gantt-day-header.weekend.today {
    background: var(--primary-light);
    color: var(--primary);
}

.gantt-day-header.today {
    background: var(--primary-light);
    color: var(--primary);
}

.gantt-timeline-grid-wrap {
    flex: 1;
    min-height: 0;
    min-width: 0;
    position: relative;
}

.gantt-timeline-grid {
    position: relative;
    width: 100%;
    height: auto;
    /* 100% 대신 auto로 변경하여 내용만큼 늘어나게 함 */
    min-height: 320px;
}

.gantt-connectors {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 10; /* Ensure lines are visible above the grid */
    display: block !important;
}

.gantt-connector-group {
    pointer-events: auto;
    cursor: default;
    visibility: visible !important;
}

.gantt-connector-group path.connector-line {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    opacity: 0.6;
    transition: stroke 0.2s, stroke-width 0.2s, opacity 0.2s;
}

/* 프로젝트 상세페이지 간트 차트의 의존성 선 - 선택/호버 시에만 빨간색 */
#project-detail-gantt-connectors .gantt-connector-group path.connector-line {
    stroke: var(--text-muted);
    opacity: 0.6;
}

#project-detail-gantt-connectors .gantt-connector-group:hover path.connector-line,
#project-detail-gantt-connectors .gantt-connector-group.selected path.connector-line {
    stroke: var(--accent-red);
    stroke-width: 2.5;
    opacity: 1;
}

.gantt-connector-group path.connector-hitarea {
    fill: none;
    stroke: transparent;
    stroke-width: 10;
    cursor: pointer;
}

.gantt-connector-group:hover path.connector-line {
    stroke: var(--accent-red);
    stroke-width: 2.5;
    opacity: 1;
}

/* Sequence Connections (nextTaskId) */
.gantt-connector-group.sequence-connector path.connector-line {
    stroke: var(--primary);
    stroke-width: 2.5;
    opacity: 0.8;
}

.gantt-connector-group.sequence-connector:hover path.connector-line,
.gantt-connector-group.sequence-connector.selected path.connector-line {
    stroke: var(--primary-dark, #2563eb);
    stroke-width: 3.5;
    opacity: 1;
}

.gantt-connector-delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.gantt-connector-group:hover .gantt-connector-delete-btn {
    opacity: 1;
}

.gantt-connector-delete-btn circle {
    fill: var(--accent-red);
}

.gantt-connector-delete-btn text {
    fill: white;
    font-size: 10px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.gantt-grid-row {
    display: flex;
    position: relative;
    min-height: 36px;
    height: 36px;
    border-bottom: 1px solid var(--border-light);
    box-sizing: border-box;
}

.gantt-grid-row.gantt-dragging {
    opacity: 0.5;
}

.gantt-grid-row.gantt-drag-over-top {
    border-top: 2px solid var(--primary);
}

.gantt-grid-row.gantt-drag-over-bottom {
    border-bottom: 2px solid var(--primary);
}

.gantt-grid-background {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    pointer-events: none;
    z-index: 0;
}

.gantt-track {
    /* Removed individual cell rendering per row for performance */
    display: none;
}

.gantt-cell {
    border-right: 1px solid var(--border-light);
    flex-shrink: 0;
    height: 100%;
    /* Full height for background cells */
    box-sizing: border-box;
}

.gantt-cell.weekend {
    background: rgba(0, 0, 0, 0.03);
}

.gantt-cell.sat {
    background-color: rgba(59, 130, 246, 0.05);
    /* Blue-50 equivalent */
}

.gantt-cell.sun {
    background-color: rgba(239, 68, 68, 0.05);
    /* Red-50 equivalent */
}

.gantt-day-header.sat {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.gantt-day-header.sun {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed #3b82f6;
    opacity: 0.85;
    pointer-events: none;
    z-index: 5;
}

.gantt-bar-wrap {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}

.gantt-bar-wrap .gantt-bar {
    pointer-events: auto;
}

.gantt-bar {
    position: absolute;
    top: 6px;
    bottom: 6px;
    height: auto;
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-sm);
    overflow: hidden;
}

.gantt-bar:active {
    cursor: grabbing;
}

.gantt-bar-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.gantt-bar-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    flex-shrink: 0;
}

.gantt-bar-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.gantt-bar-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.9;
}

.gantt-bar-badge.priority-badge {
    background: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}

.gantt-bar-badge.status-badge {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.gantt-bar:hover {
    opacity: 0.9;
    transform: scaleY(1.05);
}

.gantt-bar:hover .gantt-connector-handle {
    opacity: 1;
}

.gantt-connector-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: crosshair;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.gantt-connector-handle-start {
    left: -5px;
}

.gantt-connector-handle-end {
    right: -5px;
}

.gantt-temp-connector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.gantt-temp-line {
    stroke: var(--primary);
    stroke-width: 2;
    stroke-dasharray: 4;
}

.gantt-bar.drag-target {
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: 2px solid var(--primary);
}

.gantt-bar-pending {
    background: var(--accent-blue);
    opacity: 0.75;
}

.gantt-bar-progress {
    background: var(--accent-green);
    opacity: 0.85;
}

.gantt-bar-done {
    background: var(--text-muted);
    opacity: 0.6;
}

/* ============================================
   Workflow Path Highlight
   ============================================ */
.workflow-path-highlight {
    opacity: 1 !important;
    filter: brightness(1.2) saturate(1.3);
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(var(--primary-rgb, 55, 136, 216), 0.4) !important;
    z-index: 10;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.workflow-path-dimmed {
    opacity: 0.3 !important;
    filter: grayscale(0.5);
    transition: all 0.2s ease;
}

.gantt-connector-group.workflow-path-highlight path.connector-line {
    stroke: var(--primary) !important;
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 4px rgba(var(--primary-rgb, 55, 136, 216), 0.6));
}

.gantt-connector-group.workflow-path-dimmed {
    opacity: 0.2 !important;
}

.gantt-sidebar-row.workflow-path-highlight {
    background: var(--primary-light) !important;
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.gantt-sidebar-row.workflow-path-dimmed {
    opacity: 0.3;
}

/* ============================================
   Workflow Diagram View
   ============================================ */
.workflow-diagram-container {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.workflow-diagram-container.workflow-diagram-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    padding: var(--spacing-md);
    background: var(--bg-primary);
}

.workflow-diagram-svg-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    overflow: hidden;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-radius: var(--radius-md);
}

.workflow-diagram-container.workflow-diagram-fullscreen .workflow-diagram-svg-wrapper {
    border-radius: var(--radius-sm);
}

.workflow-diagram-svg {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
    user-select: none;
    display: block;
    cursor: default;
}

.workflow-diagram-zoom-controls {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-level-indicator {
    padding: 0 var(--spacing-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

.zoom-level-text {
    color: var(--text-primary);
}

.workflow-diagram-node {
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-diagram-node:hover {
    filter: brightness(1.1);
}

.workflow-diagram-node.workflow-node-dragging {
    opacity: 0.8;
    filter: brightness(1.2);
    z-index: 1000;
}

.workflow-diagram-node.workflow-node-dragging rect {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.workflow-node-bg {
    fill: var(--bg-card);
    stroke: var(--border-color);
    stroke-width: 2;
    transition: all 0.2s ease;
}

.workflow-node-bg:hover {
    stroke: var(--primary);
    stroke-width: 3;
    filter: drop-shadow(0 4px 8px rgba(var(--primary-rgb, 55, 136, 216), 0.3));
}

.workflow-node-pending {
    fill: rgba(255, 193, 7, 0.1);
    stroke: var(--accent-yellow);
}

.workflow-node-progress {
    fill: rgba(55, 136, 216, 0.1);
    stroke: var(--accent-blue);
}

.workflow-node-done {
    fill: rgba(108, 117, 125, 0.1);
    stroke: var(--text-muted);
    opacity: 0.7;
}

.workflow-node-bg.completed {
    opacity: 0.6;
}

.workflow-node-title {
    font-size: 13px;
    font-weight: 600;
    fill: var(--text-primary);
    cursor: pointer;
    pointer-events: none;
}

.workflow-node-meta {
    font-size: 11px;
    fill: var(--text-muted);
    pointer-events: none;
}

.workflow-node-progress {
    transition: width 0.3s ease;
}

.workflow-node-bottleneck {
    animation: bottleneck-pulse 2s ease-in-out infinite;
}

.workflow-node-bottleneck-indicator {
    animation: bottleneck-blink 1s ease-in-out infinite;
}

@keyframes bottleneck-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes bottleneck-blink {

    0%,
    100% {
        opacity: 1;
        r: 6;
    }

    50% {
        opacity: 0.5;
        r: 8;
    }
}

.workflow-bottleneck-notification {
    position: relative;
    margin: var(--spacing-md);
    max-width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--accent-red);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.workflow-bottleneck-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    color: var(--accent-red);
}

.workflow-bottleneck-header i {
    color: var(--accent-red);
}

.workflow-bottleneck-close {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.workflow-bottleneck-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.workflow-bottleneck-list {
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.workflow-bottleneck-item {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: var(--spacing-xs);
}

.workflow-bottleneck-item:hover {
    background: var(--bg-tertiary);
}

.workflow-bottleneck-task-title {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.workflow-bottleneck-reason {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.workflow-diagram-connector {
    stroke: var(--text-secondary);
    stroke-width: 3;
    fill: none;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.workflow-diagram-connector:hover {
    stroke: var(--primary);
    stroke-width: 4;
    opacity: 1;
}

.workflow-diagram-view-toggle {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-xs);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.workflow-view-btn {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-view-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.workflow-view-btn.active {
    background: var(--action-bg);
    color: var(--text-primary);
    border-color: var(--action-border);
}

.gantt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-2xl);
    min-height: 320px;
    text-align: center;
}

.gantt-empty.hidden {
    display: none !important;
}

.gantt-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ============================================
   15. Admin User Management View
   ============================================ */
.admin-toolbar {
    background: var(--bg-card);
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.admin-stats-bar {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Glass Stat Cards - Refined for Admin */
.card.glass-card {
    background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

[data-theme="dark"] .card.glass-card {
    background: rgba(31, 31, 31, 0.7);
    border-color: #333;
}

.stat-value-sm {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.card-title-sm {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-header.mini {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Status Badges - Translucent Premium Look */
.status-badge {
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}

.status-badge.approved {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.2);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Table Refinements */
table tr {
    transition: background var(--transition-fast);
}

table tr:hover {
    background: var(--bg-tertiary);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

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

.role-select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.role-select:hover {
    border-color: var(--primary);
}

.action-btn-group {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.gantt-empty-text {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

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

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

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

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

.align-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.w-full {
    width: 100%;
}

/* Skeleton Loader Styles */
.skeleton {
    background-color: var(--border-light);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.2) 20%,
            rgba(255, 255, 255, 0.5) 60%,
            rgba(255, 255, 255, 0));
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
    display: inline-block;
}

[data-theme="dark"] .skeleton {
    background-color: var(--action-bg);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.05) 20%,
            rgba(255, 255, 255, 0.1) 60%,
            rgba(255, 255, 255, 0));
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: 1rem;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    width: 100%;
}

.skeleton-item {
    height: 60px;
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

/* Dashboard Widget Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.dashboard-widget {
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.widget-wide {
    grid-column: span 4;
}

.widget-stat {
    grid-column: span 1;
}

.widget-medium {
    grid-column: span 2;
}

/* Edit Mode styling */
.dashboard-grid.editing .dashboard-widget {
    cursor: grab;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    position: relative;
    padding: 2px;
}

.dashboard-grid.editing .dashboard-widget:active {
    cursor: grabbing;
}

.dashboard-grid.editing .dashboard-widget::before {
    content: '⇅ Drag to reorder';
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--primary);
    color: var(--text-inverse);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 20;
    pointer-events: none;
    opacity: 0.8;
}

.dashboard-widget.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.dashboard-widget.drag-over {
    border-color: var(--primary-color);
    background-color: var(--action-bg);
}

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

    .widget-wide {
        grid-column: span 2;
    }
}

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

    .widget-wide,
    .widget-medium,
    .widget-stat {
        grid-column: span 1;
    }
}

/* ============================================
   Template Management Styles
   ============================================ */
.templates-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.template-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.template-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.template-info {
    flex: 1;
    min-width: 0;
}

.template-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.template-title {
    font-size: 14px;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
    font-weight: 500;
}

.template-description {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.5;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.template-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

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

.template-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* ============================================
   Bottom Notification Announcer (Premium)
   ============================================ */
.bottom-announcer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
    min-width: 320px;
    opacity: 0;
    pointer-events: none;
}

.bottom-announcer.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.bottom-announcer.hidden {
    display: none;
}

.announcer-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.announcer-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.announcer-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: nowrap;
}

.announcer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    margin-left: 8px;
}

.announcer-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Priority Styles */
.bottom-announcer.priority-info {
    border-left: 4px solid var(--accent-blue);
}

.bottom-announcer.priority-warning {
    border-left: 4px solid var(--accent-yellow);
}

.bottom-announcer.priority-danger {
    border-left: 4px solid var(--accent-red);
}

[data-theme="dark"] .bottom-announcer {
    background: rgba(31, 31, 31, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Pulse for vital alerts */
@keyframes announcer-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(124, 58, 237, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
    }
}

.bottom-announcer.vital {
    animation: announcer-pulse 2s infinite;
    border: 1px solid var(--accent-purple);
}