/* ============================================================================
   PlayCamps — Global Stylesheet
   Design: Professional admin with warm, confident palette
   Font: DM Sans (headers) + Source Sans 3 (body)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
    /* Primary palette — warm teal + coral accent */
    --primary: #0F766E;
    --primary-light: #14B8A6;
    --primary-dark: #0D5D56;
    --primary-bg: #F0FDFA;

    --accent: #F97316;
    --accent-light: #FDBA74;
    --accent-bg: #FFF7ED;

    /* Neutrals */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Status */
    --success: #059669;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --info: #2563EB;
    --info-bg: #EFF6FF;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Source Sans 3', -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-900);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* ---- App Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: var(--gray-300);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    color: white;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-brand small {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-400);
    font-weight: 400;
    font-family: 'Source Sans 3', sans-serif;
    margin-top: 1px;
}

.sidebar-section {
    padding: 16px 16px 8px;
}

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    padding: 0 8px;
    margin-bottom: 6px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(20, 184, 166, 0.15);
    color: var(--primary-light);
}

.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ---- Top Header ---- */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header-left h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-400);
}

.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--gray-300); }

.top-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Page Container ---- */
.page-container {
    padding: 28px 32px;
    max-width: 1400px;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 2px;
}

/* ---- Cards ---- */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.card-body { padding: 24px; }
.card-body.no-padding { padding: 0; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

thead th {
    background: var(--gray-50);
    padding: 11px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr:last-child td { border-bottom: none; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; }

.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { background: #EA6A0C; color: white; }

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #B91C1C; color: white; }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #047857; color: white; }

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    padding: 6px 10px;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    color: var(--gray-800);
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.form-control::placeholder { color: var(--gray-400); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px;
}

select[multiple].form-control {
    background-image: none;
    padding-right: 12px;
    min-height: 100px;
}

select[multiple].form-control option {
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 2px;
}

select[multiple].form-control option:checked {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.88rem;
    color: var(--gray-700);
    cursor: pointer;
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-accent { background: var(--accent-bg); color: var(--accent); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ---- Alerts / Flash Messages ---- */
.alert-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: alertSlideIn 0.3s ease;
    cursor: pointer;
}

.alert-success { background: var(--success); color: white; }
.alert-danger { background: var(--danger); color: white; }
.alert-warning { background: var(--warning); color: white; }
.alert-info { background: var(--info); color: white; }

@keyframes alertSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 95%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.25s ease;
}

.modal-lg { max-width: 740px; }

.modal-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 1.1rem;
    transition: all var(--transition);
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

.modal-body { padding: 20px 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---- Config Grid (for config index page) ---- */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.config-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.config-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

.config-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.config-card h3 {
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.config-card p {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* ---- Filter Bar ---- */
.filter-bar {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

/* ---- Status Dot ---- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--gray-400); }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state h3 {
    color: var(--gray-500);
    font-size: 1rem;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ---- Action Buttons in Tables ---- */
.table-actions {
    display: flex;
    gap: 4px;
}

/* ---- Capacity Bar ---- */
.capacity-bar {
    width: 80px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

.capacity-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition);
}

.capacity-bar-fill.green { background: var(--success); }
.capacity-bar-fill.orange { background: var(--warning); }
.capacity-bar-fill.red { background: var(--danger); }

/* ---- Color Preview ---- */
.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--gray-300);
}

/* ---- Day Labels ---- */
.day-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary-bg);
    color: var(--primary);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .page-container {
        padding: 20px 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .form-group {
        min-width: 100%;
    }
}


/* ══════════════════════════════════════════════════════════════════════
   GLOBAL SELECT & INPUT STYLING
   Paste this into your style.css (or inside a <style> block in base.html)
   ══════════════════════════════════════════════════════════════════════ */

select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #d1d9e6;
  border-radius: 8px;
  background-color: #fff;
  font-size: 0.875rem;
  color: #2d3a52;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  outline: none;
}

/* custom arrow for selects */
select {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%236b7a99' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--primary, #4466ee);
  box-shadow: 0 0 0 3px rgba(68, 102, 238, 0.13);
}

select:disabled,
input:disabled,
textarea:disabled {
  background-color: #f5f6fa;
  color: #9aa5be;
  cursor: not-allowed;
  border-color: #e3e8f0;
}

/* labels above inputs */
label,
.form-group label,
.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7a99;
  margin-bottom: 5px;
}

/* form-group spacing */
.form-group {
  margin-bottom: 16px;
}

/* form-control alias (used in older templates) */
.form-control {
  display: block;
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1.5px solid #d1d9e6;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%236b7a99' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  -webkit-appearance: none;
  font-size: 0.875rem;
  color: #2d3a52;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
}
.form-control:focus {
  border-color: var(--primary, #4466ee);
  box-shadow: 0 0 0 3px rgba(68, 102, 238, 0.13);
}
.form-control:disabled {
  background-color: #f5f6fa;
  color: #9aa5be;
  cursor: not-allowed;
}

/* filter-bar layout polish */
.filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filter-bar .form-group {
  margin: 0;
  flex: 1;
  min-width: 160px;
}
/* ══════════════════════════════════════════════════════════════════════
   GLOBAL CUSTOM SELECT DROPDOWN
   Replaces all native <select> elements with a styled floating panel.
   Just include this CSS in style.css and the JS block in app.js.
   ══════════════════════════════════════════════════════════════════════ */

/* hide the original select but keep it in DOM for form submission */
select.cs-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* the visible trigger button */
.cs-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #d1d9e6;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
  color: #2d3a52;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
  text-align: left;
  box-sizing: border-box;
  user-select: none;
}

.cs-trigger:focus,
.cs-wrap.open .cs-trigger {
  outline: none;
  border-color: var(--primary, #4466ee);
  box-shadow: 0 0 0 3px rgba(68, 102, 238, 0.13);
}

.cs-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-trigger-text.placeholder {
  color: #9aa5be;
}

.cs-chevron {
  flex-shrink: 0;
  width: 11px;
  height: 7px;
  transition: transform 0.22s ease;
  color: #6b7a99;
}
.cs-wrap.open .cs-chevron {
  transform: rotate(180deg);
}

/* floating panel */
.cs-panel {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid #d1d9e6;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
  overflow: hidden;
  min-width: 180px;
}

.cs-wrap.open .cs-panel {
  display: block;
}

/* search box inside panel — only shown when >5 options */
.cs-search-box {
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f7;
}

.cs-search-input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border: 1.5px solid #e3e8f0;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #2d3a52;
  background: #f7f9ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 9px center;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.cs-search-input:focus {
  border-color: var(--primary, #4466ee);
  background-color: #fff;
}

/* options list */
.cs-options {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}

.cs-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.875rem;
  color: #2d3a52;
  cursor: pointer;
  border-bottom: 1px solid #f5f7fc;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-opt:last-child {
  border-bottom: none;
}

.cs-opt:hover {
  background: #eef2ff;
  color: var(--primary, #4466ee);
}

.cs-opt.selected {
  background: #f0f4ff;
  color: var(--primary, #4466ee);
  font-weight: 600;
}

.cs-opt.selected::after {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary, #4466ee);
  margin-left: auto;
  flex-shrink: 0;
}

.cs-opt mark {
  background: #fff0a0;
  border-radius: 2px;
  padding: 0 2px;
  font-style: normal;
  color: inherit;
}

.cs-opt.disabled {
  color: #9aa5be;
  cursor: default;
  font-style: italic;
}

.cs-no-results {
  padding: 12px 14px;
  font-size: 0.83rem;
  color: #9aa5be;
  text-align: center;
}

/* scrollbar inside panel */
.cs-options::-webkit-scrollbar { width: 5px; }
.cs-options::-webkit-scrollbar-track { background: transparent; }
.cs-options::-webkit-scrollbar-thumb { background: #d1d9e6; border-radius: 99px; }
.cs-options::-webkit-scrollbar-thumb:hover { background: #b0bcd4; }

/* disabled select */
.cs-trigger.disabled {
  background: #f5f6fa;
  color: #9aa5be;
  cursor: not-allowed;
  border-color: #e3e8f0;
}