/* ============================================================
   MTC Weborders — gestyled in de huisstijl van mtcbv.nl
   Brand: oranje #E7531E, donkerblauw #02242D, hover #173B4B
   Fonts: DM Sans (headings) + Nunito Sans (body)
   ============================================================ */

:root {
    --mtc-orange: #E7531E;
    --mtc-orange-hover: #c8431a;
    --mtc-dark: #02242D;
    --mtc-dark-hover: #173B4B;
    --mtc-grey-50: #f7f8f9;
    --mtc-grey-100: #eef0f2;
    --mtc-grey-200: #dde1e5;
    --mtc-grey-300: #c2c8cf;
    --mtc-grey-500: #6b7480;
    --mtc-text: #02242D;
    --mtc-border: #dde1e5;
    --mtc-shadow: 0 2px 8px rgba(2, 36, 45, 0.06);
    --mtc-shadow-md: 0 4px 16px rgba(2, 36, 45, 0.08);
    --mtc-radius: 6px;
}

/* ---------- Reset / Base ------------------------------------ */
body {
    margin: 0;
    padding: 0;
    background: #FFFFFF;
    color: var(--mtc-text);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

a, a:visited {
    color: var(--mtc-orange);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--mtc-dark-hover);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: var(--mtc-dark);
    font-weight: 700;
    margin: 0 0 12px 0;
}

h1 { font-size: 28px; line-height: 1.25; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 500; color: var(--mtc-grey-500); }
h3 { font-size: 18px; line-height: 1.35; }

/* ---------- Layout: wrapper + mainDiv ----------------------- */
/* Override van Global.css' oude 900px/absolute trucs */
#wrapper {
    position: static !important;
    width: auto !important;
    right: auto !important;
    height: auto !important;
    width: 95vw;
    margin: 0 auto;
    padding: 24px 24px 40px 24px;
}

.mainDiv {
    position: static !important;
    left: auto !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent;
    border-radius: 0;
}

/* ---------- Header / logo ----------------------------------- */
.header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px 0 24px 0;
    border-bottom: 1px solid var(--mtc-border);
    color: var(--mtc-dark);
    margin-bottom: 28px;
}

.header #logo {
    float: none;
    background: url('../../images/logo-mtc-charleston.svg') no-repeat left center;
    background-size: contain;
    width: 200px;
    height: 60px;
    flex-shrink: 0;
}

.header .rest {
    float: none;
    padding-top: 0;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
}

.header .rest h1 {
    margin: 0;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--mtc-dark);
    white-space: nowrap;
}

/* ---------- Menu (horizontaal) ------------------------------ */
#menu {
    width: 100%;
}

#menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

#menu ul li {
    float: none;
    display: inline-flex;
}

#menu ul li span {
    width: auto;
    height: auto;
    padding: 8px 14px;
    margin: 0;
    border-radius: var(--mtc-radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--mtc-dark);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    white-space: nowrap;
}

#menu ul li span svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

#menu ul li span svg * {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#menu ul li a,
#menu ul li a:visited,
#menu li a.current {
    color: var(--mtc-dark);
    text-decoration: none;
}

#menu li span:hover,
#menu li span.current:hover {
    background: var(--mtc-grey-100);
    background-image: none;
    width: auto;
    height: auto;
    padding: 8px 14px;
    margin: 0;
}

#menu li span:hover a,
#menu li span.current:hover a {
    color: var(--mtc-orange);
}

#menu li span:hover svg {
    opacity: 1;
}

/* h2 subtitel net onder de header */
.mainDiv > h2 {
    width: auto;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 400;
    color: var(--mtc-grey-500);
}

/* ---------- Buttons ----------------------------------------- */
input[type="submit"],
input[type="reset"],
input[type="button"],
button {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    background: var(--mtc-orange);
    color: #FFFFFF;
    border: none;
    border-radius: var(--mtc-radius);
    padding: 9px 18px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
button:hover {
    background: var(--mtc-dark-hover);
    color: #FFFFFF;
    border-color: transparent;
}

input[type="submit"]:active,
input[type="reset"]:active,
input[type="button"]:active,
button:active {
    transform: translateY(1px);
}

/* "Refresh" e.d. — secundair (geen oranje vlak) */
input[type="button"][value="Refresh"] {
    background: transparent;
    color: var(--mtc-dark);
    border: 1px solid var(--mtc-border);
}

input[type="button"][value="Refresh"]:hover {
    background: var(--mtc-grey-100);
    color: var(--mtc-dark);
}

/* ---------- Form inputs ------------------------------------- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
select,
textarea {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: var(--mtc-text);
    background: #FFFFFF;
    border: 1px solid var(--mtc-border);
    border-radius: var(--mtc-radius);
    padding: 7px 10px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--mtc-orange);
    box-shadow: 0 0 0 3px rgba(231, 83, 30, 0.12);
}

/* ---------- Tabellen (algemeen) ----------------------------- */
.mainDiv table {
    text-align: left;
    border-collapse: separate;
    border-spacing: 0;
    border: 0;
    width: 100%;
}

.mainDiv table th,
.mainDiv table .thr th,
.mainDiv table .thr td {
    padding: 12px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #FFFFFF;
    background: var(--mtc-orange);
    border: 0;
    height: auto;
    text-align: left;
}

.mainDiv table th a,
.mainDiv table th a:visited {
    color: #FFFFFF;
    text-decoration: none;
}

.mainDiv table th a:hover {
    color: var(--mtc-orange);
}

.mainDiv table td {
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--mtc-border);
    background: #FFFFFF;
    vertical-align: middle;
    font-size: 14px;
    color: var(--mtc-text);
}

/* Iconen in grid-rijen */
.tbl td a svg {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    color: var(--mtc-grey-500);
    transition: color 0.15s ease;
}

.tbl td a:hover svg {
    color: var(--mtc-orange);
}

.tbl td a svg * {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Datagrid: orderhistorie / adresboek (.tbl class) */
.mainDiv .tbl {
    background: #FFFFFF;
    border-radius: var(--mtc-radius);
    overflow: hidden;
    box-shadow: var(--mtc-shadow);
    margin-bottom: 28px;
}

.mainDiv .tbl thead th:first-child,
.mainDiv .tbl .thr th:first-child,
.mainDiv .tbl .thr td:first-child {
    border-top-left-radius: var(--mtc-radius);
}

.mainDiv .tbl thead th:last-child,
.mainDiv .tbl .thr th:last-child,
.mainDiv .tbl .thr td:last-child {
    border-top-right-radius: var(--mtc-radius);
}

/* Zebra rows */
.mainDiv .tbl tbody tr:nth-child(even) td {
    background: var(--mtc-grey-50);
}

/* Hover */
.mainDiv .tbl tbody tr:hover td {
    background: rgba(231, 83, 30, 0.07);
}

.mainDiv .tbl tbody tr:last-child td {
    border-bottom: 0;
}

/* Pager (DataGrid PagerStyle) */
.mainDiv table tr td[colspan] table {
    margin: 8px 0;
}

.mainDiv .tbl tr td a[href*="Page"],
.mainDiv .tbl td span {
    /* pager numbers */
}

/* "Geen orders" leeg-state tabel */
#pnlGeenOrders {
    margin-bottom: 28px;
}

#pnlGeenOrders .dgrOrders td[colspan] {
    background: #FFFFFF;
    padding: 32px 16px !important;
    text-align: center;
    color: var(--mtc-grey-500);
    font-style: italic;
    border-bottom: 0;
}

/* ---------- Zoek-panel onder de tabel ----------------------- */
.mainDiv > table:last-of-type:not(.dgrAdressen) {
    background: var(--mtc-grey-50);
    border: 1px solid var(--mtc-border);
    border-radius: var(--mtc-radius);
    padding: 16px;
    width: auto;
    max-width: 560px;
}

.mainDiv > table:last-of-type:not(.dgrAdressen) th {
    background: transparent;
    color: var(--mtc-dark);
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    padding: 6px 8px;
}

.mainDiv > table:last-of-type:not(.dgrAdressen) td {
    background: transparent;
    border: 0;
    padding: 6px 8px;
}

/* ---------- Validators -------------------------------------- */
.mainDiv span[style*="color:Red"],
.aspNetDisabled,
[id*="reqSearch"],
[id*="regSearch"],
[id*="reqDate"] {
    color: var(--mtc-orange) !important;
    font-size: 13px;
    font-weight: 600;
    margin-left: 6px;
}

/* ---------- Tooltip ----------------------------------------- */
#tooltip div {
    background: var(--mtc-dark);
    color: #FFFFFF;
    border: 0;
    border-radius: var(--mtc-radius);
    box-shadow: var(--mtc-shadow-md);
    padding: 10px 12px;
    font-size: 13px;
}

/* ---------- Login-pagina specifiek (legacy fallback) -------- */
.loginBox {
    top: 20%;
    width: 500px;
    min-height: 220px;
    left: 71%;
}

.loginBox table {
    width: 100%;
}

.loginBox table th {
    background: #FFFFFF url('../../images/logo-mtc-charleston.svg') no-repeat 10px center;
    background-size: 180px auto;
    height: 100px;
    color: var(--mtc-dark);
    text-align: right;
}

/* ---------- Input-combo (dropdown + textbox als één veld) --- */
.input-combo {
    display: flex;
}

.input-combo select {
    border-right: none;
    border-radius: var(--mtc-radius) 0 0 var(--mtc-radius);
    flex: 1;
    min-width: 0;
}

.input-combo input[type="text"] {
    border-radius: 0 var(--mtc-radius) var(--mtc-radius) 0;
    flex: 1;
    min-width: 0;
}

/* ---------- Nieuwe order ------------------------------------ */
#tblNewOrder_contact,
#tblNewOrder_algemenegegevens {
    width: 100%;
}

#tblNewOrder_ophaalgegevens {
    width: 100%;
}

.txtMedium {
    width: 140px;
    box-sizing: border-box;
}

#tblNewOrder_contact td,
#tblOphaal td,
#tblAflever td,
#tblNewOrder_algemenegegevens td {
    border-bottom: 0;
    padding-top: 4px;
    padding-bottom: 4px;
}

.req-label::after {
    content: " *";
    color: var(--mtc-orange);
    font-size: 0.75em;
    vertical-align: super;
}

/* ---------- Adresboek formulieren --------------------------- */
#tblNewAdres td,
#tblAdresDetail td {
    border-bottom: 0;
    padding: 4px 0;
}

#tblNewAdres,
#tblAdresDetail {
    width: auto;
}

#tblNewAdres input[type="text"],
#tblNewAdres textarea,
#tblAdresDetail input[type="text"],
#tblAdresDetail textarea {
    width: 300px;
}

.adres-buttons {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.dgrAdressen {
    width: 100%;
}

.col-center {
    text-align: center;
}

/* ---------- Afmetingen (legacy) ----------------------------- */
.afmetingTekst { padding-left: 10px !important; }
.afmetingTekst input { margin-left: -5px; }
.tblAfmetingen table th {
    background: none !important;
    color: var(--mtc-dark) !important;
}

/* ---------- Nieuwe order layout ----------------------------- */
.order-adres-wrapper {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
}

#tblOphaal,
#tblAflever {
    flex: 1;
    min-width: 0;
}

.order-goederen {
    margin-top: 16px;
}

.goederen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* ---------- Goederen modal ---------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 36, 45, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: var(--mtc-radius);
    box-shadow: var(--mtc-shadow-md);
    padding: 28px 32px;
    width: 640px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box h3 {
    margin-bottom: 16px;
}

.modal-form-tbl {
    width: 100%;
}

.modal-form-tbl td {
    padding: 7px 12px 7px 0;
    vertical-align: middle;
    border-bottom: 1px solid var(--mtc-border);
}

.modal-form-tbl tr:last-child td {
    border-bottom: 0;
}

.modal-form-tbl td:first-child {
    width: 130px;
    white-space: nowrap;
    color: var(--mtc-grey-500);
    font-size: 14px;
}

.modal-section-hdr {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: var(--mtc-dark);
    padding-top: 14px !important;
    padding-bottom: 4px !important;
    border-bottom: 2px solid var(--mtc-border) !important;
}

.modal-form-tbl tr:first-child .modal-section-hdr {
    padding-top: 0 !important;
}

.modal-auto {
    font-size: 12px;
    color: var(--mtc-grey-500);
    font-style: italic;
    margin-left: 4px;
    margin-right: 10px;
}

.modal-inline-label {
    font-size: 14px;
    color: var(--mtc-grey-500);
    margin-right: 4px;
}

.modal-note {
    font-size: 12px;
    color: var(--mtc-grey-500);
    font-style: italic;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
}

.modal-buttons {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#btnGoederenOpslaanNieuw {
    background: transparent;
    color: var(--mtc-orange);
    border: 1px solid var(--mtc-orange);
}

#btnGoederenOpslaanNieuw:hover {
    background: var(--mtc-orange);
    color: #fff;
}

/* ---------- Order type select --------------------------------- */
.order-type-select {
    padding: 24px 0;
}

.order-type-intro {
    font-size: 16px;
    color: var(--mtc-grey-500);
    margin: 0 0 32px 0;
}

.order-type-cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.order-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 210px;
    min-height: 220px;
    padding: 24px 18px 20px;
    background: #fff;
    border: 2px solid var(--mtc-border);
    border-radius: 12px;
    color: var(--mtc-dark);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: var(--mtc-shadow);
    box-sizing: border-box;
}

.order-type-card:hover,
.order-type-card:focus {
    border-color: var(--mtc-orange);
    box-shadow: 0 6px 24px rgba(231, 83, 30, 0.15);
    transform: translateY(-2px);
    color: var(--mtc-orange);
    text-decoration: none;
}

.order-type-card-icon svg {
    width: 64px;
    height: 64px;
    stroke: currentColor;
}

.order-type-card-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1.3;
}

.order-type-card-desc {
    font-size: 13px;
    color: var(--mtc-grey-500);
    text-align: center;
    line-height: 1.5;
    font-weight: 400;
}

/* ---------- Order type badge (on new order screen) ------------ */
.order-type-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.order-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mtc-dark);
    color: #fff;
    border-radius: 20px;
    padding: 5px 14px 5px 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.02em;
}

.order-type-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.order-type-badge-change {
    font-size: 13px;
    color: var(--mtc-grey-500);
    text-decoration: none;
    border-bottom: 1px dashed var(--mtc-grey-300);
}

.order-type-badge-change:hover {
    color: var(--mtc-orange);
    border-bottom-color: var(--mtc-orange);
}

/* ---------- Responsive ---------------------------------------- */
@media (max-width: 768px) {
    #wrapper {
        padding: 12px 12px 32px 12px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 0;
    }

    .header #logo {
        width: 140px;
        height: 42px;
    }

    .header .rest h1 {
        font-size: 18px;
    }

    /* Titel en subtitel verbergen op smal scherm */
    .header .rest h1,
    .mainDiv > h2 {
        display: none;
    }

    /* Kolommen verbergen in orderhistorie op smal scherm */
    .col-hide-md {
        display: none;
    }

    /* Overige DataGrids (niet orderhistorie, niet adresboek) horizontaal scrollbaar */
    .mainDiv .tbl:not(.dgrOrders):not(.dgrAdressen) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Zoek-/filterpanelen full width */
    .mainDiv > table:last-of-type {
        max-width: 100%;
    }

    /* Formuliervelden full width op smal scherm */
    .txtMedium, .txtSmall, .txtXSmall,
    .cmbMedium, .cmbLarge {
        width: 100%;
        box-sizing: border-box;
    }

    /* Contact en Algemene Gegevens full-width op smal scherm */
    #tblNewOrder_contact,
    #tblNewOrder_algemenegegevens {
        width: 100%;
    }

    /* Adresboek formulieren full-width op smal scherm */
    #tblNewAdres,
    #tblAdresDetail {
        width: 100%;
    }

    /* Nieuwe order: ophaal/aflever onder elkaar op smal scherm */
    .order-adres-wrapper {
        flex-direction: column;
    }
    #tblOphaal,
    #tblAflever {
        width: 100%;
    }
    #tblOphaal td:last-child input[type="text"],
    #tblOphaal td:last-child select,
    #tblOphaal td:last-child textarea,
    #tblAflever td:last-child input[type="text"],
    #tblAflever td:last-child select,
    #tblAflever td:last-child textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}
