/* Basheret Insurance Management System - Main Stylesheet */
* { box-sizing: border-box; }

/* ===== SELECT2 — Bootstrap 3 theme overrides ===== */
.select2-container--bootstrap .select2-selection {
    border-color: #ccc;
    border-radius: 3px;
    min-height: 30px;
    font-size: 13px;
    box-shadow: none;
}
.select2-container--bootstrap.select2-container--focus .select2-selection,
.select2-container--bootstrap.select2-container--open .select2-selection {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6);
}
.select2-container--bootstrap .select2-selection--single {
    height: 30px;
    padding: 4px 24px 4px 8px;
    line-height: 1.42857;
}
.select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
    color: #333;
    line-height: 20px;
    padding-left: 0;
}
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow {
    height: 28px;
    right: 6px;
}
.select2-container--bootstrap .select2-results__option {
    font-size: 13px;
    padding: 5px 8px;
}
.select2-container--bootstrap .select2-results__option--highlighted {
    background-color: #26A69A;
}
.select2-container--bootstrap .select2-search--dropdown .select2-search__field {
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    padding: 4px 8px;
}
.select2-dropdown {
    border-color: #66afe9;
    border-radius: 0 0 3px 3px;
    font-size: 13px;
    z-index: 99999 !important;
}
.select2-container { z-index: 99999 !important; }
.select2-container--open { z-index: 99999 !important; }
/* Ensure search input inside dropdown is always clickable */
.select2-search--dropdown .select2-search__field { z-index: 99999 !important; }

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f0f2f5;
    padding-top: 50px;
    font-size: 13px;
}

/* ===== NAVBAR ===== */
.navbar-default { background-color: #1B3A6B; border-color: #152d54; border-radius: 0; }
.navbar-default .navbar-brand { color: #fff; font-weight: bold; font-size: 17px; letter-spacing: 0.5px; }
.navbar-default .navbar-brand:hover { color: #ddd; }
.navbar-default .navbar-text { color: #aac; margin-right: 8px; font-size: 12px; }
.navbar { margin-bottom: 0; }

/* ===== SIDEBAR ===== */
#sidebar {
    position: fixed; top: 50px; left: 0; bottom: 0;
    width: 215px; background-color: #1e2a3a;
    overflow-y: auto; z-index: 900; padding-top: 8px;
}
#sidebar ul { list-style: none; padding: 0; margin: 0; }
#sidebar ul li a {
    display: block; padding: 9px 16px; color: #b0c0d4;
    text-decoration: none; font-size: 13px;
    border-left: 3px solid transparent; transition: all 0.15s;
}
#sidebar ul li a:hover, #sidebar ul li.active a {
    background-color: #263447; color: #fff; border-left-color: #26A69A;
}
#sidebar ul li a .glyphicon { width: 18px; margin-right: 7px; font-size: 12px; opacity: 0.8; }
.sidebar-section {
    padding: 12px 15px 4px; color: #4a6785;
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
}

/* ===== MAIN CONTENT ===== */
#main-content { margin-left: 215px; padding: 20px; min-height: calc(100vh - 50px); }

/* ===== PANELS ===== */
.panel { border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #dde2e8; }
.panel-heading { font-weight: 600; font-size: 13px; }
.panel-primary > .panel-heading { background-color: #1B3A6B; border-color: #1B3A6B; }

/* ===== STAT BOXES ===== */
.stat-box {
    background: #fff; border-radius: 2px; padding: 16px 18px;
    margin-bottom: 20px; border-left: 4px solid #1B3A6B;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-box.green  { border-left-color: #27ae60; }
.stat-box.red    { border-left-color: #e74c3c; }
.stat-box.orange { border-left-color: #e67e22; }
.stat-box.teal   { border-left-color: #26A69A; }
.stat-box.purple { border-left-color: #8e44ad; }
.stat-box h3 { margin: 0 0 4px; font-size: 26px; font-weight: bold; color: #2c3e50; }
.stat-box p  { margin: 0; color: #7f8c8d; font-size: 12px; }
.stat-box .stat-icon { float: right; font-size: 32px; color: #ecf0f1; }

/* ===== TABLES ===== */
.table thead { background-color: #f4f6f9; }
.table thead th {
    border-bottom: 2px solid #dde2e8 !important; font-weight: 600;
    font-size: 11px; text-transform: uppercase; color: #6c757d; white-space: nowrap;
}
.table-hover tbody tr:hover { background-color: #f0f7ff; cursor: pointer; }
.table td { vertical-align: middle !important; font-size: 13px; }
.table-responsive { border: none; }

/* ===== BUTTONS ===== */
.btn-primary { background-color: #1B3A6B; border-color: #152d54; }
.btn-primary:hover, .btn-primary:focus { background-color: #152d54; border-color: #0f2240; }
.btn-info    { background-color: #26A69A; border-color: #1e8a80; }
.btn-info:hover { background-color: #1e8a80; }
.btn-xs { padding: 2px 6px; font-size: 11px; }

/* ===== STATUS LABELS ===== */
.label-active    { background-color: #27ae60; }
.label-pending   { background-color: #e67e22; }
.label-cancelled { background-color: #e74c3c; }
.label-expired   { background-color: #95a5a6; }
.label-closed    { background-color: #7f8c8d; }
.label-approved  { background-color: #27ae60; }
.label-rejected  { background-color: #e74c3c; }
.label-flagged   { background-color: #e74c3c; }
.label-paid      { background-color: #27ae60; }
.label-overdue   { background-color: #e74c3c; }
.label-new       { background-color: #3498db; }
.label-open      { background-color: #3498db; }

/* ===== PAGE HEADER ===== */
.page-header { border-bottom: 2px solid #dde2e8; margin-top: 0; padding-bottom: 10px; margin-bottom: 18px; }
.page-header h2 { margin: 0; font-size: 20px; color: #2c3e50; font-weight: 600; display: inline-block; }
.page-header .pull-right { margin-top: 3px; }

/* ===== MODAL ===== */
.modal-header { background-color: #1B3A6B; color: #fff; border-radius: 2px 2px 0 0; }
.modal-header .close { color: #fff; opacity: 0.8; font-size: 20px; }
.modal-content { border-radius: 2px; }

/* ===== SEARCH BAR ===== */
.search-toolbar { margin-bottom: 14px; }
.search-toolbar .form-control { border-radius: 2px; font-size: 13px; }

/* ===== LOGIN PAGE ===== */
body.login-page { padding-top: 0; background: #f0f2f5; }
.login-outer {
    min-height: 100vh; display: flex; align-items: stretch;
}
.login-left {
    flex: 0 0 420px; background: #fff; display: flex;
    align-items: center; justify-content: center; padding: 40px;
}
.login-right {
    flex: 1; background: #1B3A6B;
    display: flex; align-items: center; justify-content: center;
    padding: 40px; color: #fff;
}
.login-box { width: 100%; max-width: 340px; }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { color: #1B3A6B; font-size: 26px; font-weight: bold; margin: 0 0 4px; }
.login-logo p  { color: #7f8c8d; font-size: 12px; margin: 0; }
.login-right h2 { font-size: 24px; font-weight: bold; margin-bottom: 12px; }
.login-right p  { font-size: 14px; opacity: 0.85; line-height: 1.6; }
.login-box .form-control { border-radius: 2px; height: 40px; font-size: 13px; }
.login-box .btn { height: 40px; font-size: 14px; font-weight: 600; }
.form-group label { font-size: 12px; font-weight: 600; color: #555; }

/* ===== TABS ===== */
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    border-top: 3px solid #1B3A6B; color: #1B3A6B; font-weight: 600;
}
.tab-content { padding-top: 16px; }

/* ===== RISK SCORE ===== */
.risk-low    { color: #27ae60; font-weight: bold; }
.risk-medium { color: #e67e22; font-weight: bold; }
.risk-high   { color: #e74c3c; font-weight: bold; }

/* ===== TIMELINE ===== */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    padding: 10px 14px; border-left: 3px solid #1B3A6B;
    margin-bottom: 8px; background: #f8f9fa; position: relative;
}
.timeline li .time { font-size: 11px; color: #7f8c8d; }
.timeline li strong { font-size: 12px; }

/* ===== ALERTS ===== */
.alert { border-radius: 2px; font-size: 13px; }

/* ===== MISC ===== */
.no-data { text-align: center; padding: 30px; color: #aaa; font-style: italic; }
.text-muted { color: #999 !important; }
.badge-count { background: #e74c3c; border-radius: 10px; padding: 2px 6px; font-size: 10px; color: #fff; }
.section-divider { border-top: 1px solid #eee; margin: 15px 0; }
.detail-label { font-size: 11px; color: #999; text-transform: uppercase; margin-bottom: 2px; }
.detail-value { font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.score-bar { height: 8px; border-radius: 4px; background: #ecf0f1; margin-top: 4px; }
.score-fill { height: 100%; border-radius: 4px; background: #e74c3c; transition: width 0.3s; }
