/* =========================
   ElektRea B2B – Clean UI (single source)
   ========================= */

/* -------------------------
   Base + variables
   ------------------------- */
.b2b{
    --ek-green:#4CAF50;
    --ek-green-dark:#1b5e20;
    --ek-bg:#f6f7f8;
    --ek-card:#ffffff;
    --ek-border:#e6e6e6;
    --ek-text:#111827;
    --ek-muted:#6b7280;

    margin:0;
    min-height: 100vh;
    display:flex;
    flex-direction:column;

    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    line-height: 1.45;
    color: var(--ek-text);

    background:
            radial-gradient(900px 500px at 50% -100px, rgba(76,175,80,.18), transparent 60%),
            var(--ek-bg);
}

/* consistent sizing everywhere */
.b2b *, .b2b *::before, .b2b *::after{ box-sizing:border-box; }

html{ scrollbar-gutter: stable; }

/* -------------------------
   Layout wrapper
   ------------------------- */
.b2b-wrap{
    flex:1;
    width:100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 18px 44px 18px;
}

/* Page header */
.b2b-pagehead{
    max-width: 1100px;
    margin: 0 auto 14px auto;
}

.b2b-page-title{
    text-align:center;
    font-size: 30px;
    letter-spacing: -0.02em;
    margin: 8px 0;
}

.b2b-muted{
    color:var(--ek-muted);
    font-size:.95em;
    line-height:1.35;
}

/* -------------------------
   Cards
   ------------------------- */
.b2b-card{
    background: var(--ek-card);
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 16px;
    padding: 22px;
    margin: 12px 0;
    box-shadow:
            0 1px 0 rgba(0,0,0,.03),
            0 14px 40px rgba(17,24,39,.07);
    position: relative;
}

.b2b-card::before{
    content:"";
    position:absolute;
    left: 14px;
    right: 14px;
    top: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(76,175,80,1), rgba(27,94,32,.9));
    opacity: .22;
}

.b2b-card h2{ margin:0 0 12px 0; }

/* Optional dashboard bits */
.b2b-card-title{
    font-weight: 900;
    letter-spacing: -0.01em;
}
.b2b-card-big{
    font-size: 38px;
    font-weight: 950;
    margin-top: 6px;
    color: #0f172a;
}

/* -------------------------
   Grid (general)
   ------------------------- */
.b2b-grid{
    display:grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items:start;

    /* LOCK: never shrink */
    width:100%;
    max-width: 1100px;
    margin-left:auto;
    margin-right:auto;
}
.b2b-grid > *{ min-width:0; }

@media (max-width: 900px){
    .b2b-grid{ grid-template-columns: 1fr; }
}

/* Ticket view: left column cards stack nicely + no margins inside grid */
.b2b-grid > div{
    display:grid;
    gap: 16px;
}
.b2b-grid .b2b-card{
    margin:0;
    width:100%;
}

/* -------------------------
   Topbar / navigation
   ------------------------- */
.b2b-topbar{
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(180deg, rgba(76,175,80,1) 0%, rgba(76,175,80,.92) 100%);
    border-bottom: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 6px 20px rgba(17,24,39,.08);
}

.b2b-topbar-inner{
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 10px 18px;
    display:flex;
    align-items:center;
    gap: 14px;
}

/* left/center/right layout */
.b2b-left{ flex:0 0 auto; }
.b2b-center{ flex:1 1 auto; display:flex; justify-content:center; }
.b2b-right{ flex:0 0 auto; display:flex; align-items:center; gap:12px; }

/* logo */
.b2b-logo-link{ display:flex; align-items:center; text-decoration:none; }
.b2b-logo{ height:34px; width:auto; display:block; }

/* tabs */
.b2b-tabs{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:center; }

.b2b-tab{
    text-decoration:none;
    color:#000;
    font-weight:800;
    padding:8px 12px;
    border-radius:999px;
    border:1px solid rgba(0,0,0,.12);
    background: rgba(255,255,255,.14);
    transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.b2b-tab:hover{
    background: rgba(255,255,255,.22);
    transform: translateY(-1px);
}
.b2b-tab.active{
    background: rgba(255,255,255,.96);
    border-color: rgba(255,255,255,.96);
    box-shadow: 0 1px 0 rgba(0,0,0,.06), inset 0 0 0 1px rgba(0,0,0,.05);
    color:#000;
}

/* user right */
.b2b-user{
    color:#000;
    font-weight:800;
    opacity:.95;
    white-space:nowrap;
}
.b2b-logout{
    text-decoration:none;
    color:#000;
    font-weight:900;
    padding: 8px 10px;
    border-radius:10px;
}
.b2b-logout:hover{ background: rgba(255,255,255,.18); }

/* -------------------------
   Tables (invoices)
   ------------------------- */
.b2b-table-wrap{ overflow:auto; }

.b2b-table{
    width:100%;
    min-width: 720px;
    border-collapse: collapse;
}

.b2b-table thead th{
    background: linear-gradient(180deg, #fbfbfb, #f6f7f8);
    color: var(--ek-muted);
    font-size:13px;
    text-align:left;
    padding:12px 10px;
    border-bottom:1px solid #eee;
    white-space:nowrap;
}

.b2b-table td{
    padding:12px 10px;
    border-bottom:1px solid #eee;
    vertical-align:middle;
    white-space:nowrap;
}

.b2b-table tbody tr:hover{ background:#fcfcfc; }
.b2b-table .text-end{ text-align:right; }

/* badges */
.b2b-badge{
    display:inline-block;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    line-height:1;
}

/* Betaald = groen */
.b2b-badge-success{
    background:#4CAF50;
    color:#ffffff;
}

/* Verzonden = blauw */
.b2b-badge-primary{
    background:#3b82f6;
    color:#ffffff;
}

/* Gefinaliseerd = oranje/geel */
.b2b-badge-info{
    background:#f59e0b;
    color:#111827;
}

/* Geannuleerd / fallback = grijs */
.b2b-badge-muted{
    background:#9ca3af;
    color:#ffffff;
}


/* buttons */
.b2b-btn-sm{
    display:inline-block;
    text-decoration:none;
    font-weight:900;
    padding:8px 12px;
    border-radius:12px;
    border: 1px solid rgba(27,94,32,.25);
    background: rgba(76,175,80,.12);
    color: #0f172a;
    transition: transform .08s ease, filter .12s ease, background .12s ease;
}
.b2b-btn-sm:hover{
    background: rgba(76,175,80,.18);
    transform: translateY(-1px);
}

/* -------------------------
   Forms
   ------------------------- */
.b2b-form{ display:grid; gap:12px; margin-top:12px; }

.b2b-form label{
    display:block;
    font-weight:700;
    color:#111;
}

/* shared inputs */
.b2b-form input,
.b2b-form textarea,
.b2b-form select{
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
    padding: 12px 44px 12px 12px; /* extra rechts voor caret */
    border: 1px solid #d6d6d6;
    border-radius: 14px;
    background: #fff;
    font-size: 15px;
    line-height: 1.2;
    transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

/* select caret */
.b2b-form select{
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background-image:
            linear-gradient(45deg, transparent 50%, #111827 50%),
            linear-gradient(135deg, #111827 50%, transparent 50%),
            linear-gradient(to right, transparent, transparent);
    background-position:
            calc(100% - 18px) calc(50% - 4px),
            calc(100% - 12px) calc(50% - 4px),
            calc(100% - 44px) 50%;
    background-size: 6px 6px, 6px 6px, 1px 22px;
    background-repeat:no-repeat;
}

/* focus */
.b2b-form input:focus,
.b2b-form textarea:focus,
.b2b-form select:focus{
    outline:none;
    border-color: rgba(76,175,80,.65);
    box-shadow: 0 0 0 4px rgba(76,175,80,.18);
}

/* disabled */
.b2b-form select:disabled,
.b2b-form input:disabled,
.b2b-form textarea:disabled{
    background:#f3f4f6;
    color:#6b7280;
    cursor:not-allowed;
}

.b2b-form select option[value=""]{ color:#6b7280; }

/* form primary button */
.b2b-form button{
    width:100%;
    padding:12px 14px;
    border-radius:14px;
    border: 1px solid rgba(27,94,32,.25);
    background: linear-gradient(180deg, rgba(76,175,80,.22), rgba(76,175,80,.12));
    font-weight: 900;
    cursor:pointer;
    transition: transform .08s ease, filter .12s ease;
}
.b2b-form button:hover{
    filter: brightness(.98);
    transform: translateY(-1px);
}

/* -------------------------
   Ticket list (clickable cards)
   ------------------------- */
.b2b-ticket-link{
    text-decoration:none;
    color:inherit;
    display:block;
}
.b2b-ticket-link:visited,
.b2b-ticket-link:hover{ color:inherit; }

.b2b-list{ display:grid; gap:12px; }
.b2b-ticket-card{ margin:0; }

.b2b-ticket-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.b2b-status{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:12px;
    font-weight:900;
    color: rgba(17,24,39,.75);
    white-space:nowrap;
}
.b2b-status::before{
    content:"";
    width:8px; height:8px;
    border-radius:999px;
    background: rgba(76,175,80,.8);
}

.b2b-ticket-link .b2b-card{
    transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}
.b2b-ticket-link:hover .b2b-card{
    transform: translateY(-1px);
    border-color: rgba(17,24,39,.14);
    box-shadow:
            0 1px 0 rgba(0,0,0,.03),
            0 18px 45px rgba(17,24,39,.10);
}

/* -------------------------
   Chat / Messages
   ------------------------- */
.b2b-chat{
    display:grid;
    gap:12px;
    margin-top:10px;
}

.b2b-msg-row{
    display:flex;
    margin: 8px 0;
}
.b2b-msg-row.left{ justify-content:flex-start; }
.b2b-msg-row.right{ justify-content:flex-end; }

.b2b-msg-bubble{
    max-width: 520px;
    width: fit-content;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 14px;
    padding: 10px 12px;
    background:#fff;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

.b2b-msg-bubble.is-customer{
    background: #E9F6EA;
    border-color: rgba(76,175,80,.35);
}
.b2b-msg-bubble.is-admin{ background:#fff; }

.b2b-msg-meta{
    font-size:12px;
    opacity:.7;
    margin-bottom:4px;
    color: var(--ek-muted);
}
.b2b-msg-text{
    font-size:14px;
    line-height:1.4;
}

/* compose */
.b2b-msg-compose{
    display:grid;
    gap:10px;
    margin-top: 10px;
}

.b2b-input, .b2b-textarea{
    width:100%;
    border:1px solid rgba(0,0,0,.15);
    border-radius: 12px;
    padding: 10px 12px;
    background:#fff;
    outline:none;
}

.b2b-textarea{ min-height:110px; resize:vertical; }

.b2b-input:focus, .b2b-textarea:focus{
    border-color: rgba(76,175,80,.55);
    box-shadow: 0 0 0 3px rgba(76,175,80,.15);
}

.b2b-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border-radius:12px;
    padding:10px 14px;
    border:1px solid rgba(0,0,0,.15);
    background:#E9F6EA;
    font-weight:700;
    cursor:pointer;
    transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}
.b2b-btn:hover{
    border-color: rgba(76,175,80,.45);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.b2b-btn:active{ transform: translateY(1px); }

/* -------------------------
   Custom file upload
   ------------------------- */
.b2b-upload{
    display:flex;
    flex-wrap:wrap;
    gap: 10px 12px;
    align-items:center;
}

.b2b-upload-input{ display:none; }

.b2b-upload-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(27,94,32,.25);
    background: rgba(76,175,80,.14);
    color:#0f172a;
    font-weight:900;
    cursor:pointer;
    transition: transform .08s ease, filter .12s ease, background .12s ease;
}
.b2b-upload-btn:hover{
    background: rgba(76,175,80,.22);
    transform: translateY(-1px);
}

.b2b-upload-filename{
    width:100%;
    font-size:13px;
    color: var(--ek-muted);
}

/* -------------------------
   Alerts
   ------------------------- */
.b2b-alert{
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(17,24,39,.12);
    margin: 12px 0;
    font-weight:700;
}
.b2b-alert-danger{
    border-color: rgba(185, 28, 28, .35);
    background: rgba(185, 28, 28, .08);
    color: #7f1d1d;
}

/* -------------------------
   Auth (login)
   ------------------------- */
.b2b-auth{
    flex:1;
    min-height: auto;
    display:flex;
    align-items:center;
    justify-content:center;
    padding-top: 18px;
    padding-bottom: 24px;
}

.b2b-auth-inner{
    width:100%;
    transform: translateY(-18px);
}

.b2b-auth-title{
    text-align:center;
    margin:0 0 6px 0;
}
.b2b-auth-sub{
    text-align:center;
    margin-bottom:14px;
}

.b2b-auth-card{ padding:22px; }

.b2b-auth-form{ margin-top:0; gap:14px; }
.b2b-auth-form input{ padding:12px 14px; border-radius:14px; }

.b2b-auth-form button{
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 950;
}

/* -------------------------
   Footer
   ------------------------- */
.b2b-footer{
    margin-top: 28px;
    padding: 18px 12px;
    text-align:center;
    color:#4b5563;
    font-size:13px;
    opacity:.9;
}

.b2b-footer a{
    color:#1f2937;
    font-weight:700;
    text-decoration:none;
}
.b2b-footer a:hover{ text-decoration:underline; }

.b2b-footer-inner{
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}
.b2b-footer-sep{ opacity:.6; }

/* -------------------------
   Small helpers
   ------------------------- */
.b2b-login-header{
    padding:16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}
.b2b-ticket-title{
    display:flex;
    align-items:center;
    gap:10px;
}

.b2b-issue-meta{
    display:grid;
    gap:10px;
    margin-bottom:12px;
}

.b2b-issue-row{
    display:flex;
    gap:12px;
    align-items:baseline;
    padding:10px 12px;
    border:1px solid var(--ek-border);
    background:#f7f9f7;
    border-radius:14px;
}

.b2b-issue-key{
    min-width:140px;
    font-weight:900;
    color:var(--ek-text);
}

.b2b-issue-val{
    color:var(--ek-text);
    word-break:break-word;
}
.print-title{ font-size:22px; font-weight:900; }

.print-ticket-big{
    text-align:center;
    font-weight:900;
    font-size:22px;
    margin: 50px 0 10px;   /* meer ruimte boven en onder */
}
.b2b-note{
    margin-top:14px;
    padding:12px 14px;
    border:1px solid var(--ek-border);
    background: var(--ek-card);
    border-radius:14px;
    font-size:.95rem;
    color: var(--ek-muted);
}
.b2b-note strong{ color: var(--ek-text); }
.b2b-note a{ color: var(--ek-green-dark); text-decoration: none; font-weight: 600; }
.b2b-note a:hover{ text-decoration: underline; }
/* user right: netjes als pill */
.b2b-userpill{
    display:flex;
    align-items:center;
    gap:10px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(255,255,255,.18);
}

.b2b-user{
    color:#0b0b0b;
    font-weight:900;
    opacity:.95;
    white-space:nowrap;
    font-size:14px;
}

.b2b-user-sep{
    width:1px;
    height:18px;
    background: rgba(0,0,0,.18);
}

.b2b-logout{
    text-decoration:none;
    color:#0b0b0b;
    font-weight:950;
    padding: 6px 10px;
    border-radius:999px;
    line-height:1;
}
.b2b-logout:hover{ background: rgba(255,255,255,.22); }
