/* EUSBD Enquiry Hub v7.2 */

*,*::before,*::after{box-sizing:border-box;}

/* ── STANDALONE BODY ── */
body.eusbd-standalone{margin:0;padding:0;min-height:100vh;background:#f1f5f9;color:#0f172a;font-family:'Segoe UI',system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5;}

/* ── HEADER ── */
.eusbd-header{background:#0f172a;color:#fff;box-shadow:0 1px 4px rgba(0,0,0,.15);position:sticky;top:0;z-index:100;}
.eusbd-header-inner{max-width:1550px;margin:0 auto;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;}
.eusbd-header-left{display:flex;align-items:center;gap:12px;}
.eusbd-header-icon{height:40px;width:40px;border-radius:14px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);flex-shrink:0;display:none;}
.eusbd-header-logo{height:44px;width:44px;border-radius:10px;object-fit:cover;flex-shrink:0;background:#fff;padding:2px;}
.eusbd-header-title{font-size:20px;font-weight:600;margin:0;line-height:1.3;}
.eusbd-header-sub{font-size:12px;color:#94a3b8;margin:2px 0 0;}
.eusbd-header-nav{display:flex;align-items:center;gap:8px;}
.eusbd-nav-btn{display:inline-block;padding:8px 18px;border-radius:9999px;border:1px solid rgba(255,255,255,.3);background:transparent;color:#fff;font-size:14px;cursor:pointer;font-family:inherit;transition:background .15s;}
.eusbd-nav-btn:hover{background:rgba(255,255,255,.08);}
.eusbd-nav-btn.active{background:#fff;color:#0f172a;border-color:#fff;}

/* ── MAIN ── */
.eusbd-main{max-width:1550px;margin:0 auto;padding:32px 24px;}

/* ── CARDS ── */
.eusbd-card{background:#fff;border-radius:22px;border:1px solid #cbd5e1;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:hidden;}
.eusbd-card-narrow{max-width:900px;margin:0 auto;}
.eusbd-card-header{padding:24px 32px;border-bottom:1px solid #e2e8f0;background:#f8fafc;}
.eusbd-card-header h2,.eusbd-card-header h3{font-size:22px;font-weight:600;margin:0;color:#0f172a;}
.eusbd-card-body{padding:32px;}
.eusbd-subtitle{font-size:14px;color:#64748b;margin:4px 0 0;}

/* ── GRID ── */
.eusbd-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:20px 32px;}
@media(max-width:768px){.eusbd-grid-2{grid-template-columns:1fr;}}

/* ── FIELDS ── */
.eusbd-field{margin-bottom:0;}
.eusbd-field label{display:block;font-size:14px;font-weight:500;color:#334155;margin-bottom:4px;}
.eusbd-field label .req{color:#dc2626;}
.eusbd-field input[type="text"],.eusbd-field input[type="email"],.eusbd-field input[type="number"],.eusbd-field input[type="file"],.eusbd-field select,.eusbd-field textarea{width:100%;border-radius:12px;border:1px solid #cbd5e1;padding:12px 16px;background:#fff;font-size:14px;font-family:inherit;color:#0f172a;outline:none;transition:border-color .15s;-webkit-appearance:none;appearance:none;}
.eusbd-field select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;padding-right:36px;}
.eusbd-field input:focus,.eusbd-field select:focus,.eusbd-field textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.12);}
.eusbd-field textarea{resize:vertical;min-height:140px;}
.eusbd-full{margin-top:20px;}

/* ── READ-ONLY ── */
.eusbd-ro{margin-bottom:0;}
.eusbd-ro label{display:block;font-size:12px;color:#64748b;margin-bottom:4px;}
.eusbd-ro-box{border-radius:12px;border:1px solid #cbd5e1;background:#f8fafc;padding:10px 14px;font-size:14px;color:#0f172a;min-height:42px;}

/* ── BUTTONS ── */
.eusbd-btn-primary{display:inline-block;padding:12px 22px;border-radius:12px;background:#0f172a;color:#fff;font-weight:500;font-size:14px;border:none;cursor:pointer;font-family:inherit;transition:background .15s;}
.eusbd-btn-primary:hover{background:#1e293b;}
.eusbd-btn-secondary{display:inline-block;padding:10px 18px;border-radius:12px;background:#fff;color:#334155;font-size:14px;border:1px solid #cbd5e1;cursor:pointer;font-family:inherit;}
.eusbd-btn-secondary:hover{background:#f8fafc;}
.eusbd-actions{margin-top:20px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;}

/* ── MESSAGES ── */
.eusbd-message{padding:14px 20px;border-radius:12px;margin-bottom:20px;font-size:14px;}
.eusbd-message.success{background:#ecfdf5;border:1px solid #a7f3d0;color:#047857;}
.eusbd-message.error{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;}
.eusbd-inline-msg{font-size:14px;color:#047857;}

/* ── SPINNER ── */
.eusbd-spinner{display:inline-block;width:20px;height:20px;border:2px solid #e2e8f0;border-top-color:#0f172a;border-radius:50%;animation:eusbd-spin .6s linear infinite;}
@keyframes eusbd-spin{to{transform:rotate(360deg);}}

/* ── STATUS RESULT ── */
.eusbd-status-result{margin-top:24px;border-radius:12px;border:1px solid #cbd5e1;padding:20px;background:#fff;}
.eusbd-status-result h3{font-size:18px;font-weight:600;margin:0 0 16px;}

/* ═══ WORKSPACE THREE-COLUMN GRID ═══ */
.eusbd-workspace-grid{display:grid;grid-template-columns:5fr 4fr 3fr;gap:24px;align-items:start;}
@media(max-width:1200px){.eusbd-workspace-grid{grid-template-columns:1fr;}}

/* ── PANELS ── */
.eusbd-panel{background:#fff;border-radius:22px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid #cbd5e1;overflow:hidden;}
.eusbd-panel-header{padding:16px 20px;border-bottom:1px solid #e2e8f0;background:#f8fafc;}
.eusbd-panel-header h3{font-weight:600;margin:0;color:#0f172a;font-size:16px;}
.eusbd-panel-body{padding:20px;}
.eusbd-detail-grid{font-size:14px;}
.eusbd-detail-grid .eusbd-field label{font-size:13px;}
.eusbd-detail-grid .eusbd-field select{padding:8px 12px;font-size:14px;}
.eusbd-right-col{display:flex;flex-direction:column;gap:24px;}

/* ── ACTIVITY ── */
.eusbd-muted{font-size:12px;color:#64748b;margin:0 0 12px;}
.eusbd-activity-list{list-style:none;margin:0;padding:0;max-height:700px;overflow-y:auto;}
.eusbd-activity-item{padding:12px;border-radius:12px;margin-bottom:12px;}
.eusbd-activity-item:last-child{margin-bottom:0;}
.eusbd-activity-email{border:1px solid #bae6fd;background:#f0f9ff;}
.eusbd-activity-comment{border:1px solid #a7f3d0;background:#ecfdf5;}
.eusbd-activity-note{border:1px solid #fde68a;background:#fffbeb;}
.eusbd-activity-system{border:1px solid #e2e8f0;background:#fff;}
.eusbd-activity-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.eusbd-activity-time{font-size:12px;color:#64748b;}
.eusbd-activity-who{font-size:11px;padding:2px 8px;border-radius:9999px;background:#fff;border:1px solid #e2e8f0;color:#475569;}
.eusbd-activity-text{margin:6px 0 0;font-size:14px;color:#0f172a;}

/* ── COMPOSE ── */
.eusbd-compose-modes{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
.eusbd-mode-btn{padding:6px 14px;border-radius:9999px;border:1px solid #cbd5e1;background:#fff;color:#334155;font-size:12px;cursor:pointer;font-family:inherit;transition:all .15s;}
.eusbd-mode-btn.active,.eusbd-mode-btn:hover{background:#0f172a;color:#fff;border-color:#0f172a;}
#eusbd-compose-text{width:100%;border-radius:12px;border:1px solid #cbd5e1;padding:12px 16px;font-size:14px;font-family:inherit;resize:vertical;min-height:140px;outline:none;}
#eusbd-compose-text:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.12);}
.eusbd-record-info{display:flex;flex-direction:column;gap:12px;}
.eusbd-record-info .eusbd-ro-box{padding:8px 12px;font-size:14px;}

/* ── ADMIN WRAP ── */
.eusbd-admin-wrap{font-family:'Segoe UI',system-ui,-apple-system,sans-serif;color:#0f172a;max-width:1200px;}
.eusbd-admin-wrap .eusbd-field input,.eusbd-admin-wrap .eusbd-field select{max-width:100%;}

@media(max-width:640px){
    .eusbd-header-inner{flex-direction:column;align-items:flex-start;gap:12px;}
    .eusbd-header-nav{width:100%;}
    .eusbd-nav-btn{flex:1;text-align:center;}
}

/* ── Enquiry selector bar ── */
.eusbd-selector-bar{background:#fff;border:1px solid #cbd5e1;border-radius:16px;padding:14px 20px;margin-bottom:24px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;box-shadow:0 1px 3px rgba(0,0,0,.06);}
.eusbd-selector-bar label{font-size:14px;font-weight:600;color:#0f172a;white-space:nowrap;}
.eusbd-selector-bar select{flex:1;min-width:200px;border-radius:12px;border:1px solid #cbd5e1;padding:10px 36px 10px 14px;font-size:14px;font-family:inherit;color:#0f172a;background:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;-webkit-appearance:none;appearance:none;outline:none;}
.eusbd-selector-bar select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.12);}

/* ═══ DASHBOARD: Filters bar ═══ */
.eusbd-filters-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:20px;}
.eusbd-filter-select{border-radius:10px;border:1px solid #cbd5e1;padding:9px 32px 9px 12px;font-size:13px;font-family:inherit;color:#0f172a;background:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;-webkit-appearance:none;appearance:none;outline:none;}
.eusbd-filter-select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.12);}
.eusbd-filter-search{flex:1;min-width:200px;}
.eusbd-filter-search input{width:100%;border-radius:10px;border:1px solid #cbd5e1;padding:9px 14px;font-size:13px;font-family:inherit;color:#0f172a;outline:none;}
.eusbd-filter-search input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.12);}
.eusbd-filter-actions{display:flex;gap:8px;flex-shrink:0;}

/* ═══ DASHBOARD: Stats row ═══ */
.eusbd-stats-row{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;margin-bottom:24px;}
@media(max-width:900px){.eusbd-stats-row{grid-template-columns:repeat(3,1fr);}}.
@media(max-width:600px){.eusbd-stats-row{grid-template-columns:repeat(2,1fr);}}
.eusbd-stat-card{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:18px 24px;text-align:center;box-shadow:0 1px 3px rgba(0,0,0,.04);border-top:3px solid #e2e8f0;}
.eusbd-stat-number{font-size:32px;font-weight:700;color:#0f172a;line-height:1.1;}
.eusbd-stat-label{font-size:13px;color:#64748b;margin-top:4px;text-transform:uppercase;letter-spacing:.03em;}
.eusbd-stat-open{border-top-color:#3b82f6;} .eusbd-stat-open .eusbd-stat-number{color:#2563eb;}
.eusbd-stat-pending{border-top-color:#f59e0b;} .eusbd-stat-pending .eusbd-stat-number{color:#d97706;}
.eusbd-stat-resolved{border-top-color:#10b981;} .eusbd-stat-resolved .eusbd-stat-number{color:#059669;}
.eusbd-stat-sla{border-top-color:#ef4444;} .eusbd-stat-sla .eusbd-stat-number{color:#dc2626;}

/* ═══ DASHBOARD: Table ═══ */
.eusbd-table{width:100%;border-collapse:collapse;font-size:14px;}
.eusbd-table thead{background:#f8fafc;}
.eusbd-table th{padding:12px 14px;text-align:left;font-weight:600;color:#475569;border-bottom:1px solid #e2e8f0;font-size:12px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;}
.eusbd-table td{padding:13px 14px;border-bottom:1px solid #f1f5f9;color:#0f172a;vertical-align:middle;}
.eusbd-table-row-link{cursor:pointer;transition:background .1s;}
.eusbd-table-row-link:hover{background:#f0f9ff;}
.eusbd-badge{display:inline-block;padding:3px 10px;border-radius:9999px;font-size:12px;font-weight:500;white-space:nowrap;}
.eusbd-badge-open{background:#dbeafe;color:#1d4ed8;}
.eusbd-badge-pending{background:#fef3c7;color:#92400e;}
.eusbd-badge-on-hold{background:#e2e8f0;color:#475569;}
.eusbd-badge-resolved{background:#d1fae5;color:#065f46;}
.eusbd-badge-closed{background:#f1f5f9;color:#64748b;}
.eusbd-badge-low{background:#f1f5f9;color:#475569;}
.eusbd-badge-moderate{background:#fef3c7;color:#92400e;}
.eusbd-badge-high{background:#fed7aa;color:#9a3412;}
.eusbd-badge-urgent{background:#fecaca;color:#991b1b;}
.eusbd-sla-ok{color:#059669;font-size:13px;font-weight:500;}
.eusbd-sla-breach{color:#dc2626;font-size:13px;font-weight:600;}

/* ═══ LOGIN PAGE ═══ */
.eusbd-login-card{width:100%;max-width:440px;background:#fff;border-radius:22px;border:1px solid #cbd5e1;box-shadow:0 4px 24px rgba(0,0,0,.08);padding:40px 36px;text-align:center;}
.eusbd-login-logo{margin-bottom:24px;}
.eusbd-login-logo img{width:72px;height:72px;border-radius:16px;object-fit:cover;box-shadow:0 2px 12px rgba(0,0,0,.1);}
.eusbd-login-title{font-size:24px;font-weight:700;color:#0f172a;margin:0 0 6px;}
.eusbd-login-sub{font-size:14px;color:#64748b;margin:0 0 28px;}
.eusbd-login-card .eusbd-field{text-align:left;}
.eusbd-login-card .eusbd-field label{font-size:13px;font-weight:600;color:#334155;margin-bottom:6px;}
.eusbd-login-card .eusbd-field input[type="text"],
.eusbd-login-card .eusbd-field input[type="password"]{padding:13px 16px;font-size:15px;border-radius:12px;}

/* Sign out link in header */
.eusbd-header-user{font-size:13px;color:#94a3b8;padding:0 4px;}
.eusbd-nav-btn-logout{border-color:rgba(255,255,255,.2) !important;font-size:13px !important;padding:6px 14px !important;opacity:.8;}
.eusbd-nav-btn-logout:hover{opacity:1;background:rgba(255,255,255,.1) !important;}

/* ═══ PAGINATION ═══ */
.eusbd-pagination{display:flex;align-items:center;justify-content:space-between;margin-top:20px;flex-wrap:wrap;gap:12px;}
.eusbd-pagination-info{font-size:13px;color:#64748b;}
.eusbd-pagination-links{display:flex;gap:4px;}
.eusbd-page-link{display:inline-block;padding:8px 14px;border-radius:8px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;text-decoration:none;font-size:14px;transition:background .15s;}
.eusbd-page-link.active,.eusbd-page-link:hover{background:#0f172a;color:#fff;border-color:#0f172a;}

/* ═══ COMPOSE ATTACHMENT ═══ */
.eusbd-compose-attachment{margin-top:10px;margin-bottom:4px;}
.eusbd-file-label{font-size:13px;color:#94a3b8;padding:6px 0;}
.eusbd-file-label.has-file{color:#0f172a;font-weight:500;}
.eusbd-compose-hint{font-size:12px;color:#94a3b8;margin-top:10px;margin-bottom:0;}

/* ═══ EMAIL TEMPLATE IN COMPOSE ═══ */
.eusbd-email-template{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;margin-bottom:8px;overflow:hidden;}
.eusbd-email-header-bar{background:#0f172a;padding:10px 14px;display:flex;align-items:center;gap:10px;}
.eusbd-email-logo{width:28px;height:28px;border-radius:6px;object-fit:cover;background:#fff;padding:1px;}
.eusbd-email-brand{color:#fff;font-size:13px;font-weight:600;letter-spacing:.02em;}
.eusbd-email-fields{padding:10px 14px;border-bottom:1px solid #e2e8f0;}
.eusbd-email-field-row{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:12px;}
.eusbd-email-label{color:#64748b;font-weight:600;min-width:52px;}
.eusbd-email-value{color:#0f172a;font-size:12px;word-break:break-all;}
.eusbd-email-greeting{padding:10px 14px 6px;font-size:13px;color:#334155;}

.eusbd-email-signature{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:10px 14px;margin-top:8px;}
.eusbd-email-signature p{margin:0;font-size:13px;color:#334155;line-height:1.5;}

/* Taller compose textarea */
#eusbd-compose-text{min-height:180px;}

/* ═══ ANALYTICS GRID ═══ */
.eusbd-analytics-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:28px;}
@media(max-width:900px){.eusbd-analytics-grid{grid-template-columns:1fr;}}

/* Vertical bar chart */
.eusbd-bar-chart{display:flex;align-items:flex-end;gap:8px;height:160px;padding-top:8px;}
.eusbd-bar-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;}
.eusbd-bar-value{font-size:12px;font-weight:600;color:#0f172a;margin-bottom:4px;}
.eusbd-bar-track{flex:1;width:100%;max-width:40px;background:#f1f5f9;border-radius:6px 6px 0 0;position:relative;overflow:hidden;display:flex;align-items:flex-end;}
.eusbd-bar-fill{width:100%;border-radius:6px 6px 0 0;transition:height .4s ease;min-height:3px;}
.eusbd-bar-label{font-size:11px;color:#64748b;margin-top:6px;font-weight:500;}

/* Horizontal bar chart */
.eusbd-horiz-bars{display:flex;flex-direction:column;gap:10px;}
.eusbd-hbar-row{display:flex;align-items:center;gap:10px;}
.eusbd-hbar-label{font-size:12px;color:#334155;min-width:80px;font-weight:500;text-align:right;}
.eusbd-hbar-track{flex:1;height:20px;background:#f1f5f9;border-radius:10px;overflow:hidden;}
.eusbd-hbar-fill{height:100%;border-radius:10px;transition:width .4s ease;min-width:4px;}
.eusbd-hbar-value{font-size:13px;font-weight:600;color:#0f172a;min-width:28px;}

/* Priority legend */
.eusbd-priority-donut{display:flex;flex-direction:column;gap:14px;padding:8px 0;}
.eusbd-donut-item{display:flex;align-items:center;gap:10px;}
.eusbd-donut-dot{width:14px;height:14px;border-radius:4px;flex-shrink:0;}
.eusbd-donut-label{font-size:14px;color:#334155;flex:1;}
.eusbd-donut-value{font-size:18px;font-weight:700;color:#0f172a;}
