:root {
    --ct-primary: #21d0a1;
    --ct-primary-dark: #10a37f;
    --ct-navy: #17212f;
    --ct-navy-soft: #223047;
    --ct-text: #1f2937;
    --ct-muted: #6b7280;
    --ct-border: #e5e7eb;
    --ct-bg: #f5f7fb;
    --ct-card: #ffffff;
    --ct-danger: #b42318;
    --ct-success: #067647;
    --ct-warning: #b54708;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--ct-text);
    background: var(--ct-bg);
}

a {
    color: var(--ct-primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 270px;
    background: var(--ct-navy);
    color: #ffffff;
    padding: 24px 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--ct-primary);
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .2px;
}

.brand-subtitle {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 2px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.side-nav a {
    color: #dbe4ef;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.side-nav a:hover {
    text-decoration: none;
    background: var(--ct-navy-soft);
    color: #ffffff;
}

.main-area {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
}

.topbar {
    height: 84px;
    background: #ffffff;
    border-bottom: 1px solid var(--ct-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.page-system-title {
    font-size: 17px;
    font-weight: 800;
}

.page-system-subtitle {
    font-size: 13px;
    color: var(--ct-muted);
    margin-top: 3px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ct-border);
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 13px;
    color: var(--ct-muted);
}

.user-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ct-primary-dark);
}

.content-area {
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 850;
}

.page-description {
    margin: 8px 0 0;
    color: var(--ct-muted);
    font-size: 14px;
}

.card {
    background: var(--ct-card);
    border: 1px solid var(--ct-border);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
    margin-bottom: 22px;
}

.card-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--ct-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.card-body {
    padding: 22px;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 200px auto auto;
    gap: 12px;
    align-items: end;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
    font-size: 13px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: var(--ct-text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--ct-primary-dark);
    box-shadow: 0 0 0 3px rgba(33, 208, 161, .18);
    outline: none;
}

.form-textarea {
    min-height: 92px;
    resize: vertical;
}

.required {
    color: var(--ct-danger);
}

.form-help {
    margin-top: 6px;
    color: var(--ct-muted);
    font-size: 12px;
}

.field-error {
    display: block;
    color: var(--ct-danger);
    margin-top: 6px;
    font-size: 12px;
}

.btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    min-height: 40px;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--ct-primary);
    color: #06131f;
}

.btn-primary:hover {
    background: #1bbd92;
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--ct-border);
    color: var(--ct-text);
}

.btn-secondary:hover {
    background: #f9fafb;
}

.btn-danger {
    background: #fff5f5;
    border-color: #fecaca;
    color: var(--ct-danger);
}

.btn-sm {
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-active {
    color: var(--ct-success);
    background: #ecfdf3;
}

.status-prospect,
.status-on-hold {
    color: var(--ct-warning);
    background: #fffaeb;
}

.status-cancelled {
    color: var(--ct-danger);
    background: #fff5f5;
}

.status-inactive {
    color: #475467;
    background: #f2f4f7;
}

.grid {
    width: 100%;
    border-collapse: collapse;
}

.grid th {
    background: #f8fafc;
    color: #475467;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 13px 14px;
    border-bottom: 1px solid var(--ct-border);
}

.grid td {
    padding: 14px;
    border-bottom: 1px solid var(--ct-border);
    vertical-align: middle;
    font-size: 14px;
}

.grid tr:last-child td {
    border-bottom: 0;
}

.grid-primary {
    font-weight: 800;
}

.grid-secondary {
    color: var(--ct-muted);
    font-size: 12px;
    margin-top: 3px;
}

.alert {
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 18px;
    font-weight: 650;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: var(--ct-success);
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: var(--ct-danger);
}

.validation-summary {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: var(--ct-danger);
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.section-divider {
    height: 1px;
    background: var(--ct-border);
    margin: 24px 0;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: 100%;
    }

    .app-shell {
        display: block;
    }

    .main-area {
        width: 100%;
        margin-left: 0;
    }

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

    .topbar,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 20px;
    }

    .content-area {
        padding: 20px;
    }
}
