/* 24PetLine SaaS Prototype Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

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

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

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

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.page-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

.page-content {
    padding: 32px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 24px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

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

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

tr:hover {
    background: var(--gray-50);
}

tr:last-child td {
    border-bottom: none;
}

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

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Auth Layout */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 32px;
}

/* Lead Detail */
.lead-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-label {
    width: 140px;
    font-size: 14px;
    color: var(--gray-500);
    flex-shrink: 0;
}

.info-value {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 500;
}

.fraud-score {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.fraud-score.low {
    background: #d1fae5;
}

.fraud-score.medium {
    background: #fef3c7;
}

.fraud-score.high {
    background: #fee2e2;
}

.fraud-score-value {
    font-size: 24px;
    font-weight: 700;
}

.fraud-score.low .fraud-score-value {
    color: #065f46;
}

.fraud-score.medium .fraud-score-value {
    color: #92400e;
}

.fraud-score.high .fraud-score-value {
    color: #991b1b;
}

.fraud-signals {
    list-style: none;
}

.fraud-signal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
}

.fraud-signal.pass {
    color: var(--success);
}

.fraud-signal.fail {
    color: var(--danger);
}

/* Call Detail */
.audio-player {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.audio-player audio {
    width: 100%;
}

.transcript {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.transcript-line {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.transcript-speaker {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.transcript-speaker.ai {
    background: var(--primary);
    color: white;
}

.transcript-speaker.caller {
    background: var(--gray-300);
    color: var(--gray-700);
}

.transcript-text {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Multi-step Form */
.multi-step-form {
    max-width: 600px;
    margin: 0 auto;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

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

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-500);
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 14px;
    color: var(--gray-500);
}

.step.active .step-label {
    color: var(--gray-900);
    font-weight: 500;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 12px;
}

.step-connector.completed {
    background: var(--success);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

/* Usage Meter */
.usage-meter {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 20px;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.usage-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.usage-value {
    font-size: 14px;
    color: var(--gray-500);
}

.usage-value strong {
    color: var(--gray-900);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state-icon svg {
    width: 32px;
    height: 32px;
    color: var(--gray-400);
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* Trial Page */
.trial-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
}

.trial-header {
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trial-header a {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.trial-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.trial-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.trial-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.trial-subtitle {
    font-size: 16px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lead-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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

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

    .page-content {
        padding: 20px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}
