/* ==========================================================
   EDS Sales Force — Brand Stylesheet
   Palette pulled from the EDS logo: near-black, red, grays, white
   ========================================================== */

:root {
    --eds-black: #1a1a1a;
    --eds-dark: #232323;
    --eds-red: #c8102e;
    --eds-red-dark: #a10d25;
    --eds-gray: #555555;
    --eds-gray-light: #f2f2f2;
    --eds-border: #e2e2e2;
    --eds-white: #ffffff;
    --eds-success: #1e7e34;
    --eds-warning: #b9840c;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    background: #f7f7f8;
    color: #222;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--eds-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top nav ---------- */
.eds-topbar {
    background: var(--eds-black);
    color: var(--eds-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 3px solid var(--eds-red);
}
.eds-topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.eds-topbar .brand img { height: 32px; width: auto; }
.eds-topbar nav { display: flex; gap: 20px; align-items: center; }
.eds-topbar nav a { color: #ddd; font-size: 14px; font-weight: 500; }
.eds-topbar nav a:hover { color: var(--eds-white); text-decoration: none; }
.eds-topbar .user-chip {
    background: var(--eds-dark);
    border: 1px solid #3a3a3a;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: #ccc;
}
.menu-toggle { display: none; }

/* ---------- Layout ---------- */
.eds-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}
.eds-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.eds-page-header h1 {
    font-size: 26px;
    margin: 0 0 4px;
    color: var(--eds-black);
}
.eds-page-header p { margin: 0; color: var(--eds-gray); font-size: 14px; }

/* ---------- Cards ---------- */
.eds-card {
    background: var(--eds-white);
    border: 1px solid var(--eds-border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}
.eds-card h2 {
    font-size: 18px;
    margin: 0 0 16px;
    color: var(--eds-black);
    border-bottom: 2px solid var(--eds-red);
    padding-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--eds-red); color: #fff; }
.btn-primary:hover { background: var(--eds-red-dark); text-decoration: none; }
.btn-dark { background: var(--eds-black); color: #fff; }
.btn-dark:hover { background: #000; text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--eds-border); color: var(--eds-black); }
.btn-outline:hover { border-color: var(--eds-red); color: var(--eds-red); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--eds-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-main);
    margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--eds-red);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Tabs ---------- */
.eds-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--eds-border);
    margin-bottom: 20px;
}
.eds-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--eds-gray);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
}
.eds-tab:hover { background: var(--eds-gray-light); }
.eds-tab.active { color: var(--eds-black); border-bottom-color: var(--eds-red); background: var(--eds-gray-light); }
.eds-tab-panel { display: none; }
.eds-tab-panel.active { display: block; }

/* ---------- Service picker rows ---------- */
.service-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.service-row:last-child { border-bottom: none; }
.service-row .check { padding-top: 3px; }
.service-row .info { flex: 1; }
.service-row .info .name { font-weight: 600; font-size: 15px; color: var(--eds-black); }
.service-row .info .desc { font-size: 13px; color: var(--eds-gray); margin-top: 2px; }
.service-row .controls { display: flex; align-items: center; gap: 8px; min-width: 180px; justify-content: flex-end; }
.service-row .price-tag { font-weight: 700; color: var(--eds-red); font-size: 14px; min-width: 90px; text-align: right; }
.qty-input { width: 70px; margin-bottom: 0 !important; text-align: center; }
.tier-select { margin-bottom: 0 !important; min-width: 170px; }

/* ---------- Tables ---------- */
table.eds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.eds-table th {
    text-align: left;
    background: var(--eds-black);
    color: #fff;
    padding: 10px 14px;
    font-size: 13px;
}
table.eds-table td { padding: 10px 14px; border-bottom: 1px solid #eee; }
table.eds-table tr:nth-child(even) td { background: #fafafa; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-draft { background: #e9e9e9; color: #555; }
.badge-sent { background: #fff3cd; color: var(--eds-warning); }
.badge-viewed { background: #e0ecff; color: #1b4fa0; }
.badge-signed { background: #dff0d8; color: var(--eds-success); }
.badge-paid { background: var(--eds-black); color: #fff; }
.badge-void { background: #f8d7da; color: #a10d25; }

/* ---------- Summary sidebar ---------- */
.summary-box {
    position: sticky;
    top: 84px;
    background: var(--eds-black);
    color: #fff;
    border-radius: 10px;
    padding: 22px;
}
.summary-box h3 { margin: 0 0 14px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; color: #ccc; }
.summary-line { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #333; color: #ddd; }
.summary-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-top: 14px; color: var(--eds-red); }
.summary-total.monthly { color: #fff; font-size: 15px; font-weight: 600; margin-top: 6px; }

/* ---------- Client-facing signing page ---------- */
.client-page { background: var(--eds-black); min-height: 100vh; padding: 40px 16px; }
.client-card { max-width: 760px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 40px; }
.client-header { text-align: center; margin-bottom: 30px; }
.client-header img { height: 70px; margin-bottom: 12px; }
.client-header h1 { font-size: 22px; margin: 0; color: var(--eds-black); }
.sign-box { border: 2px dashed var(--eds-border); border-radius: 8px; padding: 24px; margin-top: 24px; background: #fafafa; }
.pay-box { border: 1px solid var(--eds-border); border-radius: 8px; padding: 24px; margin-top: 24px; text-align: center; }

.helper-text { font-size: 12px; color: var(--eds-gray); margin-top: -10px; margin-bottom: 16px; }
.alert { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #f8d7da; color: #842029; border: 1px solid #f1aeb5; }
.alert-success { background: #dff0d8; color: #1e7e34; border: 1px solid #b2dba1; }

/* ==========================================================
   MOBILE RESPONSIVE
   ========================================================== */

@media (max-width: 1200px) {

    /* Nav — hamburger */
    .eds-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }
    .eds-topbar nav {
        display: none !important;
        flex-direction: column;
        width: 100%;
        gap: 0;
        border-top: 1px solid #333;
        padding-top: 10px;
    }
    .eds-topbar nav.open {
        display: flex !important;
    }
    .eds-topbar nav a,
    .eds-topbar nav .user-chip {
        padding: 10px 0;
        border-bottom: 1px solid #2a2a2a;
        font-size: 15px;
        color: #ddd;
    }
    .menu-toggle {
        display: block !important;
        background: none;
        border: none;
        color: #fff;
        font-size: 26px;
        cursor: pointer;
        margin-left: auto;
        padding: 0;
    }

    /* Container */
    .eds-container {
        padding: 16px 14px 60px;
    }

    /* Page header */
    .eds-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .eds-page-header h1 {
        font-size: 20px;
    }

    /* Proposal builder — stack columns */
    #proposalForm > div[style*="grid"] {
        display: block !important;
    }
    .summary-box {
        position: static;
        margin-top: 20px;
    }

    /* Tabs — scroll horizontally */
    .eds-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .eds-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Service rows */
    .service-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .service-row .controls {
        min-width: unset;
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
        padding-left: 28px;
    }

    /* Tables — horizontal scroll */
    .eds-card {
        padding: 16px;
        overflow-x: auto;
    }
    table.eds-table {
        min-width: 500px;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Client detail grid */
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }
    div[style*="grid-template-columns: 1fr 1fr"] > div {
        margin-bottom: 16px;
    }

    /* Billing cycle form */
    form[style*="align-items:center"] {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* Badges */
    .badge {
        font-size: 11px;
    }

    /* Client signing page */
    .client-card {
        padding: 24px 16px;
    }
    .client-header img {
        height: 50px;
    }
    .client-header h1 {
        font-size: 18px;
    }
/* Client signing page — checkbox */
    .sign-box input[type=checkbox] {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px;
        margin-top: 2px;
        cursor: pointer;
    }
    .sign-box label {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 14px;
        line-height: 1.5;
    }
    .sign-box input[type=text],
    .sign-box input[type=email] {
        font-size: 16px;
        padding: 12px;
    }
    .sign-box button[type=submit] {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 16px;
    }
}