:root {
    --primary: #135bec;
    --primary-dark: #1049bc;
    --bg-light: #f6f6f8;
    --bg-dark: #101622;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-light: #e2e8f0;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.05);
}

html, body {
    font-family: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    vertical-align: middle;
}

a, .btn-link {
    color: var(--primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 700;
    min-height: 2.35rem;
}

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

h1, h2, h3 {
    color: var(--text-main);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

h1:focus {
    outline: none;
}

.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-shell {
    flex: 1;
}

.public-container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(8px);
}

.public-header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.public-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.public-brand-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
}

.public-brand-icon-muted {
    background: #e2e8f0;
    color: #475569;
}

.public-brand-text {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.public-nav {
    display: none;
    gap: 1.2rem;
}

.public-nav a {
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.93rem;
}

.public-nav a:hover {
    color: var(--primary);
}

.public-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 0.52rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.public-login-btn:hover {
    background: var(--primary-dark);
    color: #fff;
}

.hero-section {
    padding: 3.5rem 0 2.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    background: rgba(19, 91, 236, 0.12);
    color: var(--primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.33rem 0.7rem;
    font-weight: 800;
}

.hero-chip-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 6px rgba(19, 91, 236, 0.2);
}

.hero-copy h1 {
    font-size: clamp(2rem, 5.2vw, 3.85rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 1rem 0;
}

.hero-copy h1 span {
    color: var(--primary);
}

.hero-copy p {
    color: #475569;
    max-width: 60ch;
    font-size: 1.05rem;
    line-height: 1.65;
}

.hero-actions {
    margin-top: 1.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    padding: 0.8rem 1.25rem;
    font-weight: 800;
}

.hero-btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 28px rgba(19, 91, 236, 0.24);
}

.hero-btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.hero-btn-secondary {
    background: #fff;
    color: #0f172a;
    border: 1px solid var(--border-light);
}

.hero-btn-secondary:hover {
    color: #0f172a;
    background: #f8fafc;
}

.hero-visual {
    position: relative;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: -0.6rem;
    border-radius: 1.4rem;
    background: linear-gradient(125deg, rgba(19, 91, 236, 0.2), rgba(45, 212, 191, 0.15));
    filter: blur(16px);
}

.hero-visual-box {
    position: relative;
    border-radius: 1.1rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: #fff;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.15);
}

.hero-visual-box img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.stats-section {
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: #fff;
    padding: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.stat-card {
    background: #f8fafc;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    padding: 1rem 1.1rem;
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 0;
}

.stat-main {
    margin: 0.45rem 0;
    font-size: 1.9rem;
    font-weight: 900;
}

.stat-pos, .stat-neg {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.86rem;
    font-weight: 800;
}

.stat-pos {
    color: #16a34a;
}

.stat-neg {
    color: #dc2626;
}

.features-section {
    padding: 4rem 0;
}

.features-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 2rem;
}

.features-head h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.45rem);
    font-weight: 900;
}

.features-head p {
    color: #475569;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.3rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
    border-color: rgba(19, 91, 236, 0.45);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.09);
    transform: translateY(-2px);
}

.feature-icon {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.75rem;
    background: rgba(19, 91, 236, 0.14);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin-bottom: 0.8rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: #64748b;
    margin: 0;
}

.cta-section {
    padding: 0 0 4rem;
}

.cta-box {
    border-radius: 1.45rem;
    background: #0f172a;
    color: #fff;
    text-align: center;
    padding: 2.4rem 1.2rem;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: "";
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(19, 91, 236, 0.34) 0%, rgba(19, 91, 236, 0) 60%);
}

.cta-box h2, .cta-box p, .cta-box a {
    position: relative;
}

.cta-box h2 {
    color: #fff;
    font-weight: 900;
    margin-bottom: 0.7rem;
}

.cta-box p {
    color: #cbd5e1;
    margin-bottom: 1.1rem;
}

.app-page {
    width: min(1200px, 100%);
    margin-inline: auto;
    padding: 0.65rem 0 1.45rem;
}

.page-head {
    margin-bottom: 1.25rem;
}

.page-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.page-subtitle {
    color: #64748b;
    max-width: 70ch;
    margin-bottom: 0;
}

.surface-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.surface-header {
    padding: 1.05rem 1.15rem 0.65rem;
    border-bottom: 1px solid #edf2f7;
}

.surface-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.surface-header p {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.surface-body {
    padding: 1.05rem 1.15rem;
}

.data-table {
    margin-bottom: 0;
}

.data-table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    border-bottom-width: 1px;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.data-table td {
    vertical-align: middle;
    padding-top: 0.78rem;
    padding-bottom: 0.78rem;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 800;
}

.status-success {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.status-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #92400e;
}

.status-danger {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.timeline-list .list-group-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    margin-bottom: 0.5rem;
}

.app-form-card {
    max-width: 840px;
}

.form-control, .form-select {
    border-color: #d1d5db;
    border-radius: var(--radius-md);
    min-height: 2.55rem;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(19, 91, 236, 0.48);
    box-shadow: 0 0 0 0.2rem rgba(19, 91, 236, 0.14);
}

.btn-outline-primary {
    border-color: rgba(19, 91, 236, 0.4);
    color: var(--primary);
}

.btn-outline-primary:hover {
    border-color: var(--primary);
    background: var(--primary);
}

.section-title-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.section-title-inline .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.1rem;
}

.modal-actions {
    margin-top: 0.65rem;
}

.public-footer {
    border-top: 1px solid var(--border-light);
    background: #fff;
}

.public-footer-inner {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
}

.public-footer-links {
    display: flex;
    gap: 1rem;
}

.public-footer-links a {
    text-decoration: none;
    color: #64748b;
}

.public-footer-links a:hover {
    color: var(--primary);
}

.kpi-card {
    background: #ffffff;
    border: 1px solid #dce3ea;
    border-radius: 10px;
    padding: 0.9rem;
}

.kpi-title {
    color: #6c7a89;
    font-size: 0.85rem;
}

.kpi-value {
    color: #1f2d3d;
    font-weight: 800;
    font-size: 1.5rem;
}

.kpi-critical {
    border-color: #d9534f;
    background: #fff6f6;
}

.auth-wrapper {
    min-height: calc(100vh - 64px - 72px);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: 0 12px 30px rgba(17, 75, 119, 0.12);
}

.auth-subtitle {
    color: #6c7a89;
    margin-bottom: 1rem;
}

.auth-tip {
    margin-top: 0.9rem;
    font-size: 0.8rem;
    color: #6c7a89;
}

.crm-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 1050;
    padding: 1rem;
}

.crm-modal .card {
    width: min(640px, 95vw);
}

.modal-surface {
    width: min(640px, 95vw);
    border-radius: var(--radius-lg);
}

.seg-modal-surface {
    width: min(760px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.seg-modal-header {
    padding: 1.2rem 1.25rem 0.9rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.seg-modal-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
}

.seg-modal-subtitle {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.95rem;
}

.seg-form-body {
    padding: 1.15rem 1.25rem 1.25rem;
    max-height: calc(90vh - 110px);
    overflow-y: auto;
}

.seg-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.seg-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.seg-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
}

.seg-input-wrap {
    position: relative;
}

.seg-input {
    min-height: 2.95rem;
    border-color: #dbe3ed;
    border-radius: 0.65rem;
}

.seg-select {
    padding-right: 2.25rem;
}

.seg-leading-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.15rem;
    pointer-events: none;
}

.seg-trailing-icon {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.15rem;
    pointer-events: none;
}

.seg-input-icon {
    padding-left: 2.3rem;
}

.seg-priority-group {
    min-height: 2.95rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.seg-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.92rem;
    color: #334155;
}

.seg-radio input {
    accent-color: #13ec37;
}

.seg-urgent {
    color: #ef4444;
    font-weight: 700;
}

.seg-notes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.seg-required {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    font-weight: 800;
}

.seg-textarea {
    border-color: #dbe3ed;
    border-radius: 0.65rem;
    min-height: 110px;
    padding: 0.75rem 0.85rem;
    resize: vertical;
}

.seg-upload-zone {
    border: 2px dashed #dbe3ed;
    border-radius: 0.65rem;
    min-height: 100px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    color: #64748b;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.seg-upload-zone:hover {
    background: #f1f5f9;
}

.seg-upload-zone .material-symbols-outlined {
    color: #94a3b8;
}

.seg-upload-zone p {
    margin: 0;
    font-size: 0.82rem;
}

.seg-actions {
    border-top: 1px solid #edf2f7;
    padding-top: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.seg-cancel-btn {
    color: #64748b;
    text-decoration: none;
    font-weight: 700;
}

.seg-cancel-btn:hover {
    color: #1f2937;
}

.seg-save-btn {
    background: #13ec37;
    color: #102213;
    font-weight: 800;
    border: 1px solid #13ec37;
    border-radius: 0.65rem;
    min-height: 2.95rem;
    padding: 0.5rem 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 8px 18px rgba(19, 236, 55, 0.25);
}

.hist-modal-surface {
    width: min(980px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hist-modal-body {
    max-height: calc(90vh - 110px);
    overflow-y: auto;
}

.hist-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.seg-save-btn:hover {
    background: #10d432;
    border-color: #10d432;
}

.seg-save-btn:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .seg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .public-nav {
        display: flex;
    }

    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.4rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

@media (min-width: 1100px) {
    .features-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
