/* ============================================
   AUTAB APP - Themeable Dashboard
   ============================================ */

:root {
    --sidebar-bg: #0f1117;
    --sidebar-hover: #1a1d2a;
    --sidebar-active: #242840;
    --bg: #14161f;
    --bg-card: #1c1f2e;
    --bg-elevated: #252840;
    --bg-input: #161929;
    --primary: #00B4D8;
    --primary-light: #33c5e3;
    --primary-dark: #0096b7;
    --text: #f0f1f5;
    --text-secondary: #b0b5c8;
    --text-muted: #8e95b0;
    --text-link: #33c5e3;
    --border: #3a3f58;
    --border-light: #333752;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: all 0.2s ease;
    --sidebar-width: 252px;
    --sidebar-collapsed: 64px;
    /* Extended dark theme vars */
    --scrollbar-thumb: #404568;
    --input-border: #4a5070;
    --input-focus-border: #00B4D8;
    --scrollbar-hover: #4a4f6a;
    --login-bg: linear-gradient(135deg, #0a0c12 0%, #0f1117 40%, #14161f 100%);
    --login-input-bg: #0f1117;
    --login-placeholder: #4a4f6a;
    --sticky-bg: #181b28;
    --sticky-hover-bg: #242840;
    --sticky-editing-bg: #1f2235;
    --logo-text-color: #fff;
    --sidebar-btn-color: #7b82a0;
    --sidebar-btn-hover: #e8eaf0;
    --sidebar-btn-icon: #9ea3b8;
    --sidebar-border-alpha: rgba(255,255,255,0.1);
    --sidebar-btn-border: rgba(255,255,255,0.08);
    --sidebar-btn-hover-bg: rgba(0,180,216,0.08);
    --user-welcome-color: #8e95b0;
    --user-name-color: #e8eaf0;
    --nav-section-color: #6a708a;
    --nav-item-color: #b0b5c8;
    --nav-item-hover-color: #e8eaf0;
    --nav-item-active-color: #e8eaf0;
    --nav-icon-color: #ffffff;
    --email-small-color: #8e95b0;
    --overlay-bg: rgba(0,0,0,0.7);
    --hover-overlay: rgba(0,180,216,0.04);
    --hover-overlay-light: rgba(0,180,216,0.06);
    --hover-overlay-medium: rgba(0,180,216,0.08);
    --table-border-alpha: #3a3f58;
    --pipeline-th-bg: rgba(0,0,0,0.2);
    --page-info-color: #ffffff;
    --card-hover-shadow: 0 8px 24px rgba(0,0,0,0.3);
    --fp-shadow: -4px 0 20px rgba(0,0,0,0.4);
    --drag-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f3f4f6;
    --sidebar-active: #eef0f4;
    --bg: #f5f6fa;
    --bg-card: #ffffff;
    --bg-elevated: #e8e9f0;
    --bg-input: #f7f8fa;
    --primary: #6366F1;
    --primary-light: #6366F1;
    --primary-dark: #4F46E5;
    --text: #1a1a2e;
    --text-secondary: #3a3a4a;
    --text-muted: #6a6a7a;
    --text-link: #4F46E5;
    --border: #d0d2da;
    --border-light: #ecedf2;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --info: #2563EB;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    /* Extended light theme vars */
    --scrollbar-thumb: #b0b0bc;
    --scrollbar-hover: #a8a8b4;
    --login-bg: linear-gradient(135deg, #e8eaf0 0%, #f0f1f5 40%, #f5f6fa 100%);
    --login-input-bg: #f0f1f5;
    --login-placeholder: #a0a0b0;
    --sticky-bg: #e8e9f0;
    --sticky-hover-bg: #dfe0e8;
    --sticky-editing-bg: #eae8f5;
    --logo-text-color: #1a1a2e;
    --sidebar-btn-color: #8a8a9a;
    --sidebar-btn-hover: #4a4a5a;
    --sidebar-btn-icon: #6a6a7a;
    --sidebar-border-alpha: rgba(0,0,0,0.08);
    --sidebar-btn-border: rgba(0,0,0,0.12);
    --sidebar-btn-hover-bg: rgba(0,0,0,0.04);
    --user-welcome-color: #8a8a9a;
    --user-name-color: #2a2a3e;
    --nav-section-color: #6a6a7a;
    --nav-item-color: #3a3a4a;
    --nav-item-hover-color: #2a2a3e;
    --nav-item-active-color: #1a1a2e;
    --nav-icon-color: #4a4a5a;
    --email-small-color: #8a8a9a;
    --overlay-bg: rgba(0,0,0,0.3);
    --hover-overlay: rgba(0,0,0,0.02);
    --hover-overlay-light: rgba(0,0,0,0.05);
    --hover-overlay-medium: rgba(0,0,0,0.08);
    --table-border-alpha: rgba(0,0,0,0.14);
    --pipeline-th-bg: rgba(0,0,0,0.07);
    --page-info-color: #1a1a2e;
    --card-hover-shadow: 0 8px 24px rgba(0,0,0,0.08);
    --fp-shadow: -4px 0 20px rgba(0,0,0,0.08);
    --drag-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    min-width: 0;
}

.hidden { display: none !important; }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--login-bg);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 44px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo { text-align: center; margin-bottom: 32px; }

.login-icon-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 16px;
    display: block;
}

.login-logo-img {
    max-width: 180px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 6px;
    display: block;
}

.logo-icon-large {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px; color: white;
}

.login-logo h1 { font-size: 26px; font-weight: 700; color: var(--text); }
.login-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

.login-card .form-group { margin-bottom: 18px; }

.login-card label {
    display: block; font-size: 11px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.8px;
}

.login-card input,
.login-card select {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    background: var(--login-input-bg);
    color: var(--text);
    transition: var(--transition);
}

.login-card input::placeholder {
    color: var(--login-placeholder);
}

.login-card input:focus, .login-card select:focus {
    outline: none; border-color: #00B4D8; border-width: 2px;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.3);
    background: var(--login-input-bg);
}

.btn-login {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: var(--transition); margin-top: 6px;
}
.btn-login:hover { opacity: 0.9; }

.login-hint { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 14px; }

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container { display: flex; min-height: 100vh; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 8px; left: 8px; bottom: 8px;
    z-index: 100;
    transition: width 0.25s ease;
    border-right: 1px solid var(--border-light);
    border-radius: 12px;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-logo-img,
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-info-bottom,
.sidebar.collapsed .user-status,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-toggle-btn span { display: none; }
.sidebar.collapsed .sidebar-header { flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; }
.sidebar.collapsed .logo { justify-content: center; }
.sidebar.collapsed .user-profile-bottom { justify-content: center; padding: 8px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; position: relative; }
.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}
.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
}
.sidebar.collapsed .nav-item i { margin: 0; }
.sidebar.collapsed .sidebar-toggle-btn { justify-content: center; width: 28px; height: 28px; margin: 0 auto; }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--sidebar-border-alpha);
}

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

.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: white; flex-shrink: 0;
}

.logo-text { font-size: 20px; font-weight: 700; color: var(--logo-text-color); letter-spacing: -0.3px; }

.sidebar-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo-img {
    max-width: 100px;
    height: 20px;
    object-fit: contain;
}

.sidebar-collapse-btn {
    background: none; border: none; color: var(--sidebar-btn-color);
    cursor: pointer; padding: 4px; font-size: 14px;
    border-radius: 4px; transition: var(--transition);
}
.sidebar-collapse-btn:hover { color: var(--sidebar-btn-hover); background: var(--sidebar-btn-hover-bg); }
.sidebar-collapse-btn i { transition: transform 0.25s ease; }

.sidebar-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    padding: 0; border-radius: var(--radius-sm);
    background: none; border: 1px solid var(--sidebar-btn-border);
    color: var(--sidebar-btn-color); cursor: pointer; font-size: 14px;
    transition: var(--transition);
}
.sidebar-toggle-btn:hover { background: var(--sidebar-btn-hover-bg); color: var(--sidebar-btn-hover); }
.sidebar-toggle-btn span { display: none; }
.sidebar-toggle-btn i { font-size: 14px; color: var(--sidebar-btn-icon); flex-shrink: 0; }

/* User Profile */
.user-profile {
    padding: 18px 16px;
    border-bottom: 1px solid var(--sidebar-border-alpha);
    text-align: center;
}

.user-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #818CF8);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: white;
    margin: 0 auto 8px;
    border: 2px solid var(--sidebar-border-alpha);
}

.user-welcome { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--user-welcome-color); }
.user-name { display: block; font-size: 14px; font-weight: 600; color: var(--user-name-color); margin-top: 1px; }

.user-status {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px; padding: 4px 12px;
    border-radius: 16px; background: rgba(99,102,241,0.12);
    font-size: 11px; font-weight: 500; color: var(--primary-light);
}

.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

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

/* Sidebar Nav */
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar.collapsed .sidebar-nav { overflow: visible; }

.nav-section-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--nav-section-color);
    padding: 10px 10px 6px;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--nav-item-color); text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: var(--transition); margin-bottom: 1px;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--nav-item-hover-color); }
.nav-item.active { background: var(--sidebar-active); color: var(--nav-item-active-color); }

/* SIDEBAR ICONS: Always white */
.nav-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; color: var(--nav-icon-color) !important; }
.nav-item.active i { color: var(--nav-icon-color) !important; }
.nav-item:hover i { color: var(--nav-icon-color) !important; }

.sidebar-footer { padding: 8px; border-top: 1px solid var(--sidebar-border-alpha); margin-top: auto; }

.user-profile-bottom {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 4px;
    border-radius: var(--radius-sm);
}
.user-profile-bottom .user-avatar {
    width: 36px; height: 36px; font-size: 13px;
    margin: 0; flex-shrink: 0;
}
.user-info-bottom { display: flex; flex-direction: column; min-width: 0; }
.user-info-bottom .user-name { font-size: 13px; font-weight: 600; color: var(--user-name-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email-small { font-size: 11px; color: var(--email-small-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.logout { color: #e57373; }
.nav-item.logout:hover { background: rgba(239,68,68,0.1); color: #ef9a9a; }
.nav-item.logout i { color: #e57373 !important; }
.nav-item.logout:hover i { color: #ef9a9a !important; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: calc(var(--sidebar-width) + 16px);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    overflow-x: hidden;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width) - 16px);
}

.sidebar.collapsed ~ .main-content { margin-left: calc(var(--sidebar-collapsed) + 16px); max-width: calc(100vw - var(--sidebar-collapsed) - 16px); }

/* Top Bar */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    display: none; background: none; border: none;
    font-size: 18px; color: var(--text-secondary); cursor: pointer;
}

.page-title { font-size: 18px; font-weight: 600; color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.topbar-btn {
    background: none; border: none; font-size: 16px;
    color: var(--text-muted); cursor: pointer;
    position: relative; padding: 6px; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.topbar-btn:hover { color: var(--text); background: var(--bg-elevated); }

.notification-dot {
    position: absolute; top: 4px; right: 4px;
    width: 7px; height: 7px; background: var(--danger);
    border-radius: 50%; border: 1.5px solid var(--bg);
}

.topbar-user {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; border-radius: var(--radius-sm);
}

.topbar-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
}

.topbar-user span { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* ============================================
   PAGES
   ============================================ */
.page { display: none; padding: 24px; animation: fadeIn 0.2s ease; overflow: visible; min-width: 0; max-width: 100%; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ============================================
   DASHBOARD
   ============================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; align-items: center; gap: 16px;
}

.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.stat-icon.blue { background: rgba(99,102,241,0.12); color: #818CF8; }
.stat-icon.green { background: rgba(16,185,129,0.12); color: #34D399; }
.stat-icon.orange { background: rgba(245,158,11,0.12); color: #FBBF24; }
.stat-icon.purple { background: rgba(139,92,246,0.12); color: #A78BFA; }

.stat-number { display: block; font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-secondary); }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; min-width: 0; }

.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-header a { font-size: 12px; color: var(--text-link); text-decoration: none; }
.card-badge { font-size: 11px; color: var(--text-muted); background: var(--bg-elevated); padding: 3px 10px; border-radius: 12px; }

.project-list { padding: 12px 20px; }
.project-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.project-item:last-child { border-bottom: none; }
.project-color { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.project-color.blue { background: var(--primary); }
.project-color.green { background: var(--success); }
.project-color.orange { background: var(--warning); }
.project-name { font-size: 13px; font-weight: 600; display: block; }
.project-meta { font-size: 11px; color: var(--text-muted); }
.project-progress { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.project-progress span { font-size: 12px; font-weight: 600; color: var(--text-secondary); min-width: 32px; }

.progress-bar { width: 80px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.5s ease; }

.activity-list { padding: 12px 20px; }
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.blue { background: var(--primary); }
.activity-dot.green { background: var(--success); }
.activity-dot.orange { background: var(--warning); }
.activity-content p { font-size: 13px; }
.activity-time { font-size: 11px; color: var(--text-muted); }

/* ============================================
   PROJECTS PAGE
   ============================================ */
.page-actions { margin-bottom: 20px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.project-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    position: relative; overflow: hidden;
}
.project-card-stripe { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.project-card-title { font-size: 15px; font-weight: 600; }
.priority-badge { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
.priority-badge.high { background: rgba(245,158,11,0.12); color: #FBBF24; }
.priority-badge.medium { background: rgba(59,130,246,0.12); color: #60A5FA; }
.priority-badge.low { background: rgba(16,185,129,0.12); color: #34D399; }
.priority-badge.critical { background: rgba(239,68,68,0.12); color: #F87171; }
.project-card-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.project-card-meta { display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
.project-card-meta i { margin-right: 4px; }
.project-card-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.project-card-progress .progress-bar { flex: 1; }
.project-card-progress span { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; }
.avatar-stack { display: flex; }
.mini-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: white;
    margin-left: -6px; border: 2px solid var(--bg-card);
}
.mini-avatar:first-child { margin-left: 0; }

/* ============================================
   DATABASE PAGE
   ============================================ */

/* Views Bar */
.db-views-bar {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px; flex-wrap: wrap; overflow: visible;
    padding: 10px 14px;
    border: 1px solid #4a5078;
    border-radius: var(--radius);
    background: var(--bg-card);
}

.btn-save-view {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; background: var(--bg-elevated);
    border: 1px solid #4a5078; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 12px; font-weight: 500;
    cursor: pointer; font-family: inherit; transition: var(--transition);
}
.btn-save-view:hover { color: var(--text); border-color: var(--primary); }

.views-dropdown-wrapper { position: relative; }
.views-dropdown {
    padding: 7px 12px; background: var(--bg-input);
    border: 1px solid #4a5078; border-radius: var(--radius-sm);
    color: var(--text); font-size: 12px; font-family: inherit;
    cursor: pointer; min-width: 180px;
}
.views-dropdown:focus { outline: none; border-color: #00B4D8; border-width: 2px; box-shadow: 0 0 0 2px rgba(0,180,216,0.2); }

.btn-delete-view {
    background: none; border: 1px solid #4a5078;
    border-radius: var(--radius-sm); padding: 7px 10px;
    color: var(--text-muted); cursor: pointer; font-size: 12px;
    transition: var(--transition);
}
.btn-delete-view:hover { color: var(--danger); border-color: var(--danger); }

/* Database Toolbar */
.db-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
    min-width: 0; overflow: visible;
    padding: 10px 14px;
    border: 1px solid #4a5078;
    border-radius: var(--radius);
    background: var(--bg-card);
}
.db-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.db-toolbar-right { display: flex; align-items: center; gap: 12px; }

.db-search {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; background: var(--bg-input);
    border: 1px solid #4a5078; border-radius: var(--radius-sm);
    min-width: 220px;
}
.db-search i { color: var(--text-muted); font-size: 13px; }
.db-search input {
    background: none; border: none; color: var(--text);
    font-size: 13px; font-family: inherit; outline: none; flex: 1;
}
.db-search input::placeholder { color: var(--text-muted); }

.db-filter-group { display: flex; align-items: center; gap: 8px; }
.db-filter-group label { font-size: 12px; color: var(--text); font-weight: 500; white-space: nowrap; }

.multi-select-wrapper { position: relative; }
.multi-select-display {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 12px; background: var(--bg-input);
    border: 1px solid #4a5078; border-radius: var(--radius-sm);
    color: var(--text); font-size: 12px; cursor: pointer;
    min-width: 140px;
}
.multi-select-display i { font-size: 10px; color: var(--text-muted); margin-left: auto; }

.multi-select-dropdown {
    position: absolute; top: 100%; left: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-top: 4px;
    z-index: 30; box-shadow: var(--shadow-lg);
    max-height: 200px; overflow-y: auto; overflow-x: hidden;
    min-width: 100%; width: max-content;
}
.ms-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-size: 12px; color: var(--text);
    cursor: pointer; transition: background 0.1s;
    white-space: nowrap;
}
.ms-option:hover { background: var(--hover-overlay-light); }
.ms-option input { accent-color: var(--primary); }

.db-tool-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; background: var(--bg-elevated);
    border: 1px solid #4a5078; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 12px; font-weight: 500;
    cursor: pointer; font-family: inherit; transition: var(--transition);
}
.db-tool-btn:hover { color: var(--text); border-color: var(--primary); }

/* Rows per page */
.rows-per-page {
    display: flex; align-items: center; gap: 6px;
}
.rows-per-page label {
    font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap;
}
.rows-per-page select {
    padding: 6px 10px;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid #4a5078;
    border-radius: var(--radius-sm);
    font-size: 12px; font-family: inherit;
    cursor: pointer;
}
.rows-per-page select:focus { outline: none; border-color: #00B4D8; border-width: 2px; box-shadow: 0 0 0 2px rgba(0,180,216,0.2); }

.db-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Table Wrapper - horizontal scroll for non-frozen columns */
.db-table-wrapper {
    border: 1px solid #4a5078;
    border-radius: var(--radius);
    overflow-x: auto;
    overflow-y: visible;
    background: var(--bg-card);
    position: relative;
}

/* Table */
.db-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    min-width: 900px;
}

.db-table thead { position: sticky; top: 0; z-index: 5; }

.db-table th {
    padding: 10px 14px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-secondary);
    background: var(--sticky-bg);
    border-bottom: 2px solid #4a5078;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.db-table th:hover { color: var(--text-secondary); }
.db-table th.sorted { color: var(--primary-light); }
.sort-icon { font-size: 9px; margin-left: 4px; opacity: 0.5; }
.db-table th.sorted .sort-icon { opacity: 1; }

/* Frozen columns: checkbox + actions + name */
.db-table th.col-checkbox,
.db-table td.col-checkbox {
    position: sticky;
    left: 0;
    z-index: 4;
    background: var(--sticky-bg);
    width: 36px;
    min-width: 36px;
}
.db-table tbody td.col-checkbox {
    background: var(--bg-card);
}

.db-table th.col-actions,
.db-table td.col-actions {
    position: sticky;
    left: 36px;
    z-index: 4;
    background: var(--sticky-bg);
    width: 60px;
    min-width: 60px;
}
.db-table tbody td.col-actions {
    background: var(--bg-card);
}

.db-table th.col-name,
.db-table td.col-name {
    position: sticky;
    left: 96px;
    z-index: 4;
    background: var(--sticky-bg);
    min-width: 160px;
    font-weight: 600;
    border-right: 2px solid var(--border);
}
.db-table tbody td.col-name {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text);
}

/* Table body */
.db-table td {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid var(--table-border-alpha);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-table tbody tr { transition: background 0.15s ease; }
.db-table tbody tr:hover td { background: #252a42; border-left: none; }
.db-table tbody tr:hover > td:first-child { border-left: 3px solid #00B4D8; }
.db-table tbody tr:hover td.col-checkbox,
.db-table tbody tr:hover td.col-actions,
.db-table tbody tr:hover td.col-name { background: #2a3050; }

/* Editing row highlight */
.db-table tbody tr.editing-row td { background: rgba(0,180,216,0.06); }
.db-table tbody tr.editing-row td.col-checkbox,
.db-table tbody tr.editing-row td.col-actions,
.db-table tbody tr.editing-row td.col-name { background: var(--sticky-editing-bg); }

/* Cell editable highlight */
.cell-editable {
    cursor: text !important;
    border: 1px dashed rgba(99,102,241,0.3) !important;
    border-radius: 3px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.cell-editable:hover {
    background: rgba(99,102,241,0.06) !important;
    border-color: rgba(99,102,241,0.5) !important;
}

/* Action buttons */
.action-btn {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    padding: 4px 6px; border-radius: 4px;
    font-size: 12px; transition: var(--transition);
}
.action-btn:hover { color: var(--text); background: var(--bg-elevated); }

/* Company Profile Page */
.company-profile-page { padding: 0; }
.company-profile-header {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 0; border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.company-profile-header h2 { margin: 0; font-size: 20px; color: var(--text); }
.btn-back {
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-muted); padding: 8px 14px; border-radius: 6px;
    cursor: pointer; font-size: 13px; transition: var(--transition);
    display: flex; align-items: center; gap: 6px;
}
.btn-back:hover { color: var(--text); border-color: var(--primary); }
.company-profile-content {
    display: flex; justify-content: center; align-items: center;
    min-height: 300px;
}
.empty-state { text-align: center; }
.action-btn.save-btn { color: var(--success); }
.action-btn.save-btn:hover { background: rgba(16,185,129,0.1); }
.action-btn.edit-btn:hover { color: var(--primary-light); }
.action-btn.profile-btn:hover { color: var(--info); }

/* Name cell */
.cell-name-content {
    display: flex; align-items: center; gap: 8px;
}
.company-icon {
    width: 22px; height: 22px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: white; flex-shrink: 0;
}

.cell-email-badge, .cell-phone-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 500;
}
.cell-email-badge { background: transparent; color: var(--text); }
.cell-phone-badge { background: transparent; color: var(--text); }

.db-filter-badge {
    display: inline-flex; padding: 2px 8px;
    border-radius: 4px; font-size: 11px; font-weight: 500;
    background: rgba(99,102,241,0.12); color: var(--primary-light);
}

/* Last Status Date column */
.last-status-date { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.days-ago { color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* Status badge colors */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.status-badge:hover { opacity: 0.85; }
.status-badge .status-history-icon { font-size: 9px; opacity: 0.6; }

.status-potencijalni { background: rgba(107,114,128,0.2); color: #b0b5c4; }
.status-novi-dopis { background: rgba(59,130,246,0.2); color: #7db8ff; }
.status-1-feedback { background: rgba(139,92,246,0.2); color: #bea4ff; }
.status-2-feedback { background: rgba(168,85,247,0.2); color: #d4a0ff; }
.status-3-feedback { background: rgba(192,132,252,0.2); color: #e0c4ff; }
.status-4-feedback { background: rgba(217,70,239,0.2); color: #f09dff; }
.status-otvorena-komunikacija { background: rgba(245,158,11,0.2); color: #fcc94d; }
.status-odraden-sastanak { background: rgba(249,115,22,0.2); color: #ffa857; }
.status-investor { background: rgba(16,185,129,0.2); color: #4fe8a8; }
.status-nije-zainteresiran { background: rgba(239,68,68,0.2); color: #ff8a8a; }

/* Checkbox */
.db-table input[type="checkbox"] {
    accent-color: #00B4D8;
    cursor: pointer;
    width: 16px; height: 16px;
}
.db-table input[type="checkbox"]:not(:checked) {
    appearance: none; -webkit-appearance: none;
    border: 2px solid #4a4f6a;
    background: #1c1f2e;
    border-radius: 3px;
}
.db-table input[type="checkbox"]:not(:checked):hover {
    border-color: #00B4D8;
}
.db-table input[type="checkbox"]:checked {
    accent-color: #00B4D8;
}

/* Pagination */
.db-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; margin-top: 8px;
}
.db-page-info { font-size: 12px; color: var(--page-info-color); }
.pagination-btns { display: flex; gap: 3px; }
.pag-btn, .pg-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--page-info-color);
    font-size: 12px; cursor: pointer; transition: var(--transition);
}
.pag-btn:hover:not(:disabled), .pg-btn:hover:not(:disabled) { background: var(--primary); color: white; border-color: var(--primary); }
.pag-btn.active, .pg-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.pag-btn:disabled, .pg-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Access Restricted */
.access-restricted { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.access-restricted i { font-size: 44px; color: var(--text-muted); margin-bottom: 14px; }
.access-restricted h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }

/* ============================================
   ROW ENTER ANIMATION (filter transitions)
   ============================================ */
@keyframes rowEnter {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.row-enter {
    animation: rowEnter 0.25s ease forwards;
    opacity: 0;
}

/* Row fade-out for filtering */
@keyframes rowExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

.row-exit {
    animation: rowExit 0.2s ease forwards;
}

/* ============================================
   NOTIFICATIONS PAGE
   ============================================ */
.notifications-page { max-width: 700px; }

.notifications-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.notifications-header h3 {
    font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.notifications-header h3 i { color: var(--primary-light); }

.btn-sm { padding: 6px 12px; font-size: 11px; }

.notifications-list { display: flex; flex-direction: column; gap: 6px; }

.notification-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}
.notification-item:hover { background: var(--bg-elevated); }
.notification-item.unread { border-left: 3px solid var(--primary); }

.notif-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.notif-icon.blue { background: rgba(99,102,241,0.12); color: #818CF8; }
.notif-icon.green { background: rgba(16,185,129,0.12); color: #34D399; }
.notif-icon.orange { background: rgba(245,158,11,0.12); color: #FBBF24; }
.notif-icon.purple { background: rgba(139,92,246,0.12); color: #A78BFA; }

.notif-content p { font-size: 13px; color: var(--text); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

/* ============================================
   FIELDS PANEL (right slide-out)
   ============================================ */
.fields-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 320px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    z-index: 150;
    display: flex; flex-direction: column;
    box-shadow: var(--fp-shadow);
    animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

.fields-panel-title { display: flex; align-items: center; gap: 10px; }
.fields-panel-title h3 { font-size: 16px; font-weight: 600; }

.fp-back, .fp-close {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; font-size: 16px; padding: 4px;
    border-radius: 4px; transition: var(--transition);
}
.fp-back:hover, .fp-close:hover { color: var(--text); background: var(--hover-overlay-medium); }

.fields-panel-info {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    font-size: 12px; color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

.fields-panel-list {
    flex: 1; overflow-y: auto; padding: 8px 0;
}

.field-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    position: relative;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    cursor: grab;
    border: 2px solid transparent;
    border-radius: 6px;
    user-select: none;
}
.field-item:hover { background: var(--hover-overlay-light); }

/* Drag and drop states */
.field-item.dragging {
    opacity: 0.9;
    background: var(--bg-elevated);
    box-shadow: var(--drag-shadow);
    border-color: var(--primary);
    transform: scale(1.02);
    z-index: 10;
    cursor: grabbing;
}

.field-item.drag-over-top {
    border-top-color: var(--primary-light);
    padding-top: 24px;
}
.field-item.drag-over-top::before {
    content: '';
    position: absolute;
    top: 0; left: 18px; right: 18px;
    height: 2px;
    background: var(--primary-light);
    border-radius: 1px;
}

.field-item.drag-over-bottom {
    border-bottom-color: var(--primary-light);
    padding-bottom: 24px;
}
.field-item.drag-over-bottom::after {
    content: '';
    position: absolute;
    bottom: 0; left: 18px; right: 18px;
    height: 2px;
    background: var(--primary-light);
    border-radius: 1px;
}

.field-drag-placeholder {
    height: 44px;
    margin: 4px 10px;
    border: 2px dashed var(--primary);
    border-radius: 6px;
    background: rgba(99,102,241,0.06);
    transition: height 0.2s ease;
}

.field-drag-handle { color: var(--text-muted); font-size: 12px; cursor: grab; padding: 4px 2px; }
.field-drag-handle:hover { color: var(--text-secondary); }
.field-icon { color: var(--text-muted); font-size: 13px; width: 18px; text-align: center; }
.field-label { flex: 1; font-size: 13px; color: var(--text); font-weight: 500; }

.field-eye {
    background: none; border: none;
    color: var(--warning); font-size: 12px; cursor: pointer;
    padding: 2px; border-radius: 3px; transition: var(--transition);
}
.field-eye:hover { color: var(--text); }

.field-remove {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 12px; padding: 2px;
    transition: var(--transition);
}
.field-remove:hover { color: var(--danger); }

/* Fields Apply Bar */
.fields-panel-apply {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: rgba(99,102,241,0.06);
    animation: fadeIn 0.2s ease;
}
.btn-apply-fields {
    width: 100%;
    justify-content: center;
}

.fields-panel-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

/* ============================================
   SAVE/DISCARD MODAL
   ============================================ */
.modal-save-discard { max-width: 560px; }

.changes-list {
    display: flex; flex-direction: column; gap: 12px;
}

.change-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex; flex-direction: column; gap: 6px;
}

.change-field-name, .change-field {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-muted);
}

.change-values {
    display: flex; gap: 12px; align-items: center;
}

.change-old {
    flex: 1;
    padding: 6px 10px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 4px;
    font-size: 13px; color: #F87171;
    text-decoration: line-through;
    word-break: break-word;
}

.change-arrow {
    color: var(--text-muted); font-size: 14px; flex-shrink: 0;
}

.change-new {
    flex: 1;
    padding: 6px 10px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 4px;
    font-size: 13px; color: #34D399;
    word-break: break-word;
}

.btn-discard {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: rgba(239,68,68,0.1);
    color: #F87171;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-discard:hover { background: rgba(239,68,68,0.2); }

/* ============================================
   STATUS HISTORY MODAL
   ============================================ */
.modal-status-history { max-width: 520px; }

.status-history-container {
    padding: 4px 0;
}

.status-history-contact {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.status-contact-info {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.status-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: white; flex-shrink: 0;
}

.new-status-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.new-status-section h4 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 12px;
}

.status-form { display: flex; flex-direction: column; gap: 10px; }

.form-row-inline {
    display: flex; align-items: center; gap: 10px;
}
.form-row-inline label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    min-width: 60px;
}
.form-row-inline select,
.form-row-inline input[type="date"] {
    flex: 1; padding: 7px 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 13px; font-family: inherit;
}
.form-row-inline select:focus,
.form-row-inline input:focus { outline: none; border-color: #00B4D8; border-width: 2px; box-shadow: 0 0 0 3px rgba(0,180,216,0.25); }

.btn-today {
    padding: 6px 12px; background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 11px; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-today:hover { color: var(--text); border-color: var(--primary); }

.status-save-confirm {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.2s ease;
}
.status-save-confirm span {
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
}
.status-save-confirm .btn-yes {
    padding: 5px 12px; font-size: 11px; font-weight: 600;
    border-radius: 4px; cursor: pointer; font-family: inherit;
    border: none; transition: var(--transition);
    background: var(--primary); color: white;
}
.status-save-confirm .btn-yes:hover { background: var(--primary-light); }
.status-save-confirm .btn-no {
    padding: 5px 12px; font-size: 11px; font-weight: 600;
    border-radius: 4px; cursor: pointer; font-family: inherit;
    border: none; transition: var(--transition);
    background: rgba(239,68,68,0.15); color: #F87171;
}
.status-save-confirm .btn-no:hover { background: rgba(239,68,68,0.25); }

.status-readonly-msg {
    padding: 12px; background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-secondary);
    margin-bottom: 16px;
}
.status-readonly-msg i { margin-right: 6px; color: var(--primary-light); }

.status-history-section h4 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 12px;
}

.status-timeline { padding-top: 4px; }

.timeline-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 8px 0;
    position: relative;
}
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 11px; top: 32px; bottom: -8px;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; flex-shrink: 0;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    color: var(--text-muted);
    z-index: 1;
}
.timeline-dot.active { border-color: #00B4D8; color: #33c5e3; background: rgba(0,180,216,0.1); }

.timeline-content { flex: 1; padding-top: 1px; }
.timeline-status { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }
.timeline-user { font-size: 10px; color: var(--text-muted); display: block; margin-top: 1px; }

.timeline-item.current .timeline-dot {
    border-color: #00B4D8;
    background: rgba(0,180,216,0.15);
    color: #33c5e3;
}

/* ============================================
   PROFILE MODAL
   ============================================ */
.modal-profile { max-width: 700px; }

.profile-header {
    display: flex; align-items: center; gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.profile-avatar, .profile-avatar-lg {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: white;
    flex-shrink: 0;
    border: 3px solid var(--sidebar-border-alpha);
}

.profile-main-info h2, .profile-name-section h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.profile-main-info .profile-title, .profile-name-section p { font-size: 14px; color: var(--text-secondary); }
.profile-main-info .profile-company { font-size: 13px; color: var(--primary-light); margin-top: 2px; }

.profile-tabs {
    display: flex; gap: 0; margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.profile-tab {
    padding: 8px 16px;
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border: none; background: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.profile-tab:hover { color: var(--text-secondary); }
.profile-tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }

.profile-detail-grid, .profile-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.profile-detail-item, .profile-field {}
.profile-detail-label, .profile-field label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; display: block; }
.profile-detail-value, .profile-field span { font-size: 14px; color: var(--text); word-break: break-word; display: block; }
.profile-detail-value a { color: var(--text-link); text-decoration: none; }
.profile-detail-value a:hover { text-decoration: underline; }
.profile-detail-full { grid-column: 1 / -1; }

.profile-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted);
    padding: 16px 0 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
    grid-column: 1 / -1;
}

.profile-tab-content { }
.profile-tab-content.hidden { display: none; }

/* ============================================
   ADD FIELD - DROPDOWN OPTIONS
   ============================================ */
.form-label-sm {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-muted); margin: 14px 0 8px;
}

.dropdown-opt-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
}

.dd-opt-input {
    flex: 1; padding: 7px 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 13px; font-family: inherit;
}
.dd-opt-input:focus { outline: none; border-color: #00B4D8; border-width: 2px; box-shadow: 0 0 0 3px rgba(0,180,216,0.25); }

.dd-opt-remove {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 12px; padding: 4px;
    transition: var(--transition);
}
.dd-opt-remove:hover { color: var(--danger); }

.btn-add-option {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 10px; margin-top: 4px;
    background: none; border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 11px;
    cursor: pointer; font-family: inherit;
    transition: var(--transition);
}
.btn-add-option:hover { color: var(--primary-light); border-color: var(--primary); }

/* ============================================
   ROLES PAGE
   ============================================ */
.roles-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; }

.role-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    position: relative; overflow: hidden;
}
.role-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.role-card.superadmin::before { background: linear-gradient(90deg, #6366F1, #818CF8); }
.role-card.admin::before { background: linear-gradient(90deg, #0EA5E9, #38BDF8); }
.role-card.user::before { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }

.role-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.role-header i { font-size: 20px; }
.role-card.superadmin .role-header i { color: #818CF8; }
.role-card.admin .role-header i { color: #38BDF8; }
.role-card.user .role-header i { color: #A78BFA; }
.role-header h3 { font-size: 16px; font-weight: 600; }

.role-permissions { list-style: none; margin-bottom: 16px; }
.role-permissions li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
.role-permissions li:last-child { border-bottom: none; }
.role-permissions li .fa-check { color: var(--success); }
.role-permissions li .fa-times { color: var(--danger); }
.role-users-count { font-size: 12px; color: var(--text-muted); }

/* ============================================
   SETTINGS PAGE
   ============================================ */
/* ============================================
   SETTINGS PAGE - Split Layout
   ============================================ */
.settings-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    gap: 0;
}

/* Settings Sidebar */
.settings-sidebar {
    width: 180px;
    min-width: 180px;
    background: transparent;
    border-right: 1px solid var(--border);
    padding: 24px 0;
    overflow-y: auto;
}

.settings-nav-section {
    margin-bottom: 4px;
    padding-bottom: 4px;
}
.settings-nav-section + .settings-nav-section {
    border-top: 1px solid var(--border-light);
    padding-top: 4px;
}

.settings-nav-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 14px 20px 6px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.settings-nav-item:hover {
    color: var(--text);
    background: var(--hover-overlay-light);
}

.settings-nav-item.active {
    color: var(--primary-light);
    background: rgba(99,102,241,0.08);
    border-left-color: var(--primary);
}

.settings-nav-item i {
    display: none;
}

/* Settings Content */
.settings-content {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.settings-panel {
    display: none;
    animation: settingsFadeIn 0.25s ease;
}

.settings-panel.active {
    display: block;
}

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

.settings-panel-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.settings-panel-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.settings-panel-header h3 i {
    margin-right: 10px;
    color: var(--primary-light);
}

.settings-panel-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 28px 0;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.settings-form-grid .form-group { margin-bottom: 0; }
.settings-form-grid .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-form-grid input,
.settings-form-grid select {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    background: var(--bg-input); color: var(--text);
    transition: border-color 0.2s ease;
}

.settings-form-grid input:focus,
.settings-form-grid select:focus {
    outline: none;
    border-color: #00B4D8; border-width: 2px;
    box-shadow: 0 0 0 3px rgba(0,180,216,0.25);
}

.settings-form-grid input:disabled,
.settings-form-grid select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Settings Toggle List (Notification settings) */
.settings-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

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

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

.settings-toggle-info {
    flex: 1;
}

.settings-toggle-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.settings-toggle-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 16px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: all 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.25s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Settings Empty State */
.settings-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.settings-empty-state i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.settings-empty-state p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.settings-empty-state .text-muted {
    font-size: 13px;
}

/* Filter Manager */
.filter-manager-list {
    margin-bottom: 16px;
}

.filter-manager-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.15s ease;
}

.filter-manager-item:hover {
    border-color: var(--border);
    background: var(--bg-elevated);
}

.filter-manager-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.filter-manager-item-count {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(99,102,241,0.1);
    padding: 2px 10px;
    border-radius: 12px;
}

.filter-manager-item-actions {
    display: flex;
    gap: 8px;
}

.filter-manager-item-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    transition: color 0.15s ease;
}

.filter-manager-item-actions button:hover {
    color: var(--danger);
}

.filter-manager-add {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.filter-manager-add input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text);
}

.filter-manager-add input:focus {
    outline: none;
    border-color: #00B4D8; border-width: 2px;
    box-shadow: 0 0 0 3px rgba(0,180,216,0.25);
}

/* Threshold Table */
.btn-threshold-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-threshold-add:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.filter-apply-checkboxes {
    display: flex;
    gap: 20px;
    margin-top: 6px;
}

.filter-apply-checkboxes .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.filter-apply-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00B4D8;
    cursor: pointer;
}

.threshold-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-threshold-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-threshold-edit:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-threshold-edit.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-threshold-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--success);
    color: white;
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.4;
    pointer-events: none;
}

.btn-threshold-save:not([disabled]) {
    opacity: 1;
    pointer-events: auto;
}

.btn-threshold-save:not([disabled]):hover {
    background: #059669;
}

.threshold-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.threshold-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.threshold-table thead th {
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.threshold-table thead th:last-child {
    border-right: none;
}

.threshold-table thead th.th-filter-name {
    text-align: left;
    min-width: 150px;
    border-right: 1px solid var(--border);
}

.threshold-table thead th.th-group-contact {
    border-bottom: 1px solid var(--border);
    color: var(--primary-light);
    font-size: 12px;
}

.threshold-table thead th.th-group-company {
    border-bottom: 1px solid var(--border);
    color: var(--warning);
    font-size: 12px;
}

.threshold-table thead th.th-sub {
    font-size: 11px;
    padding: 6px 6px;
    min-width: 45px;
}

.threshold-table tbody tr {
    border-bottom: 1px solid var(--table-border-alpha);
    transition: background 0.15s ease;
}

.threshold-table tbody tr:hover {
    background: var(--hover-overlay-light);
}

.threshold-table tbody tr:last-child {
    border-bottom: none;
}

.threshold-table tbody td {
    padding: 7px 8px;
    color: var(--text);
    border-right: 1px solid var(--table-border-alpha);
    text-align: center;
    vertical-align: middle;
}

.threshold-table tbody td:last-child {
    border-right: none;
}

.threshold-table tbody td.td-filter-name {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    border-right: 1px solid var(--border);
}

.threshold-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #4a5070;
    border-radius: 4px;
    cursor: default;
    transition: var(--transition);
    font-size: 13px;
}

.threshold-check.checked {
    background: var(--primary);
    color: white;
}

.threshold-check.checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
}

.threshold-check.unchecked {
    background: #1c1f2e;
    border: 2px solid #5a6080;
    color: transparent;
}

.threshold-table.editing .threshold-check {
    cursor: pointer;
}

.threshold-table.editing .threshold-check.unchecked:hover {
    border-color: #00B4D8;
    background: rgba(0,180,216,0.15);
}

.threshold-table.editing .threshold-check.checked:hover {
    background: var(--danger);
}

/* Import Upload Area */
/* ==================== IMPORT WIZARD ==================== */
/* Step Indicator */
.import-steps,
.settings-panel .import-steps,
.settings-panel.active .import-steps {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 16px 0 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid #4a5078;
    border-radius: var(--radius);
}
.import-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}
.import-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(30,33,48,0.9);
    border: 2px solid #5a6080;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #9ea3b8;
    transition: all 0.3s ease;
}
.import-step-label {
    font-size: 10px;
    color: #7b82a0;
    font-weight: 500;
    transition: color 0.3s ease;
}
.import-step.active .import-step-num {
    background: #00B4D8;
    border-color: #00B4D8;
    color: #fff;
}
.import-step.active .import-step-label {
    color: var(--primary-light);
}
.import-step.completed .import-step-num {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.import-step.completed .import-step-num::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 12px;
}
.import-step.completed .import-step-label {
    color: var(--success);
}
.import-step-line {
    flex: 1;
    height: 2px;
    background: #4a5078;
    margin: 0 6px;
    margin-bottom: 20px;
    min-width: 20px;
}

/* Step Panels */
.import-panel {
    animation: fadeIn 0.3s ease;
}
.import-panel.hidden {
    display: none;
}

/* Step 1: Upload Box */
.import-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px;
    background: var(--bg-card);
    border: 2px dashed #4a5078;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 480px;
    margin: 0 auto;
}
.import-upload-box:hover, .import-upload-box.dragover {
    border-color: #00B4D8;
    background: rgba(0,180,216,0.04);
}
.import-upload-box.dragover {
    border-color: #33c5e3;
    box-shadow: 0 0 20px rgba(0,180,216,0.15);
}
.import-upload-box > i {
    font-size: 32px;
    color: #00B4D8;
    margin-bottom: 10px;
    opacity: 0.8;
}
.import-upload-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.import-upload-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.import-choose-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #00B4D8;
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.import-choose-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.import-upload-formats {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* File Info */
.import-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 16px;
}
.import-file-info.hidden { display: none; }
.import-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(16,185,129,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    font-size: 18px;
}
.import-file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.import-file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.import-file-size {
    font-size: 11px;
    color: var(--text-muted);
}
.import-file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
}
.import-file-remove:hover {
    color: var(--danger);
}

/* Template Hint */
.import-template-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius);
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}
.import-template-hint i {
    color: var(--primary);
    margin-top: 1px;
}
.import-template-hint a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Step Actions */
.import-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* Step 2: Column Mapping */
.import-mapping-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.import-mapping-table-wrap {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}
.import-mapping-table {
    width: 100%;
    border-collapse: collapse;
}
.import-mapping-table th {
    background: var(--bg-card);
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}
.import-mapping-table td {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid var(--table-border-alpha);
}
.mapping-col-name {
    font-weight: 600;
}
.mapping-sample {
    color: var(--text-muted) !important;
    font-size: 12px !important;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mapping-select {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    width: 100%;
    max-width: 200px;
}
.mapping-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.mapping-status.status-ok {
    background: rgba(16,185,129,0.12);
    color: var(--success);
}
.mapping-status.status-new {
    background: rgba(245,158,11,0.12);
    color: var(--warning);
}
.mapping-status.status-skip {
    background: rgba(107,107,120,0.12);
    color: var(--text-muted);
}

/* New Columns Alert */
.import-new-cols-alert {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: var(--radius);
    margin-top: 16px;
}
.import-new-cols-alert.hidden { display: none; }
.import-alert-icon {
    color: var(--warning);
    font-size: 20px;
    margin-top: 2px;
}
.import-alert-content {
    flex: 1;
}
.import-alert-content strong {
    font-size: 13px;
    color: var(--text);
}
.import-alert-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.import-alert-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* DB Select */
.import-db-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.import-db-select label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.import-db-select select {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-width: 180px;
}
.import-db-or {
    font-size: 12px;
    color: var(--text-muted);
}
.btn-outline-sm {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-outline-sm:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}
.import-new-db-input {
    background: var(--bg-main);
    border: 1px solid var(--primary);
    color: var(--text);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 180px;
}
.import-new-db-input.hidden { display: none; }

/* Step 3: Analysis */
.import-analysis-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.import-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 20px;
}
.import-stat-card {
    padding: 20px 16px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}
.import-stat-card.stat-total { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.2); }
.import-stat-card.stat-new { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); }
.import-stat-card.stat-dup { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }
.import-stat-card.stat-err { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
.import-stat-num {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.stat-total .import-stat-num { color: var(--primary-light); }
.stat-new .import-stat-num { color: var(--success); }
.stat-dup .import-stat-num { color: var(--warning); }
.stat-err .import-stat-num { color: var(--danger); }
.import-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Duplicates Section */
.import-dup-section {
    margin-top: 24px;
}
.import-dup-section.hidden { display: none; }
.import-dup-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.import-dup-section h5 i { color: var(--warning); }
.import-dup-actions-bar {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary-light); }
.btn-accept-all { border-color: rgba(16,185,129,0.3); color: var(--success); }
.btn-accept-all:hover { background: rgba(16,185,129,0.1); }
.btn-ignore-all { border-color: rgba(239,68,68,0.3); color: var(--danger); }
.btn-ignore-all:hover { background: rgba(239,68,68,0.1); }

.import-dup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.import-dup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 16px;
}
.import-dup-info { flex: 1; }
.import-dup-match {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.import-dup-match i { color: var(--warning); margin-right: 4px; }
.import-dup-compare {
    display: flex;
    gap: 24px;
}
.import-dup-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.import-dup-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.import-dup-value {
    font-size: 13px;
    color: var(--text);
}
.import-dup-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.btn-dup-accept {
    border-color: rgba(16,185,129,0.3);
    color: var(--text-secondary);
}
.btn-dup-accept.active, .btn-dup-accept:hover {
    background: rgba(16,185,129,0.15);
    border-color: var(--success);
    color: var(--success);
}
.btn-dup-ignore {
    border-color: rgba(239,68,68,0.3);
    color: var(--text-secondary);
}
.btn-dup-ignore.active, .btn-dup-ignore:hover {
    background: rgba(239,68,68,0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* Errors Section */
.import-err-section { margin-top: 20px; }
.import-err-section.hidden { display: none; }
.import-err-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.import-err-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.import-err-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(239,68,68,0.06);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}
.import-err-item i { color: var(--danger); }

/* Step 4: Confirmation */
.import-confirm-box {
    text-align: center;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.import-confirm-box > i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}
.import-confirm-box h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}
.import-confirm-summary {
    max-width: 360px;
    margin: 0 auto 24px;
    text-align: left;
}
.import-confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--table-border-alpha);
}
.import-confirm-row strong {
    color: var(--text);
}
.import-confirm-row.total {
    font-size: 14px;
    font-weight: 600;
}
.import-confirm-row.total span, .import-confirm-row.total strong {
    color: var(--primary-light);
}
.import-confirm-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.import-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}
.btn-lg {
    padding: 12px 28px !important;
    font-size: 14px !important;
}

/* Step 5: Result */
.import-result-box {
    text-align: center;
    padding: 40px 32px;
}
.import-result-icon {
    font-size: 56px;
    color: var(--success);
    margin-bottom: 16px;
}
.import-result-box h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}
.import-result-stats {
    max-width: 320px;
    margin: 0 auto;
}
.import-result-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--table-border-alpha);
}
.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}
.stat-value {
    font-size: 14px;
    font-weight: 700;
}
.stat-value.success { color: var(--success); }
.stat-value.info { color: var(--info); }
.stat-value.danger { color: var(--danger); }
.import-result-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius);
    margin-top: 20px;
    font-size: 12px;
    color: var(--warning);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
.import-result-notice.hidden { display: none; }

/* Button styles for import */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.theme-option {
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
    width: 200px;
}
.theme-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.theme-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.theme-preview {
    display: flex;
    height: 120px;
    overflow: hidden;
}
.theme-preview-sidebar {
    width: 40px;
    flex-shrink: 0;
}
.theme-preview-content {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.theme-preview-topbar {
    height: 10px;
    border-radius: 3px;
}
.theme-preview-cards {
    display: flex;
    gap: 6px;
    flex: 1;
}
.theme-preview-card {
    flex: 1;
    border-radius: 4px;
}

/* Dark preview */
.theme-preview-dark {
    background: #242429;
}
.theme-preview-dark .theme-preview-sidebar {
    background: #1a1a1f;
}
.theme-preview-dark .theme-preview-topbar {
    background: #303038;
}
.theme-preview-dark .theme-preview-card {
    background: #2a2a31;
    border: 1px solid #35353e;
}

/* Light preview */
.theme-preview-light {
    background: #f5f6fa;
}
.theme-preview-light .theme-preview-sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e4ea;
}
.theme-preview-light .theme-preview-topbar {
    background: #e2e4ea;
}
.theme-preview-light .theme-preview-card {
    background: #ffffff;
    border: 1px solid #e2e4ea;
}

.theme-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    border-top: 1px solid var(--border);
}
.theme-option-label i {
    font-size: 14px;
    color: var(--primary);
}

/* Legacy support */
.settings-form { padding: 20px; }
.settings-form .form-group { margin-bottom: 16px; }
.settings-form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.settings-form input,
.settings-form select {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    background: var(--bg-input); color: var(--text);
}
.settings-form input:focus,
.settings-form select:focus { outline: none; border-color: #00B4D8; border-width: 2px; box-shadow: 0 0 0 3px rgba(0,180,216,0.25); }
.settings-form input:disabled,
.settings-form select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: var(--primary); color: white;
    border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-light); }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: var(--bg-elevated); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-secondary:hover { background: var(--border); }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(3px);
    z-index: 200;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.show, .modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); width: 100%; max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-close {
    background: none; border: none; font-size: 16px;
    color: var(--text-muted); cursor: pointer;
    padding: 4px; border-radius: 4px; transition: var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--hover-overlay-medium); }

.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }

.modal-body .form-group { margin-bottom: 16px; }
.modal-body label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.modal-body input, .modal-body select, .modal-body textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit;
    background: var(--bg-input); color: var(--text);
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { outline: none; border-color: #00B4D8; border-width: 2px; box-shadow: 0 0 0 3px rgba(0,180,216,0.25); }
.modal-body textarea { resize: vertical; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); width: var(--sidebar-width); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .content-grid { grid-template-columns: 1fr; }
    .db-toolbar { flex-direction: column; align-items: stretch; }
    .db-toolbar-left, .db-toolbar-right { flex-wrap: wrap; }
    .db-search { min-width: 100%; }
    .fields-panel { width: 100%; }
    .db-views-bar { flex-wrap: wrap; }
}


/* ============================================
   PRODUCTION ADDITIONS
   ============================================ */
.login-error {
    color: var(--danger); font-size: 13px; text-align: center;
    margin-bottom: 12px; padding: 8px;
    background: rgba(239,68,68,0.1); border-radius: var(--radius-sm);
}
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.nav-badge {
    background: var(--danger); color: white;
    font-size: 10px; padding: 2px 6px; border-radius: 10px;
    margin-left: auto; font-weight: 600;
}

.users-table-wrapper {
    overflow-x: auto; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-card);
}
.users-table-wrapper .db-table { min-width: 700px; }
.users-table-wrapper .db-table th,
.users-table-wrapper .db-table td { position: static; }

.role-badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 12px; font-size: 11px; font-weight: 600;
}
.role-badge.super_admin { background: rgba(245,158,11,0.15); color: #FBBF24; }
.role-badge.admin { background: rgba(99,102,241,0.15); color: #818CF8; }
.role-badge.user { background: rgba(16,185,129,0.15); color: #34D399; }

.status-badge-user {
    display: inline-block; padding: 3px 10px;
    border-radius: 12px; font-size: 11px; font-weight: 600;
}
.status-badge-user.active { background: rgba(16,185,129,0.15); color: #34D399; }
.status-badge-user.inactive { background: rgba(239,68,68,0.15); color: #F87171; }
.status-badge-user.pending { background: rgba(245,158,11,0.15); color: #FBBF24; }

.checkbox-group {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.checkbox-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text); cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm); border: 1px solid #4a4f6a;
}
.checkbox-group label:hover { border-color: #00B4D8; }
.checkbox-group input[type="checkbox"] {
    accent-color: #00B4D8;
    width: 16px; height: 16px;
}
.checkbox-group input[type="checkbox"]:not(:checked) {
    appearance: none; -webkit-appearance: none;
    border: 2px solid #4a4f6a;
    background: #1c1f2e;
    border-radius: 3px;
}
.checkbox-group input[type="checkbox"]:not(:checked):hover {
    border-color: #00B4D8;
}
.checkbox-group input[type="checkbox"]:checked {
    accent-color: #00B4D8;
}

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

.btn-icon {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px 6px; border-radius: 4px;
    font-size: 13px; transition: var(--transition);
}
.btn-icon:hover { color: var(--text); background: var(--bg-elevated); }
.btn-icon.danger:hover { color: var(--danger); }

.db-filter-tag {
    display: inline-block; padding: 2px 8px;
    background: rgba(99,102,241,0.12); color: var(--primary-light);
    border-radius: 4px; font-size: 11px; margin: 1px;
}

#importResult.success { color: var(--success); }
#importResult.error { color: var(--danger); }

/* ============================================
   REGISTER & FORGOT PASSWORD
   ============================================ */
.login-tabs {
    display: flex; gap: 0; margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.login-tab {
    flex: 1; padding: 10px; text-align: center;
    background: none; border: none; color: var(--text-muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.login-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }
.login-tab:hover { color: var(--text); }

.login-form-section { display: none; }
.login-form-section.active { display: block; }

.forgot-password-link {
    display: block; text-align: right;
    color: var(--text-link); font-size: 12px;
    text-decoration: none; margin-top: -10px; margin-bottom: 14px;
}
.forgot-password-link:hover { text-decoration: underline; }

.register-success, .reset-success {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--success); padding: 12px; border-radius: var(--radius-sm);
    font-size: 13px; text-align: center; margin-top: 12px;
}
.register-pending {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    color: var(--warning); padding: 12px; border-radius: var(--radius-sm);
    font-size: 13px; text-align: center;
}

/* Pending users in Users & Roles */
.pending-users-section { margin-bottom: 24px; }
.pending-users-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--warning); }
.pending-user-card {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 8px;
}
.pending-user-info { display: flex; flex-direction: column; gap: 2px; }
.pending-user-info .name, .pending-user-info strong { font-weight: 600; color: var(--text); font-size: 14px; }
.pending-user-info .email, .pending-user-info span { color: var(--text-secondary); font-size: 12px; }
.pending-user-info .date { color: var(--text-muted); font-size: 11px; }
.pending-user-actions { display: flex; gap: 8px; align-items: center; }
.pending-user-actions select {
    padding: 5px 8px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 12px; font-family: inherit;
}
.btn-approve {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(16,185,129,0.15); color: var(--success);
    border: 1px solid rgba(16,185,129,0.3); border-radius: var(--radius-sm);
    padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-approve:hover { background: rgba(16,185,129,0.25); }
.btn-reject {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(239,68,68,0.15); color: var(--danger);
    border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-sm);
    padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-reject:hover { background: rgba(239,68,68,0.25); }

/* ============================================
   HORIZONTAL SCROLL FIX - Database Table
   ============================================ */
.db-table-wrapper {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.db-table-wrapper::-webkit-scrollbar { height: 8px; }
.db-table-wrapper::-webkit-scrollbar-track { background: var(--bg-card); border-radius: 4px; }
.db-table-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.db-table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   EXPORT BUTTON
   ============================================ */
/* Export dropdown */
.export-dropdown-wrapper { position: relative; }
.btn-export {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; background: rgba(16,185,129,0.12);
    color: var(--success); border: 1px solid rgba(16,185,129,0.25);
    border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: var(--transition);
}
.btn-export:hover { background: rgba(16,185,129,0.22); }
.btn-export i { font-size: 12px; }
.export-chevron { font-size: 9px !important; margin-left: 2px; opacity: 0.7; }

.export-dropdown {
    position: absolute; top: 100%; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-top: 4px;
    z-index: 30; box-shadow: var(--shadow-lg);
    min-width: 160px; overflow: hidden;
}
.export-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 16px;
    background: none; border: none;
    color: var(--text); font-size: 13px; font-family: inherit;
    cursor: pointer; transition: background 0.15s ease;
    text-align: left;
}
.export-option:hover { background: var(--hover-overlay-medium); }
.export-option i { color: var(--success); font-size: 14px; width: 16px; text-align: center; }
.export-option:not(:last-child) { border-bottom: 1px solid var(--border-light); }

/* View toggle buttons */
.view-toggle-group {
    display: inline-flex; border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
}
.view-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 32px;
    background: var(--bg-input); border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 14px; transition: var(--transition);
}
.view-toggle-btn:not(:last-child) { border-right: 1px solid var(--border); }
.view-toggle-btn:hover { color: var(--text); background: var(--bg-elevated); }
.view-toggle-btn.active {
    background: var(--primary); color: white;
}

/* ============================================
   USER PROFILE TAB - Card View
   ============================================ */
.profiles-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.profiles-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profiles-toolbar-right { display: flex; align-items: center; gap: 12px; }

.profiles-search {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    min-width: 220px;
}
.profiles-search i { color: var(--text-muted); font-size: 13px; }
.profiles-search input {
    border: none; background: none; color: var(--text);
    font-size: 13px; font-family: inherit; outline: none; width: 100%;
}

.profiles-filter-group {
    display: flex; align-items: center; gap: 6px;
}
.profiles-filter-group label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.profiles-filter-group select {
    padding: 7px 10px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 12px; font-family: inherit;
}

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

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.profile-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}
.profile-card-stripe {
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--primary);
}

.profile-card-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 14px;
}
.profile-card-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.profile-card-name {
    flex: 1; min-width: 0;
}
.profile-card-name h4 {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-card-name p {
    font-size: 12px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.profile-card-tags {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.profile-card-tag {
    display: inline-block; padding: 2px 8px;
    border-radius: 4px; font-size: 10px; font-weight: 600;
}
.profile-card-tag.status { background: rgba(99,102,241,0.12); color: var(--primary-light); }
.profile-card-tag.db { background: rgba(16,185,129,0.12); color: var(--success); }

.profile-card-details {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.profile-card-detail {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-secondary);
}
.profile-card-detail i {
    font-size: 11px; color: var(--text-muted); width: 14px; text-align: center;
}
.profile-card-detail span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.profile-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.profile-card-date {
    font-size: 11px; color: var(--text-muted);
}
.profile-card-date i { margin-right: 4px; }

.profiles-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; margin-top: 8px;
}

/* ============================================
   FULL-PAGE PROFILE VIEW
   ============================================ */
.profile-page {
    max-width: 900px; margin: 0 auto;
}
.profile-page-header {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 24px;
}
.profile-page-back {
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary); padding: 8px 12px;
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; font-family: inherit; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.profile-page-back:hover { border-color: var(--primary); color: var(--text); }

.profile-page-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; flex-shrink: 0;
}
.profile-page-info h2 {
    font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.profile-page-info p {
    font-size: 14px; color: var(--text-secondary);
}
.profile-page-status {
    margin-left: auto;
}

.profile-page-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.profile-page-tab {
    padding: 10px 20px; background: none; border: none;
    color: var(--text-muted); font-size: 13px; font-weight: 600;
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: var(--transition); font-family: inherit;
}
.profile-page-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }
.profile-page-tab:hover { color: var(--text); }

.profile-page-section { display: none; }
.profile-page-section.active { display: block; }

.profile-edit-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.profile-edit-field {
    display: flex; flex-direction: column; gap: 4px;
}
.profile-edit-field.full-width {
    grid-column: 1 / -1;
}
.profile-edit-field label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.profile-edit-field input,
.profile-edit-field select,
.profile-edit-field textarea {
    padding: 9px 12px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 13px; font-family: inherit;
    transition: var(--transition);
}
.profile-edit-field input:focus,
.profile-edit-field select:focus,
.profile-edit-field textarea:focus {
    outline: none;
    border-color: #00B4D8 !important; border-width: 2px;
    box-shadow: 0 0 0 3px rgba(0,180,216,0.25);
}
.profile-edit-field textarea { resize: vertical; min-height: 80px; }

.profile-edit-actions {
    display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end;
}

.profile-page-timeline {
    max-width: 600px;
}

/* No results */
.no-results {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
}
.no-results i { font-size: 40px; margin-bottom: 12px; display: block; opacity: 0.3; }
.no-results p { font-size: 14px; }

/* ============================================
   RESPONSIVE - Tablet (<=1024px)
   ============================================ */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .profiles-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .db-toolbar-left { flex-wrap: wrap; }
    .db-toolbar-right { flex-wrap: wrap; }
    .profiles-toolbar-left { flex-wrap: wrap; }
    .profiles-toolbar-right { flex-wrap: wrap; }
    .db-search { min-width: 180px; }
    .profiles-search { min-width: 180px; }
}

/* ============================================
   RESPONSIVE - Mobile (<=768px)
   ============================================ */
@media (max-width: 768px) {
    /* Sidebar: hide, show with toggle */
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 200;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }
    .menu-toggle { display: block; }

    /* Pages */
    .page { padding: 16px; overflow-x: auto; }

    /* Topbar */
    .topbar { padding: 10px 16px; }
    .topbar-user span { display: none; }

    /* Dashboard */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-number { font-size: 20px; }
    .content-grid { grid-template-columns: 1fr; }

    /* Database */
    .db-views-bar { flex-wrap: wrap; gap: 8px; }
    .db-toolbar { flex-direction: column; align-items: stretch; }
    .db-toolbar-left { flex-wrap: wrap; }
    .db-toolbar-right { flex-wrap: wrap; justify-content: flex-start; }
    .db-search { min-width: 100%; }
    .db-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .db-table { min-width: 600px; }
    .db-pagination { flex-wrap: wrap; gap: 8px; }

    /* Unstick frozen columns on mobile - let them scroll with table */
    .db-table td.col-checkbox,
    .db-table td.col-actions,
    .db-table td.col-name,
    .db-table th:nth-child(1),
    .db-table th:nth-child(2),
    .db-table th:nth-child(3) {
        position: static !important;
        min-width: auto !important;
    }
    .db-table td.col-checkbox { width: 28px !important; min-width: 28px !important; }
    .db-table td.col-actions { width: 40px !important; min-width: 40px !important; }
    .db-table td.col-name { min-width: 100px !important; border-right: none !important; }

    /* User Profiles */
    .profiles-grid { grid-template-columns: 1fr; }
    .profiles-toolbar { flex-direction: column; align-items: stretch; }
    .profiles-toolbar-left { flex-direction: column; }
    .profiles-toolbar-right { justify-content: flex-start; }
    .profiles-search { min-width: 100%; }

    /* Full-page profile */
    .profile-edit-grid { grid-template-columns: 1fr; }
    .profile-page-header { flex-wrap: wrap; gap: 12px; }
    .profile-page-status { margin-left: 0; }
    .profile-page-tabs { overflow-x: auto; flex-wrap: nowrap; }

    /* Projects */
    .projects-grid { grid-template-columns: 1fr; }

    /* Users & Roles */
    .roles-overview { grid-template-columns: 1fr; }
    .pending-user-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .pending-user-actions { width: 100%; }

    /* Fields panel */
    .fields-panel { width: 100%; }

    /* Modals */
    .modal-content { margin: 10px; max-height: 90vh; }
    .change-values { flex-direction: column; }
    .change-arrow { transform: rotate(90deg); }

    /* Settings */
    .profile-detail-grid, .profile-grid { grid-template-columns: 1fr; }

    /* Notifications */
    .notification-item { flex-direction: column; }

    /* Hide scrollbar on horizontal sub-menus */
    .settings-sidebar,
    .mkt-sidebar {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    .settings-sidebar::-webkit-scrollbar,
    .mkt-sidebar::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
}

/* ============================================
   PIPELINE ACCORDION
   ============================================ */
.pipeline-section {
    margin-top: 8px;
}

.pipeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pipeline-title i {
    color: var(--primary-light);
    font-size: 18px;
}

.pipeline-loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 14px;
}
.pipeline-loading i {
    margin-right: 8px;
}

.pipeline-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.pipeline-item:hover {
    border-color: var(--border-light);
}
.pipeline-item.open {
    border-color: var(--primary);
}

.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.pipeline-header:hover {
    background: var(--hover-overlay);
}

.pipeline-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pipeline-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pipeline-status-dot.novi-dopis { background: #3B82F6; }
.pipeline-status-dot.feedback-1 { background: #8B5CF6; }
.pipeline-status-dot.feedback-2 { background: #A78BFA; }
.pipeline-status-dot.feedback-3 { background: #C4B5FD; }
.pipeline-status-dot.feedback-4 { background: #DDD6FE; }
.pipeline-status-dot.komunikacija { background: #F59E0B; }
.pipeline-status-dot.sastanak { background: #10B981; }

.pipeline-status-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.pipeline-alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 2px;
}
.pipeline-alert-dot.green {
    background: #10B981;
    box-shadow: 0 0 4px rgba(16,185,129,0.5);
}
.pipeline-alert-dot.orange {
    background: #F59E0B;
    box-shadow: 0 0 6px rgba(245,158,11,0.6);
    animation: pulse-orange 1.5s ease-in-out infinite;
}
.pipeline-alert-dot.red {
    background: #EF4444;
    box-shadow: 0 0 8px rgba(239,68,68,0.7);
    animation: pulse-red 1.2s ease-in-out infinite;
}
@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 4px rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 10px rgba(245,158,11,0.8); }
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 4px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 12px rgba(239,68,68,0.9); }
}

.pipeline-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}
.pipeline-row-clickable:hover td {
    background: rgba(0,180,216,0.08) !important;
    color: var(--text) !important;
}
.pipeline-row-clickable:active td {
    background: rgba(0,180,216,0.15) !important;
}

.pipeline-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pipeline-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    background: rgba(99,102,241,0.12);
    color: var(--primary-light);
    font-size: 13px;
    font-weight: 700;
}

.pipeline-chevron {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.25s ease;
}
.pipeline-item.open .pipeline-chevron {
    transform: rotate(180deg);
}

.pipeline-body {
    display: none;
    border-top: 1px solid var(--border-light);
}
.pipeline-item.open .pipeline-body {
    display: block;
}

.pipeline-table {
    width: 100%;
    border-collapse: collapse;
}

.pipeline-table th {
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: var(--pipeline-th-bg);
    text-align: left;
    white-space: nowrap;
}

.pipeline-table td {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}
.pipeline-table tbody tr:last-child td {
    border-bottom: none;
}
.pipeline-table tbody tr:hover td {
    background: var(--hover-overlay);
}

.pipeline-name {
    font-weight: 600;
    color: var(--text);
}

.pipeline-company {
    color: var(--text-secondary);
}

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

.days-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.days-badge.green {
    background: rgba(16,185,129,0.15);
    color: #34D399;
}
.days-badge.orange {
    background: rgba(245,158,11,0.15);
    color: #FBBF24;
}
.days-badge.red {
    background: rgba(239,68,68,0.15);
    color: #F87171;
}

.pipeline-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.pipeline-table-wrapper {
    overflow-x: auto;
}

/* ============================================
   RESPONSIVE - Small Mobile (<=480px)
   ============================================ */
@media (max-width: 480px) {
    .page { padding: 12px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; }
    .stat-number { font-size: 18px; }
    .page-title { font-size: 16px; }
    .profile-page-avatar { width: 56px; height: 56px; font-size: 18px; }
    .profile-page-info h2 { font-size: 18px; }
    .profile-card { padding: 14px; }
    .profile-card-details { grid-template-columns: 1fr; }
    .login-card { padding: 30px 20px; }
}

/* ==================== COMPANY PROFILE PAGE ==================== */
.cp-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    gap: 0;
}

/* --- CP Sidebar (POVEZANO) --- */
.cp-sidebar {
    width: 200px;
    min-width: 200px;
    background: transparent;
    border-right: 1px solid var(--border);
    padding: 16px 0;
    transition: all 0.25s ease;
    overflow-y: auto;
}
.cp-sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    border-right: none;
    overflow: hidden;
}
.cp-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}
.cp-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}
.cp-sidebar-collapse {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}
.cp-sidebar-collapse:hover {
    color: var(--text);
    background: var(--hover-overlay-light);
}
.cp-sidebar.collapsed .cp-sidebar-header,
.cp-sidebar.collapsed .cp-sidebar-nav {
    display: none;
}

.cp-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cp-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.cp-nav-item:hover {
    color: var(--text);
    background: var(--hover-overlay-light);
}
.cp-nav-item.active {
    color: var(--primary-light);
    background: rgba(99,102,241,0.06);
    border-left-color: var(--primary);
    font-weight: 500;
}
.cp-nav-badge {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* --- CP Main Content --- */
.cp-main {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

/* --- CP Header Card --- */
.cp-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.cp-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.cp-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.cp-back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}
.cp-back-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: var(--hover-overlay-light);
}
.cp-company-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}
.cp-company-title h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}
.cp-company-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Header Actions */
.cp-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.cp-btn-edit {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.cp-btn-edit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.cp-btn-more {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}
.cp-btn-more:hover {
    color: var(--text);
    border-color: var(--text-muted);
}
.cp-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}
.cp-more-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}
.cp-more-menu a:hover {
    background: var(--hover-overlay-light);
    color: var(--text);
}
.cp-more-menu a i {
    width: 16px;
    text-align: center;
}

/* Header Details Grid */
.cp-header-details {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}
.cp-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 32px;
}
.cp-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cp-detail-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cp-detail-value {
    font-size: 13px;
    color: var(--text);
    font-weight: 400;
}
.cp-detail-value a {
    color: var(--primary-light);
    text-decoration: none;
}
.cp-detail-value a:hover {
    text-decoration: underline;
}

/* --- CP Tabs Bar --- */
.cp-tabs-bar {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}
.cp-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.cp-tab:hover {
    color: var(--text);
}
.cp-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}
.cp-tabs-spacer {
    flex: 1;
}
.cp-customize-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}
.cp-customize-btn:hover {
    color: var(--text);
    background: var(--hover-overlay-light);
}

/* --- CP Tab Content --- */
.cp-tab-content {
    display: none;
}
.cp-tab-content.active {
    display: block;
    animation: cpFadeIn 0.2s ease;
}
@keyframes cpFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- CP Sub-tabs --- */
.cp-subtabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}
.cp-subtab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.cp-subtab:hover {
    color: var(--text);
}
.cp-subtab.active {
    color: var(--text);
    border-bottom-color: var(--primary);
}
.cp-subtab i {
    font-size: 11px;
}

.cp-subtab-content {
    display: none;
}
.cp-subtab-content.active {
    display: block;
}

/* --- CP Comment Editor --- */
.cp-comment-editor {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.cp-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-main);
}
.cp-editor-toolbar button {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
}
.cp-editor-toolbar button:hover {
    color: var(--text);
    background: var(--hover-overlay-light);
}
.cp-toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}
.cp-editor-area {
    min-height: 100px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
    outline: none;
}
.cp-editor-area:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
}
.cp-editor-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-light);
}
.cp-btn-primary {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}
.cp-btn-primary:hover {
    filter: brightness(1.1);
}
.cp-btn-secondary {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary-light);
    padding: 7px 16px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}
.cp-btn-secondary:hover {
    background: rgba(99,102,241,0.1);
}

/* --- CP Comments List --- */
.cp-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cp-comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.cp-comment-item:last-child {
    border-bottom: none;
}
.cp-comment-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.cp-comment-icon.call { background: #e3f2fd; color: #1976d2; }
.cp-comment-icon.task { background: #fce4ec; color: #c62828; }
.cp-comment-icon.contact { background: #e8f5e9; color: #2e7d32; }
.cp-comment-icon.note { background: #f3e5f5; color: #7b1fa2; }
.cp-comment-icon.document { background: #fff3e0; color: #e65100; }
.cp-comment-body {
    flex: 1;
}
.cp-comment-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}
.cp-comment-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.cp-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}
.cp-comment-time {
    color: var(--primary-light);
    font-weight: 500;
}
.cp-comment-author {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}
.cp-comment-author-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- CP Section Empty --- */
.cp-section-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}
.cp-section-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    opacity: 0.4;
}
.cp-section-empty p {
    font-size: 13px;
}

/* --- CP Detail Sections (DETALJNO tab) --- */
.cp-detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}
.cp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}
.cp-section-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cp-section-title-row h4 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text);
    margin: 0;
}
.cp-add-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}
.cp-add-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}
.cp-section-count {
    font-size: 11px;
    color: var(--text-muted);
}
.cp-section-table {
    overflow-x: auto;
}
.cp-section-table .db-table {
    margin: 0;
    border-radius: 0;
}
.cp-section-table .db-table th {
    font-size: 11px;
    padding: 8px 12px;
}
.cp-section-table .db-table td {
    font-size: 12px;
    padding: 8px 12px;
}

/* Status badges in CP tables */
.cp-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.cp-status-badge.active { background: rgba(34,197,94,0.15); color: #22c55e; }
.cp-status-badge.pending { background: rgba(251,191,36,0.15); color: #fbbf24; }
.cp-status-badge.closed { background: rgba(239,68,68,0.15); color: #ef4444; }
.cp-status-badge.in-progress { background: rgba(59,130,246,0.15); color: #3b82f6; }

/* Progress bar in CP */
.cp-progress-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cp-progress-track {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.cp-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}
.cp-progress-text {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* --- CP Activity Log --- */
.cp-activity-log {
    padding: 12px 16px;
}
.cp-activity-entry {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.cp-activity-entry:last-child {
    border-bottom: none;
}

/* --- CP Expand Button for sidebar --- */
.cp-expand-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 4px;
    font-size: 12px;
    z-index: 10;
    display: none;
    transition: all 0.2s;
}
.cp-expand-btn:hover {
    color: var(--text);
    background: var(--hover-overlay-light);
}
.cp-sidebar.collapsed ~ .cp-main .cp-expand-btn {
    display: block;
}

/* Light theme overrides for CP */
[data-theme="light"] .cp-comment-icon.call { background: #e3f2fd; color: #1565c0; }
[data-theme="light"] .cp-comment-icon.task { background: #ffebee; color: #c62828; }
[data-theme="light"] .cp-comment-icon.contact { background: #e8f5e9; color: #2e7d32; }
[data-theme="light"] .cp-comment-icon.note { background: #f3e5f5; color: #6a1b9a; }
[data-theme="light"] .cp-comment-icon.document { background: #fff3e0; color: #e65100; }
[data-theme="light"] .cp-header-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
[data-theme="light"] .cp-detail-section {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
[data-theme="light"] .cp-more-menu {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Responsive */
@media (max-width: 768px) {
    .cp-layout {
        flex-direction: column;
    }
    .cp-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
    }
    .cp-sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
    }
    .cp-nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 8px 12px;
        font-size: 12px;
    }
    .cp-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }
    .cp-main {
        padding: 12px 16px;
    }
    .cp-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Company name links */
.company-link {
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, text-decoration 0.2s;
}
.company-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ==================== MARKETING ==================== */

/* Layout - same pattern as settings */
.mkt-layout {
    display: flex;
    gap: 0;
    height: 100%;
    min-height: calc(100vh - 80px);
}

.mkt-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mkt-nav-section {
    padding: 0 16px;
    margin-bottom: 16px;
}

.mkt-nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 8px 12px 6px;
}

.mkt-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    margin-bottom: 2px;
}

.mkt-nav-item:hover {
    background: var(--hover);
    color: var(--text);
}

.mkt-nav-item.active {
    background: rgba(0, 180, 216, 0.1);
    color: #00B4D8;
    border-left: 3px solid #00B4D8;
    padding-left: 9px;
}

.mkt-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.mkt-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.mkt-panel {
    display: none;
}

.mkt-panel.active {
    display: block;
}

.mkt-panel-header {
    margin-bottom: 24px;
}

.mkt-panel-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.mkt-panel-header h3 i {
    margin-right: 10px;
    color: #00B4D8;
}

.mkt-panel-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Templates Filter Buttons --- */
.mkt-template-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mkt-filter-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.mkt-filter-btn:hover {
    border-color: #00B4D8;
    color: #00B4D8;
}

.mkt-filter-btn.active {
    background: #00B4D8;
    color: #fff;
    border-color: #00B4D8;
}

/* --- Template Cards Grid --- */
.mkt-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.mkt-template-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mkt-template-card:hover {
    border-color: #00B4D8;
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.1);
    transform: translateY(-2px);
}

.mkt-template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mkt-template-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 180, 216, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00B4D8;
    font-size: 16px;
}

.mkt-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.mkt-tag-ai {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.mkt-tag-gallery {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.mkt-tag-personal {
    background: rgba(0, 180, 216, 0.15);
    color: #00B4D8;
}

.mkt-template-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.mkt-template-card-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    min-height: 40px;
}

.mkt-template-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

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

.mkt-template-card-date i {
    margin-right: 4px;
}

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

.mkt-mini-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--hover);
    color: var(--text-secondary);
}

.mkt-template-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.mkt-card-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--hover);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mkt-card-btn:hover {
    border-color: #00B4D8;
    color: #00B4D8;
}

.mkt-card-btn-edit:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.mkt-card-btn-del:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.mkt-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.mkt-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.4;
}

.mkt-empty p {
    font-size: 14px;
}

/* --- Create Template Editor --- */
.mkt-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    flex-wrap: wrap;
}

.mkt-toolbar-select {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.mkt-toolbar-select-sm {
    width: 60px;
}

.mkt-toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 6px;
}

.mkt-toolbar-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.mkt-toolbar-btn:hover {
    background: var(--hover);
    color: #00B4D8;
}

.mkt-toolbar-color {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.mkt-editor-canvas {
    min-height: 350px;
    max-height: 500px;
    overflow-y: auto;
    padding: 24px;
    background: #1a1d2e;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    outline: none;
}

.mkt-editor-canvas:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.mkt-editor-canvas:focus {
    border-color: #00B4D8;
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.15);
}

.mkt-editor-save {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.mkt-save-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.mkt-save-field label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.mkt-save-field input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    box-sizing: border-box;
}

.mkt-save-field input:focus {
    border-color: #00B4D8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.15);
}

.mkt-save-btn {
    margin-top: 4px;
}

/* --- Actions Flow Builder --- */
.mkt-flow-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mkt-flow-row {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.2s;
}

.mkt-flow-row:hover {
    border-color: rgba(0, 180, 216, 0.3);
}

.mkt-flow-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.mkt-flow-row-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.mkt-flow-row-actions {
    display: flex;
    gap: 6px;
}

.mkt-flow-row-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 13px;
}

.mkt-flow-row-btn:hover {
    border-color: #00B4D8;
    color: #00B4D8;
}

.mkt-flow-row-btn-del:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.mkt-flow-steps {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 8px 0;
}

.mkt-flow-arrow {
    color: var(--text-muted);
    font-size: 12px;
    padding: 0 6px;
    flex-shrink: 0;
    opacity: 0.5;
}

.mkt-flow-box {
    flex-shrink: 0;
    width: 100px;
    min-height: 90px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
}

.mkt-flow-box-configured {
    background: rgba(0, 180, 216, 0.08);
    border-color: rgba(0, 180, 216, 0.3);
}

.mkt-flow-box-configured:hover {
    border-color: #00B4D8;
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.15);
    transform: translateY(-2px);
}

.mkt-flow-box-empty {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.3);
    border-style: dashed;
}

.mkt-flow-box-empty:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.mkt-flow-box-add {
    background: var(--bg);
    border-style: dashed;
    border-color: var(--border);
    opacity: 0.6;
}

.mkt-flow-box-add:hover {
    opacity: 1;
    border-color: #00B4D8;
    background: rgba(0, 180, 216, 0.05);
}

.mkt-flow-box-icon {
    font-size: 20px;
    color: #00B4D8;
    margin-bottom: 2px;
}

.mkt-flow-box-empty .mkt-flow-box-icon {
    color: #f59e0b;
}

.mkt-flow-box-add .mkt-flow-box-icon {
    color: var(--text-muted);
}

.mkt-flow-box-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

.mkt-flow-box-desc {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.mkt-flow-add {
    margin-top: 16px;
}

/* Action Step Modal extras */
.modal-action-step {
    max-width: 520px;
}

.mkt-when-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mkt-when-row select,
.mkt-when-row input {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .mkt-layout {
        flex-direction: column;
    }
    .mkt-sidebar {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        padding: 12px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .mkt-nav-section {
        display: flex;
        gap: 4px;
        padding: 0;
        margin-bottom: 0;
    }
    .mkt-nav-label {
        display: none;
    }
    .mkt-nav-item.active {
        border-left: none;
        border-bottom: 2px solid #00B4D8;
        padding-left: 12px;
    }
    .mkt-content {
        padding: 16px;
    }
    .mkt-template-grid {
        grid-template-columns: 1fr;
    }
    .mkt-save-row {
        grid-template-columns: 1fr;
    }
    .mkt-flow-box {
        width: 80px;
        min-height: 75px;
    }
}

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}
.sidebar-overlay.active {
    display: block;
}

/* Mobile close button for sub-menus - hidden (using horizontal tabs instead) */
.mkt-close-mobile,
.settings-close-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    /* Settings: horizontal tabs on mobile */
    .settings-layout {
        flex-direction: column;
    }
    .settings-sidebar {
        width: 100% !important;
        min-width: unset !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-right: none !important;
        border-bottom: 2px solid var(--border);
        padding: 0 !important;
        gap: 0;
        background: var(--bg-card);
        position: static !important;
        transform: none !important;
        height: auto !important;
        z-index: auto !important;
    }
    .settings-nav-section {
        display: flex;
        flex-direction: row;
        gap: 0;
        margin-bottom: 0;
        padding: 0;
        border-top: none !important;
        padding-top: 0 !important;
    }
    .settings-nav-label {
        display: none;
    }
    .settings-nav-item {
        white-space: nowrap;
        padding: 12px 16px;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        font-size: 12px;
        text-align: center;
    }
    .settings-nav-item.active {
        border-left: none !important;
        border-bottom: 3px solid var(--primary) !important;
        background: rgba(0, 180, 216, 0.08);
    }
    .settings-content {
        padding: 16px;
    }

    /* Marketing: horizontal tabs on mobile */
    .mkt-layout {
        flex-direction: column;
    }
    .mkt-sidebar {
        width: 100% !important;
        min-width: unset !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-right: none !important;
        border-bottom: 2px solid var(--border);
        padding: 0 !important;
        gap: 0;
        background: var(--bg-card);
        position: static !important;
        transform: none !important;
        height: auto !important;
        z-index: auto !important;
    }
    .mkt-nav-section {
        display: flex;
        flex-direction: row;
        gap: 0;
        margin-bottom: 0;
        padding: 0;
    }
    .mkt-nav-label {
        display: none;
    }
    .mkt-nav-item {
        white-space: nowrap;
        padding: 12px 16px;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        font-size: 12px;
        text-align: center;
    }
    .mkt-nav-item.active {
        border-left: none !important;
        border-bottom: 3px solid #00B4D8 !important;
        background: rgba(0, 180, 216, 0.08);
        padding-left: 16px;
    }
    .mkt-content {
        padding: 16px;
    }
}
