/* ============================================
   CRM IT - Dark SaaS Theme
   Custom CSS3 - No Framework
   ============================================ */

:root {
    --bg: #0a0a0f;
    --surface: #13131f;
    --surface-light: #1a1a2e;
    --border: rgba(255,255,255,0.06);
    --accent: #00d4ff;
    --accent-glow: rgba(0,212,255,0.3);
    --text-primary: #f0f0f5;
    --text-secondary: #8a8f98;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #a855f7;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   Login Page
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, #1a1a3e 0%, var(--bg) 70%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.login-logo h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
}

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

.sidebar {
    width: 200px;
    background: rgba(19,19,31,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 20px 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0,212,255,0.08);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px var(--accent-glow);
}

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

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

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 110;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.main-content {
    flex: 1;
    margin-left: 200px;
    display: flex;
    flex-direction: column;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title { font-size: 20px; font-weight: 600; }

.user-greeting { color: var(--text-secondary); font-size: 14px; }

.content-wrapper {
    padding: 32px;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.alert-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }
.alert-warning { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.3); color: #facc15; }
.alert-warning ol { margin: 10px 0 0 18px; }
.alert-warning li { margin-bottom: 6px; }
.alert-warning a { color: #fef08a; text-decoration: underline; }
.alert-warning code { background: rgba(0,0,0,0.2); padding: 2px 6px; border-radius: 4px; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000;
    border: none;
    box-shadow: 0 2px 12px rgba(0,212,255,0.25);
}

.btn-primary:hover { box-shadow: 0 4px 20px rgba(0,212,255,0.4); }

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

.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.btn-success {
    background: rgba(34,197,94,0.15);
    color: var(--success);
    border-color: rgba(34,197,94,0.3);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
    border-color: rgba(239,68,68,0.3);
}

.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-block { width: 100%; justify-content: center; }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
}

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

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 16px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row .full-width { grid-column: 1 / -1; }
.form-section { margin-bottom: 32px; }
.form-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-primary); }
.form-actions { margin-top: 8px; }
small { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }

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

.checkbox-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.smtp-log {
    width: 100%;
    min-height: 240px;
    padding: 14px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.15);
}

textarea { resize: vertical; min-height: 80px; }

select {
    background: var(--surface-light);
    color: var(--text-primary);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select option {
    background: var(--surface-light);
    color: var(--text-primary);
}

select option:hover,
select option:focus,
select option:checked {
    background: var(--accent);
    color: #0a0a0f;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { border-color: rgba(255,255,255,0.1); }

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

.card-title { font-size: 16px; font-weight: 600; }

/* ============================================
   Tables
   ============================================ */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: rgba(255,255,255,0.03);
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.data-table tbody tr.client-row:hover {
    background: rgba(0, 212, 255, 0.04);
    cursor: pointer;
    border-left: 3px solid var(--accent);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-gray { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.badge-blue { background: rgba(0,212,255,0.12); color: var(--accent); }
.badge-green { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-orange { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-purple { background: rgba(168,85,247,0.12); color: var(--purple); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--danger); }

/* ============================================
   Modals
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.25s ease;
}

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

.modal-header h3 { font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

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

/* ============================================
   Dashboard / Kanban
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.dashboard-section {
    margin-top: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }

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

.todo-counter {
    font-size: 12px;
    color: var(--text-secondary);
}

.kanban-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hidden-kanban-card {
    display: none !important;
}

.kanban-cards-toggle {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.kanban-cards-toggle:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
}

.kanban-column {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: auto;
    width: 100%;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.kanban-column-header .count {
    margin-left: auto;
    background: rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-right: 8px;
}

.bulk-delete-btn {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.bulk-delete-btn:hover {
    opacity: 1;
}

.kanban-column-body {
    min-height: 80px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    transition: background 0.2s;
    border-radius: 8px;
    padding: 4px;
}

.kanban-column-body.drag-over {
    background: rgba(0,212,255,0.06);
    box-shadow: inset 0 0 0 1px rgba(0,212,255,0.2);
}

.kanban-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    cursor: grab;
    position: relative;
    transition: var(--transition);
    flex: 0 0 260px;
    max-width: 300px;
    user-select: none;
    -webkit-user-select: none;
}

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

.kanban-card-lead {
    border-left: 3px solid var(--accent);
}

.kanban-card-lead .lead-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lead-badge-leaduri   { background: var(--text-secondary); color: #fff; }
.lead-badge-sunat     { background: var(--accent); color: #000; }
.lead-badge-failed    { background: var(--danger); color: #fff; }
.lead-badge-programat { background: var(--warning); color: #000; }
.lead-badge-nda       { background: var(--purple); color: #fff; }
.lead-badge-meeting   { background: #06b6d4; color: #000; }
.lead-badge-semnat_contracte     { background: #ec4899; color: #fff; }
.lead-badge-planuit_implementare { background: #eab308; color: #000; }
.lead-badge-incasat_taxa         { background: var(--success); color: #000; }
.lead-badge-implementare         { background: #52525b; color: #fff; }

.kanban-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.kanban-card.dragging { opacity: 0.5; }

.card-priority {
    width: 3px;
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    border-radius: 0 3px 3px 0;
}

.priority-low { background: var(--text-secondary); }
.priority-medium { background: var(--warning); }
.priority-high { background: var(--danger); }

.card-title { font-weight: 500; font-size: 14px; margin-bottom: 6px; padding-left: 6px; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 6px;
}

.card-actions {
    position: absolute;
    top: 8px; right: 8px;
    display: none;
    gap: 4px;
}

.kanban-card:hover .card-actions { display: flex; }

.btn-add-card {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-card:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-gray { background: var(--text-secondary); }
.dot-blue { background: var(--accent); }
.dot-red { background: var(--danger); }
.dot-orange { background: var(--warning); }
.dot-purple { background: var(--purple); }
.dot-cyan { background: #06b6d4; }
.dot-pink { background: #ec4899; }
.dot-yellow { background: #eab308; }
.dot-green { background: var(--success); }
.dot-dark { background: #52525b; }

/* ============================================
   Todo List
   ============================================ */
.todo-list { display: flex; flex-direction: column; gap: 8px; }

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.todo-item:hover { border-color: rgba(255,255,255,0.1); }

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

.todo-item.completed {
    opacity: 0.65;
}

.todo-item.completed:hover {
    opacity: 1;
}

.todo-checkbox {
    position: relative;
    width: 18px; height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.todo-checkbox input { position: absolute; opacity: 0; cursor: pointer; }

.checkmark {
    position: absolute;
    inset: 0;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    transition: var(--transition);
}

.todo-checkbox input:checked + .checkmark {
    background: var(--success);
    border-color: var(--success);
}

.todo-checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 4px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

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

.todo-title { font-size: 14px; font-weight: 500; }

.todo-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================
   Leads Page
   ============================================ */
.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    padding-left: 38px;
    background: var(--surface);
}

.filter-select {
    width: auto;
    min-width: 160px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.lead-card {
    animation: fadeIn 0.4s ease;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lead-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.lead-card .info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.lead-card .info-row svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.lead-card .card-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Client Profile
   ============================================ */
.client-profile .profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

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

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-list { display: flex; flex-direction: column; gap: 14px; }

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child { border-bottom: none; padding-bottom: 0; }

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

.info-value { font-weight: 500; font-size: 14px; }

.mini-list { display: flex; flex-direction: column; gap: 10px; }

.mini-item {
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mini-title { font-size: 14px; font-weight: 500; }

.mini-title.completed { text-decoration: line-through; color: var(--text-secondary); }

.mini-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-secondary); }

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

.mt-3 { margin-top: 12px; }

.leads-widget {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.leads-widget .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.leads-widget .section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.leads-widget .mini-item {
    cursor: pointer;
    transition: background 0.15s ease;
}

.leads-widget .mini-item:hover {
    background: rgba(255,255,255,0.06);
}

.leads-widget .mini-content {
    flex: 1;
    min-width: 0;
}

.leads-widget .mini-title,
.leads-widget .mini-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden-lead {
    display: none !important;
}

.leads-toggle-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.leads-toggle-btn:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
}

.lead-status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    margin-left: 10px;
}

.meetings-widget {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.meetings-widget .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.meetings-widget .section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.meetings-widget .mini-item {
    cursor: pointer;
    transition: background 0.15s ease;
}

.meetings-widget .mini-item:hover {
    background: rgba(255,255,255,0.06);
}

/* ============================================
   Contracts
   ============================================ */
.contracts-page .contract-generators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}

.contract-card .form-group { margin-bottom: 14px; }

.editor-wrapper {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    min-height: 120px;
}

.rich-editor {
    outline: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.rich-editor p { margin-bottom: 8px; }

/* ============================================
   Calendar
   ============================================ */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-nav { display: flex; gap: 8px; }

.calendar-page {
    width: 100%;
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.calendar-day-header {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: var(--transition);
    position: relative;
    min-width: 0;
}

.calendar-day:hover {
    border-color: rgba(255,255,255,0.15);
    background: var(--surface-light);
}

.calendar-day.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.calendar-day.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.calendar-day.today .day-number { color: var(--accent); font-weight: 700; }

.day-number { font-size: 14px; font-weight: 500; }

.meeting-dots {
    display: flex;
    gap: 3px;
    margin-top: auto;
    flex-wrap: wrap;
}

.meeting-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 4px var(--accent-glow);
}

.kanban-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

.calendar-day-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    overflow: hidden;
    min-width: 0;
    width: 100%;
}

.calendar-item-label {
    font-size: 10px;
    line-height: 1.2;
    padding: 1px 4px;
    border-radius: 3px;
    border-left: 2px solid var(--accent);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.kanban-card-note {
    font-size: 10px;
    line-height: 1.3;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.day-meetings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.day-meeting-item {
    padding: 12px;
    background: var(--surface-light);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

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

.day-meeting-header h5 { font-size: 14px; margin: 0; }

.day-meeting-actions {
    display: flex;
    gap: 6px;
}

.day-meeting-actions .btn-icon {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
}

.day-meeting-actions .btn-icon:hover {
    background: var(--accent);
    color: #0a0a0f;
}

.day-meeting-item p { font-size: 13px; color: var(--text-secondary); }

/* ============================================
   Daily View Timeline
   ============================================ */
.daily-view {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
}

.daily-timeline {
    position: relative;
    min-width: 100%;
}

.time-slot {
    display: flex;
    align-items: stretch;
    min-height: 60px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.time-slot:last-child { border-bottom: none; }

.time-label {
    width: 56px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 8px 8px 0;
    text-align: right;
    border-right: 1px solid var(--border);
    line-height: 1;
}

.time-content {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease;
}

.time-content:hover {
    background: rgba(255,255,255,0.02);
}

.daily-meeting {
    position: absolute;
    left: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    border-radius: 6px;
    padding: 6px 10px;
    color: #0a0a0f;
    cursor: pointer;
    overflow: hidden;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.daily-meeting:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.4);
}

.daily-kanban {
    position: absolute;
    left: 8px;
    right: 8px;
    border-left: 3px solid #f59e0b;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.daily-kanban:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.daily-meeting-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daily-meeting-info {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 2px;
}

.daily-meeting-loc {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Calendar View Tabs
   ============================================ */
.calendar-view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.calendar-view-tabs .tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
}

.calendar-view-tabs .tab:hover {
    background: var(--surface-light);
    color: var(--text);
}

.calendar-view-tabs .tab.active {
    background: var(--accent);
    color: #0a0a0f;
    border-color: var(--accent);
}

/* ============================================
   Drag & Drop Helpers
   ============================================ */
.dragging {
    opacity: 0.7;
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Visual feedback during drag: make underlying cards semi-transparent so drop zones are visible */
.calendar-page.is-dragging .daily-meeting,
.calendar-page.is-dragging .daily-kanban,
.calendar-page.is-dragging .daily-todo {
    opacity: 0.35;
}

.calendar-page.is-dragging .time-content {
    background: rgba(0, 212, 255, 0.04);
}

.drag-over {
    background: rgba(0, 212, 255, 0.08) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent);
}

.drop-zone,
.time-content {
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.calendar-item-label,
.week-item,
.daily-meeting,
.daily-kanban {
    cursor: grab;
}

.calendar-item-label:active,
.week-item:active,
.daily-meeting:active,
.daily-kanban:active {
    cursor: grabbing;
}

/* Todo items in calendar */
.calendar-item-todo,
.week-item-todo {
    background: rgba(34, 197, 94, 0.08);
}

.calendar-item-todo.completed,
.week-item-todo.completed {
    background: rgba(107, 114, 128, 0.06);
    text-decoration: line-through;
    opacity: 0.75;
}

.daily-todo {
    position: absolute;
    left: 8px;
    right: 8px;
    border-left: 3px solid #22c55e;
    background: rgba(34, 197, 94, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.daily-todo.completed {
    border-left-color: #6b7280;
    background: rgba(107, 114, 128, 0.06);
    text-decoration: line-through;
    opacity: 0.75;
}

.daily-todo:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

/* ============================================
   Week View
   ============================================ */
.week-view {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-height: 400px;
}

.week-day-column {
    display: flex;
    flex-direction: column;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 100%;
    transition: var(--transition);
}

.week-day-column.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
}

.week-day-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.week-day-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.week-day-number.today {
    background: var(--accent);
    color: #0a0a0f;
}

.week-day-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    flex: 1;
    min-height: 60px;
}

.week-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
    font-size: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.week-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.week-item-time {
    font-weight: 700;
    color: var(--text);
    font-size: 11px;
}

.week-item-title {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-item-badge {
    align-self: flex-start;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-top: 2px;
}

/* ============================================
   Financial Widget
   ============================================ */
.financial-widget {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.financial-widget .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.financial-widget .section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.kpi-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 136, 204, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.kpi-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.kpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.target-section {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 12px;
}

.target-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.gap-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.gap-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #00aaff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.gap-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 4px;
}

.gap-difference {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.gap-negative { color: #ff6b6b; }
.gap-positive { color: #51cf66; }
.gap-neutral { color: var(--text-secondary); }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.fade-in { animation: fadeIn 0.3s ease; }

/* ============================================
   Responsive
   ============================================ */
/* ============================================
   Email page
   ============================================ */
.email-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
    gap: 24px;
    align-items: start;
}

.email-form { padding: 24px; }

.email-preview {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.email-preview h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.email-preview iframe {
    flex: 1;
    width: 100%;
    min-height: 500px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .kanban-board { flex-direction: column; }
    .kanban-column { width: 100%; min-width: auto; }
    .kanban-column-body { flex-direction: row; flex-wrap: wrap; }
    .kanban-card { flex: 1 1 200px; max-width: 100%; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open { transform: translateX(0); }

    .sidebar-toggle { display: block; }

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

    .top-header { padding-left: 60px; }

    .content-wrapper { padding: 20px; }

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

    .form-row { grid-template-columns: 1fr; }

    .email-layout { grid-template-columns: 1fr; }

    .email-preview { min-height: 400px; }

    .email-preview iframe { min-height: 350px; }

    .page-actions { flex-direction: column; align-items: stretch; }

    .search-box { min-width: auto; }

    .calendar-grid { gap: 4px; }

    .calendar-day { padding: 4px; border-radius: 6px; min-height: 60px; aspect-ratio: auto; }

    .day-number { font-size: 12px; }

    .calendar-item-label { font-size: 9px; padding: 1px 3px; }

    .calendar-header { flex-wrap: wrap; gap: 8px; }

    .calendar-nav { flex-wrap: wrap; }

    .daily-view { padding: 10px; }

    .time-label { width: 44px; font-size: 11px; }

    .daily-meeting, .daily-kanban, .daily-todo { font-size: 11px; padding: 4px 6px; }

    .week-view { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px; }

    .week-day-header { padding: 8px 4px; }

    .week-day-name { font-size: 10px; }

    .week-day-number { font-size: 14px; width: 26px; height: 26px; }

    .week-item { padding: 6px; font-size: 11px; }

    .contracts-page .contract-generators { grid-template-columns: 1fr; }

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

    .client-profile .profile-header { flex-direction: column; align-items: flex-start; gap: 12px; }

    .data-table thead { display: none; }

    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 14px;
    }

    .data-table td {
        border-bottom: none;
        padding: 6px 0;
        display: flex;
        justify-content: space-between;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
        text-transform: uppercase;
    }
}

@media (max-width: 480px) {
    .login-card { padding: 24px; }

    .modal-content { margin: 16px; max-height: calc(100vh - 32px); }

    .calendar-day-header { padding: 8px 4px; font-size: 10px; }

    .calendar-day { padding: 2px; min-height: 48px; aspect-ratio: auto; }

    .day-number { font-size: 10px; }

    .calendar-item-label { display: none; }

    .meeting-dots, .calendar-day-items { margin-top: auto; }

    .daily-meeting, .daily-kanban, .daily-todo { font-size: 10px; padding: 3px 4px; left: 4px; right: 4px; }

    .week-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 6px; }

    .week-day-name { font-size: 9px; }

    .week-item-title { font-size: 10px; }

    .daily-meeting-title { font-size: 11px; }

    .daily-meeting-info { font-size: 10px; }
}
