@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

/* _core/leadable/v1/assets/css/style.css */

/* Global Variables */
:root { 
    --sidebar-width: 260px; 
    --header-height: 80px; 
    --font-main: 'Google Sans', sans-serif; 
    --brand-color: #007bff;
}

/* Base Reset */
body { margin: 0; }

/* App Layout Styles (from layout.php) */
body.app-layout { 
    display: flex; 
    background: #f4f6f8; 
    font-family: var(--font-main) !important; 
}

.sidebar { width: var(--sidebar-width); background: #fff; height: 100vh; position: fixed; border-right: 1px solid #eee; display: flex; flex-direction: column; }
.brand-area { height: var(--header-height); display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid #eee; }
.brand-logo svg { max-height: 32px; width: auto; }

.nav-menu { padding: 24px 16px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #555; text-decoration: none; border-radius: 8px; margin-bottom: 4px; font-weight: 500; font-size: 14px; }
.nav-item:hover, .nav-item.active { background: #E3F2FD; color: #1565C0; }
.nav-icon { font-size: 20px; }
.nav-section { margin-top:24px; font-size:11px; font-weight:700; color:#999; padding-left:16px; text-transform:uppercase; margin-bottom: 8px; }

.main { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.header { height: var(--header-height); background: #fff; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 10; }
.user-profile { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    color: #444;
}
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left align text */
}
.user-name {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    line-height: 1.2;
}
.user-role {
    font-size: 12px;
    font-weight: 400;
    color: #9E9E9E;
    line-height: 1.2;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-avatar .material-symbols-outlined {
    font-size: 44px; /* Slightly larger to fill nicely */
    color: #757575;
    background: white; /* Ensure background is clean behind icon if transparent */
}
.content-body { padding: 32px; }
.page-title h3 { margin: 0; font-size: 18px; }

/* Dashboard Styles (from dashboard.php) */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; border: 1px solid #eee; }
.stat-val { font-size: 24px; font-weight: 700; color: #111; display: block; margin-top: 8px; }
.stat-label { font-size: 13px; color: #666; font-weight: 500; }

.controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.search-box { position: relative; width: 300px; }
.search-box input { width: 100%; padding: 10px 10px 10px 40px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: 'Google Sans', sans-serif; }
.search-icon { position: absolute; left: 12px; top: 10px; color: #999; font-size: 20px; }

.tabs { 
    display: flex; 
    gap: 4px; 
    background: #EEEEEE; 
    padding: 4px; 
    border-radius: 12px; 
    height: 44px;
    box-sizing: border-box; /* Ensure padding is included in height */
}

.tab { 
    padding: 0 16px; 
    border-radius: 8px; 
    text-decoration: none; 
    color: #757575; 
    font-weight: 500; 
    font-size: 13px; 
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tab:hover {
    color: #333;
}

.tab.active { 
    background: white; 
    color: #111; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
}

.table-card { background: white; border-radius: 12px; border: 1px solid #eee; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 16px 24px; background: #fafafa; border-bottom: 1px solid #eee; font-size: 12px; color: #666; font-weight: 600; text-transform: uppercase; }
td { padding: 0 24px; height: 60px; vertical-align: middle; border-bottom: 1px solid #eee; font-size: 14px; font-weight: 400; color: #333; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #f9f9f9; }

/* --- Table Specifics --- */
.table-card table {
    width: 100%;
    table-layout: fixed;
}

.table-header {
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.table-row {
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.1s;
}

.table-row:hover {
    background: #f9f9f9;
}

/* Specific Columns */
.col-name {
    width: 20%;
    padding: 0 24px;
    height: 60px;
    font-weight: 600;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-phone {
    width: 15%;
    padding: 0 24px;
    vertical-align: middle;
    color: #555;
    /* font-family inherited (Google Sans) */
}

.col-status {
    width: 20%;
    padding: 0 24px;
    vertical-align: middle;
}

.col-date {
    width: 15%;
    padding: 0 24px;
    vertical-align: middle;
    color: #555;
}

.col-product {
    width: 20%;
    padding: 0 24px;
    vertical-align: middle;
}

.col-action {
    width: 10%;
    padding: 0 24px;
    text-align: right;
    vertical-align: middle;
}

/* Header Cells (match widths) */
th.col-name { text-align: left; padding: 0 24px; height: 60px; vertical-align: middle; }
th.col-phone { text-align: left; padding: 0 24px; height: 60px; vertical-align: middle; }
th.col-status { text-align: left; padding: 0 24px; height: 60px; vertical-align: middle; }
th.col-date { text-align: left; padding: 0 24px; height: 60px; vertical-align: middle; }
th.col-product { text-align: left; padding: 0 24px; height: 60px; vertical-align: middle; }
th.col-action { text-align: right; padding: 0 24px; height: 60px; vertical-align: middle; }

/* --- Badges (General) --- */
.badge-standard {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1; /* Helps vertical centering */
    white-space: nowrap;
}

.badge-gray {
    background-color: #E0E0E0;
    color: #000000;
}

.badge-icon {
    font-size: 16px; /* Slightly larger than text for icon clarity */
    color: inherit;
}

/* --- Analytics Specific --- */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.date-controls {
    display: flex;
    gap: 8px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
}

.date-btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

.date-btn.active {
    background: white;
    color: #111;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.kpi-label { font-size: 13px; color: #666; font-weight: 500; display: block; margin-bottom: 8px; }
.kpi-number { font-size: 24px; font-weight: 700; color: #111; }
.kpi-sub { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.trend-up { color: #4CAF50; }
.trend-down { color: #F44336; }

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.time-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.time-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    text-align: center;
}

.time-val { font-size: 20px; font-weight: 700; color: #333; display: block; margin-bottom: 4px; }
.time-lbl { font-size: 12px; color: #888; }

.donut-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* --- Status Badges --- */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-badge::before {
    content: '';
    display: none; /* Removed circle */
}

.status-incoming {
    color: #4A148C;
    background-color: #F3E5F5;
}

.status-in_progress {
    color: #01579B;
    background-color: #E1F5FE;
}

.status-success {
    color: #55A21F;
    background-color: #DEF6CF;
}

.status-failure {
    color: #EA3752;
    background-color: #FFEBEE;
}

/* --- Inputs --- */
.input-standard {
    width: 100%;
    height: 48px;
    padding: 10px 16px; /* Adjusted padding */
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 16px; /* Updated to 16px */
    font-weight: 400; /* No bold */
    font-family: inherit;
    box-sizing: border-box; /* Ensure padding doesn't affect width */
    outline: none;
    transition: border-color 0.2s;
}

.input-standard:focus {
    border-color: #3D5AFE;
}

.label-standard {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.helper-text {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* --- Buttons --- */
/* Standard Button */
.btn-standard {
    background-color: #3D5AFE;
    color: #FFFFFF;
    height: 48px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    font-size: 15px;
    text-decoration: none;
}

.btn-standard:hover {
    background-color: #304FFE;
}

/* Secondary (Light) Button */
.btn-secondary {
    background-color: #E1F5FE;
    color: #01579B;
    height: 48px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    font-size: 15px;
    text-decoration: none;
    width: 100%; /* Often full width in sidebars */
}

.btn-secondary:hover {
    background-color: #B3E5FC; /* Darker shade of light blue */
}

/* Small (Outline) Button */
.btn-small {
    height: 36px;
    background-color: white;
    color: #757575 !important;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    text-decoration: none;
    white-space: nowrap; /* Prevent wrapping in tables */
}

.btn-small:hover {
    background-color: #f5f5f5;
    color: #333 !important;
    border-color: #333;
}

/* Outline (Large) Button - e.g. for Modal Cancel */
.btn-outline {
    height: 48px;
    background-color: white;
    color: #757575 !important;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-outline:hover {
    background-color: #f5f5f5;
    color: #333 !important;
    border-color: #333;
}

/* Lead Detail Styles (from lead_detail.php) */
.lead-container { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.card { background: white; border-radius: 12px; border: 1px solid #eee; padding: 24px; margin-bottom: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card h2 { margin: 0; font-size: 18px; }
.top-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.back-btn { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    text-decoration: none; 
    color: #666; 
    font-weight: 500; 
    font-size: 14px; 
    padding: 8px 0;
    background: transparent;
    border: none;
    transition: color 0.2s;
}
.back-btn:hover { color: #111; background: transparent; border: none; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.info-item label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.info-item span { font-size: 15px; font-weight: 500; color: #333; }
.timeline { margin-top: 20px; border-left: 2px solid #eee; padding-left: 20px; }
.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -25px; top: 6px; width: 8px; height: 8px; background: #ccc; border-radius: 50%; }
.t-header { font-size: 13px; color: #555; display: flex; justify-content: space-between; }
.t-body { font-size: 14px; color: #111; margin-top: 4px; background: #f9f9f9; padding: 12px; border-radius: 8px; }
.action-area { display: flex; flex-direction: column; gap: 12px; }

.note-box {
    margin-bottom: 0;
}
.note-box textarea { 
    width: 100%; 
    height: 100px; 
    padding: 12px; 
    border: 1px solid #E0E0E0; 
    border-radius: 8px; 
    resize: none; 
    font-family: inherit; 
    margin-bottom: 10px; 
    box-sizing: border-box; 
    font-size: 16px; 
    font-weight: 400;
}
.save-btn {
    background-color: #3D5AFE;
    color: #FFFFFF;
    height: 48px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 15px;
    padding: 0 24px;
}
.save-btn:hover { background-color: #304FFE; }

/* Analytics Styles (from analytics.php) */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }
.kpi-card { background: white; padding: 24px; border-radius: 12px; border: 1px solid #eee; display: flex; flex-direction: column; }
.kpi-title { font-size: 14px; color: #666; margin-bottom: 8px; font-weight: 500; }
.kpi-value { font-size: 32px; font-weight: 700; color: #111; }
.kpi-sub { font-size: 12px; color: #888; margin-top: 4px; }
.chart-section { background: white; padding: 24px; border-radius: 12px; border: 1px solid #eee; margin-bottom: 32px; }
.chart-container { position: relative; height: 350px; width: 100%; min-width: 0; }

/* Login Styles (from login.php) */
body.login-page { 
    background: #f0f2f5; 
    font-family: sans-serif; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100vh; 
}

.login-box { background: white; padding: 40px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 100%; max-width: 360px; }
.login-box .logo { max-height: 40px; margin-bottom: 20px; display: block; margin-left: auto; margin-right: auto; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 16px; }
.form-group input { 
    width: 100%; 
    height: 48px; 
    padding: 10px 16px; 
    border: 1px solid #E0E0E0; 
    border-radius: 6px; 
    box-sizing: border-box; 
    outline: none; 
    transition: border-color 0.2s; 
    font-size: 16px; 
    font-weight: 400; 
}
.form-group input:focus { border-color: #3D5AFE; }
.login-box .btn {
    background-color: #3D5AFE;
    color: #FFFFFF;
    height: 48px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    padding: 0 24px;
}
.login-box .btn:hover { background-color: #304FFE; }
.error { background: #ffe6e6; color: #d63031; padding: 10px; border-radius: 4px; margin-bottom: 15px; font-size: 0.9rem; text-align: center; }

/* --- Modal Styles --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-title {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
}

.modal-phone {
    text-align: center;
    margin-bottom: 24px;
}

.modal-phone a {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    letter-spacing: 1px;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #f9f9f9;
}

.modal-phone a:hover {
    background: #f0f0f0;
    color: var(--brand-color);
}

.modal-label {
    font-size: 15px;
    margin-bottom: 12px;
    color: #444;
}

.modal-input {
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

/* --- Outcome Buttons --- */
.outcome-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-outcome {
    padding: 16px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-outcome:hover {
    background: #f8f9fa;
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-outcome.active {
    background: #E3F2FD;
    border-color: #2196F3;
    color: #1565C0;
    font-weight: 600;
    box-shadow: 0 0 0 1px #2196F3 inset;
}

/* --- Detail Grid Styles --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 72px;
}

.detail-item {
    display: grid;
    grid-template-columns: 24px 140px 1fr;
    align-items: center;
    gap: 12px;
    height: 48px;
}

.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.detail-icon span {
    font-size: 20px;
}

.detail-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: #111;
    font-weight: 500;
}

.detail-value a {
    color: inherit;
    text-decoration: none;
}

.detail-value a:hover {
    color: var(--brand-color);
    text-decoration: underline;
}

/* Custom Select wrapper for detail view */
.detail-select-wrapper {
    position: relative;
    width: 100%;
    display: block;
    border-radius: 6px;
    overflow: hidden;
    height: 48px;
}

.detail-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    padding: 0 32px 0 12px;
    cursor: pointer;
    outline: none;
    width: 100%;
    height: 100%;
}

.detail-select-wrapper::after {
    content: 'expand_more';
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    color: inherit;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Status colors for dropdown background */
.status-select-incoming { background-color: #F3E5F5; color: #4A148C; }
.status-select-in_progress { background-color: #E1F5FE; color: #01579B; }
.status-select-success { background-color: #DEF6CF; color: #55A21F; }
.status-select-failure { background-color: #FFEBEE; color: #EA3752; }
