* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
}

a {
    color: inherit;
}


/* LOGIN */

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        linear-gradient(
            135deg,
            #172554,
            #0f172a
        );
}

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

.brand {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
}

.tagline {
    text-align: center;
    margin-top: 6px;
    margin-bottom: 30px;
    color: #64748b;
}

.login-card label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 16px;
}

.login-card button {
    width: 100%;
    margin-top: 24px;
    padding: 13px;
    border: 0;
    border-radius: 7px;
    background: #1e3a8a;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: #94a3b8;
    font-size: 13px;
}


/* APP */

.topbar {
    height: 64px;
    background: #0f172a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.topbar a {
    color: white;
}

.app-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 20px 0;
}

.sidebar a {
    display: block;
    padding: 13px 22px;
    text-decoration: none;
    color: #334155;
}

.sidebar a:hover {
    background: #f1f5f9;
}

.content {
    flex: 1;
    padding: 34px;
}

.content h1 {
    margin-bottom: 5px;
}

.subheading {
    color: #64748b;
    margin-top: 0;
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,.04);
}

.dashboard-card span {
    display: block;
    color: #64748b;
    margin-bottom: 10px;
}

.dashboard-card strong {
    display: block;
    font-size: 34px;
}

.dashboard-section {
    margin-top: 30px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

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

.button-primary {
    display: inline-block;
    padding: 11px 18px;
    background: #1e3a8a;
    color: white;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
}

.filter-bar {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.filter-bar form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.filter-bar input {
    min-width: 280px;
}

.filter-bar button {
    padding: 10px 16px;
    border: 0;
    background: #334155;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.table-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-size: 13px;
    color: #475569;
}

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

.table-action {
    text-decoration: none;
    font-weight: 600;
    color: #1e3a8a;
}

.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}
.form-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 28px;
}

.form-card h2 {
    margin-top: 30px;
    margin-bottom: 16px;
}

.form-card h2:first-child {
    margin-top: 0;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    margin-bottom: 6px;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 15px;
    background: white;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.button-secondary {
    display: inline-block;
    padding: 11px 18px;
    background: white;
    color: #334155;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-weight: 600;
}

.button-small {
    display: inline-block;
    padding: 8px 12px;
    background: #1e3a8a;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}


/* CONTACT PAGE */

.contact-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 24px;
}

.contact-header h1 {
    margin-top: 8px;
    margin-bottom: 4px;
}

.back-link {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

.contact-company {
    color: #64748b;
    margin-bottom: 10px;
}

.contact-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.contact-source {
    font-size: 13px;
    color: #64748b;
}

.contact-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
}

.summary-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 7px;
}

.summary-card strong,
.summary-card a {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
}

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

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

.detail-label {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 5px;
}

.note-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.notes-list {
    margin-top: 24px;
}

.note-item {
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}

.note-item:last-child {
    border-bottom: none;
}

.note-text {
    white-space: normal;
    line-height: 1.5;
}

.note-meta {
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
}

.task-list {
    display: flex;
    flex-direction: column;
}

.task-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
}

.task-row:last-child {
    border-bottom: none;
}

.task-meta {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-user,
.activity-time {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.empty-state {
    color: #64748b;
}


/* MOBILE */

@media (max-width: 800px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .contact-header {
        flex-direction: column;
    }

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

    .form-group-full,
    .detail-full {
        grid-column: auto;
    }

    .content {
        padding: 20px;
    }

}

.table-subtext {
    margin-top: 3px;
    font-size: 11px;
    color: #94a3b8;
}

.estimate-row-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.estimate-status-draft {
    background: #e2e8f0;
}

.estimate-status-sent {
    background: #dbeafe;
    color: #1e40af;
}

.estimate-status-viewed {
    background: #fef3c7;
    color: #92400e;
}

.estimate-status-approved {
    background: #dcfce7;
    color: #166534;
}

.estimate-status-declined {
    background: #fee2e2;
    color: #991b1b;
}

.estimate-status-expired,
.estimate-status-cancelled {
    background: #f1f5f9;
    color: #64748b;
}