/* ==========================================================================
   CRM IMPULSAAGENTS - SYSTEM DESIGN STYLESHEET (VANILLA CSS)
   ========================================================================== */

/* DESIGN SYSTEM TOKENS & VARIABLES */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-title: 'Outfit', sans-serif;

    /* Palette: Dark Luxury Theme */
    --bg-main: #090d16;
    --bg-card: #111726;
    --bg-sidebar: #0b0f1a;
    --bg-hover: #1e2638;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-focus: #38bdf8;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #0b0f16;
    
    /* Brand Colors */
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --primary-glow: rgba(56, 189, 248, 0.15);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Kanban Stage Specific Colors */
    --color-llamada: #6b7280;     /* Gris */
    --color-no-interesado: #ef4444;/* Rojo */
    --color-poco-interesado: #f97316;/* Naranja */
    --color-interesado: #3b82f6;   /* Azul */
    --color-muy-interesado: #34d399;/* Verde Claro */
    --color-agendado: #8b5cf6;     /* Morado */
    --color-pago-parcial: #eab308; /* Amarillo */
    --color-pago-total: #064e3b;   /* Verde Oscuro */

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px 0 rgba(56, 189, 248, 0.25);
    --glass-bg: rgba(17, 23, 38, 0.7);
    --glass-blur: blur(12px);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CUSTOM SCROLLBARS */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* APP SHELL LAYOUT */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR STYLING */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
}

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

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

.brand-icon {
    background: linear-gradient(135deg, var(--primary), #7dd3fc);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.brand h2 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: white;
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.nav-link i {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.15);
}

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

.user-avatar {
    width: 38px;
    height: 38px;
    background-color: var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    overflow: hidden;
}

.user-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

/* MAIN CONTENT CONTAINER */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* CONTENT HEADER */
.content-header {
    height: 80px;
    padding: 0 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(17, 23, 38, 0.2);
    flex-shrink: 0;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* SECTION VIEWS CONTROLLER */
.view-container {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* PREMIUM CARDS */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

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

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

.card-title-icon {
    color: var(--primary);
    width: 22px;
    height: 22px;
}

/* GRID LAYOUTS */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* FORMS AND BUTTONS */
.form-group {
    margin-bottom: 20px;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
    background-color: rgba(0, 0, 0, 0.3);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.input-icon-wrapper input {
    padding-left: 46px;
}

.input-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.row-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

.row-checkbox label {
    margin-bottom: 0;
    user-select: none;
    cursor: pointer;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

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

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

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* CLIENTS TABLE SECTION */
.table-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-card);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-box input {
    padding-left: 48px;
}

.control-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

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

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  -webkit-transform: translateX(20px);
  -ms-transform: translateX(20px);
  transform: translateX(20px);
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-main);
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

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

/* ROW ACTIONS */
.row-actions {
    display: flex;
    gap: 8px;
}

.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

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

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

.action-icon-btn.btn-delete:hover {
    color: var(--danger);
}

/* BADGES & LEAD STATES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}

/* Dynamic State Styling */
.badge-llamada {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--color-llamada);
    border-color: rgba(107, 114, 128, 0.2);
}

.badge-no-interesado {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-no-interesado);
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-poco-interesado {
    background-color: rgba(249, 115, 22, 0.1);
    color: var(--color-poco-interesado);
    border-color: rgba(249, 115, 22, 0.2);
}

.badge-interesado {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-interesado);
    border-color: rgba(59, 130, 246, 0.2);
}

.badge-muy-interesado {
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--color-muy-interesado);
    border-color: rgba(52, 211, 153, 0.2);
}

.badge-agendado {
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--color-agendado);
    border-color: rgba(139, 92, 246, 0.2);
}

.badge-pago-parcial {
    background-color: rgba(234, 179, 8, 0.1);
    color: var(--color-pago-parcial);
    border-color: rgba(234, 179, 8, 0.2);
}

.badge-pago-total {
    background-color: rgba(6, 78, 59, 0.2);
    color: #34d399;
    border-color: rgba(6, 78, 59, 0.4);
}

.badge-sent {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-failed {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

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


.badge-tag {
    cursor: pointer;
    background-color: rgba(56, 189, 248, 0.1);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.3);
    margin: 4px;
    padding: 6px 12px;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.badge-tag:hover {
    background-color: var(--primary);
    color: white;
}

/* EMPTY STATES */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
}

/* KANBAN BOARD PIPELINE STYLING */
.kanban-board-wrapper {
    height: calc(100vh - 160px); /* Fill space */
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
}

.kanban-board {
    display: flex;
    gap: 16px;
    height: 100%;
    min-width: max-content; /* Ensure horizontal scroll works */
    align-items: flex-start;
}

.kanban-column {
    width: 320px;
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.kanban-column.dragover {
    border-color: var(--primary);
    background-color: var(--bg-hover);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.kanban-column-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Colored strip on top of column headers */
.kanban-column-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--color-llamada);
}

/* Column Header Color Bindings */
.col-llamada .kanban-column-header::before { background-color: var(--color-llamada); }
.col-no-interesado .kanban-column-header::before { background-color: var(--color-no-interesado); }
.col-poco-interesado .kanban-column-header::before { background-color: var(--color-poco-interesado); }
.col-interesado .kanban-column-header::before { background-color: var(--color-interesado); }
.col-muy-interesado .kanban-column-header::before { background-color: var(--color-muy-interesado); }
.col-agendado .kanban-column-header::before { background-color: var(--color-agendado); }
.col-pago-parcial .kanban-column-header::before { background-color: var(--color-pago-parcial); }
.col-pago-total .kanban-column-header::before { background-color: var(--color-pago-total); }

.kanban-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-title h3 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.column-badge {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-main);
}

.kanban-column-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 150px;
}

/* KANBAN CARD */
.kanban-card {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.kanban-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.96);
    border-style: dashed;
}

.kanban-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.kanban-card-company {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-card-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-bottom: 10px;
}

.kanban-card-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-card-detail-item i {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

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

.kanban-card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kanban-card:hover .kanban-card-actions {
    opacity: 1;
}

/* TEAM MEMBERS VIEW */
.user-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

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

.user-item-meta h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-item-meta p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.scroll-panel {
    max-height: 400px;
    overflow-y: auto;
}

/* SMTP CONFIGURATION VIEW */
.smtp-test-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.card-footer-form {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-color);
}

.card-footer-form h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.test-email-inputs {
    display: flex;
    gap: 12px;
}

.test-email-inputs input {
    flex: 1;
}

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

.template-selector label {
    font-weight: 600;
    font-size: 0.9rem;
}

.template-selector select {
    flex: 1;
    max-width: 300px;
}

.template-placeholders h5 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.placeholder-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
}

/* EMAIL LOGS VIEW */
.logs-table-card {
    overflow: hidden;
}

/* SYSTEM MODAL DIALOGS */
.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 7, 13, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

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

.modal-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-large {
    max-width: 960px;
}

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

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

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

.modal-close-btn:hover {
    background-color: var(--bg-hover);
    color: white;
}

.modal-body {
    padding: 24px;
}

.scroll-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.15);
}

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

/* CSV/EXCEL IMPORT UPLOADER */
.import-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(0, 0, 0, 0.1);
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.03);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.import-dropzone h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.import-dropzone p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.file-limits {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.hidden-input {
    display: none;
}

/* WIZARD MAPPING VIEW */
.mapping-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #93c5fd;
}

.info-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.grid-2col-mapping {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 20px;
    height: 450px;
}

.mapping-table-card,
.preview-table-card {
    display: flex;
    flex-direction: column;
    background-color: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: 100%;
}

.mapping-table-card h4,
.preview-table-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--text-muted);
}

.mapping-form {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.mapping-row {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.mapping-row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.mapping-row select {
    padding: 8px 12px;
    font-size: 0.8rem;
}

.table-compact-wrapper {
    flex: 1;
    overflow: auto;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.compact-table th {
    background-color: rgba(0,0,0,0.3);
    padding: 8px 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.compact-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    max-width: 150px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.rows-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: auto;
}

/* LOGIN WRAPPER & DECORATIONS */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
    z-index: 1000;
}

.login-wrapper.active {
    display: flex;
}

.login-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background-color: var(--primary);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background-color: var(--accent-hover);
    bottom: -150px;
    left: -150px;
}

.login-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    z-index: 2;
    position: relative;
}

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

.logo-box {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* TOAST ALERTS POPUP */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background-color: #1e293b;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 16px 20px;
    color: white;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

.toast.removing {
    opacity: 0;
    transform: translateX(50px);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.toast-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast types colors */
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { color: var(--info); }

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVE ADAPTATIONS */
@media (max-width: 1024px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .content-header {
        padding: 0 20px;
    }
    .view-container {
        padding: 20px;
    }
    .table-controls {
        grid-template-columns: 1fr;
    }
}

/* FULLCALENDAR STYLES OVERRIDES */
.fc {
    color: var(--text-main);
    font-family: var(--font-primary);
}

.fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-color);
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-color);
}

.fc .fc-toolbar-title {
    font-family: var(--font-title);
    font-weight: 600;
}

.fc .fc-button-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.fc .fc-button-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.fc .fc-button-primary:disabled {
    background-color: rgba(56, 189, 248, 0.5);
    border-color: transparent;
}

.fc .fc-col-header-cell-cushion {
    color: var(--text-muted);
    font-weight: 600;
}

.fc .fc-daygrid-day-number {
    color: var(--text-main);
}

.fc .fc-day-today {
    background-color: rgba(56, 189, 248, 0.1) !important;
}
