/* =========================================================
   StudioYen CRM — Inspinia-style theme
   Colors: sidebar #2f4050, accent #1ab394, border #e7eaec
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #2f4050;
    font-size: 13px;
    color: #676a6c;
    overflow-x: hidden;
    margin: 0;
}

a { color: #1ab394; }
a:hover { color: #179d82; text-decoration: none; }

/* ── Wrapper ── */
#wrapper {
    width: 100%;
    overflow-x: hidden;
    display: flex;
}

/* ── Sidebar ── */
.navbar-static-side {
    width: 220px;
    min-height: 100vh;
    background-color: #2f4050;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2001;
    overflow-y: auto;
}

.sidebar-collapse { padding-bottom: 40px; }

.nav-header {
    padding: 28px 20px 20px;
    background-color: #2f4050;
    border-bottom: 1px solid #3d4f60;
}

.nav-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-header .brand-logo {
    width: 36px;
    height: 36px;
    background: #1ab394;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.nav-header .brand-name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.nav-header .brand-sub {
    color: #8095a8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

ul.nav.metismenu {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

ul.nav.metismenu > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid #3a4d5c;
}

ul.nav.metismenu > li > a {
    color: #a7b1c2;
    font-weight: 600;
    font-size: 13px;
    padding: 13px 20px 13px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, color .15s;
    text-decoration: none;
}

ul.nav.metismenu > li > a i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

ul.nav.metismenu > li > a:hover {
    background-color: #293846;
    color: #fff;
}

ul.nav.metismenu > li.active > a {
    background-color: #293846;
    color: #fff;
    border-left: 3px solid #1ab394;
    padding-left: 19px;
}

ul.nav.metismenu > li.active > a i { color: #1ab394; }

/* ── Page wrapper ── */
#page-wrapper {
    margin-left: 220px;
    min-height: 100vh;
    background-color: #f3f3f4;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Top navbar ── */
.navbar-top {
    background: #fff;
    border-bottom: 1px solid #e7eaec;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.navbar-top .page-title {
    font-size: 15px;
    font-weight: 600;
    color: #676a6c;
    margin: 0;
}

.navbar-top .nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #676a6c;
    font-size: 12px;
}

/* ── Breadcrumb ── */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid #e7eaec;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #999;
}

.breadcrumb-bar a { color: #1ab394; }
.breadcrumb-bar .separator { color: #ccc; }
.breadcrumb-bar .current { color: #676a6c; font-weight: 600; }

/* ── Main content ── */
.wrapper-content {
    padding: 24px 20px 60px;
    flex: 1;
}

/* ── ibox card ── */
.ibox {
    background: #fff;
    border: 1px solid #e7eaec;
    border-top: 3px solid #e7eaec;
    border-radius: 2px;
    margin-bottom: 20px;
    clear: both;
}

.ibox.ibox-primary { border-top-color: #1ab394; }
.ibox.ibox-warning { border-top-color: #f8ac59; }
.ibox.ibox-danger  { border-top-color: #ed5565; }
.ibox.ibox-info    { border-top-color: #1c84c6; }

.ibox-title {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e7eaec;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ibox-title h5 {
    font-size: 13px;
    font-weight: 700;
    color: #676a6c;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0;
}

.ibox-title .ibox-tools { display: flex; gap: 8px; }

.ibox-content { padding: 16px; }

/* ── Stat boxes ── */
.stat-box {
    background: #fff;
    border: 1px solid #e7eaec;
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-box .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-box .stat-icon.bg-green  { background: #1ab394; color: #fff; }
.stat-box .stat-icon.bg-orange { background: #f8ac59; color: #fff; }
.stat-box .stat-icon.bg-red    { background: #ed5565; color: #fff; }
.stat-box .stat-icon.bg-blue   { background: #1c84c6; color: #fff; }
.stat-box .stat-icon.bg-gray   { background: #a7b1c2; color: #fff; }

.stat-box .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #676a6c;
    line-height: 1;
}

.stat-box .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #aaa;
    margin-top: 4px;
}

/* ── Tables ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead th {
    background: #f9f9f9;
    border-bottom: 2px solid #e7eaec;
    border-top: none;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #999;
    padding: 10px 12px;
    white-space: nowrap;
}

.table tbody td {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 12px;
    vertical-align: middle;
    color: #676a6c;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafafa; }

/* ── Status badges ── */
.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.badge-actief   { background: #e8f8f5; color: #1ab394; }
.badge-risk     { background: #fff8ee; color: #f8ac59; }
.badge-inactief { background: #fef0f0; color: #ed5565; }
.badge-lead     { background: #eef4fb; color: #1c84c6; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    line-height: 1.4;
}

.btn-primary   { background: #1ab394; border-color: #1ab394; color: #fff; }
.btn-primary:hover { background: #179d82; border-color: #179d82; color: #fff; }
.btn-warning   { background: #f8ac59; border-color: #f8ac59; color: #fff; }
.btn-warning:hover { background: #f79d3c; border-color: #f79d3c; color: #fff; }
.btn-danger    { background: #ed5565; border-color: #ed5565; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 7px; font-size: 11px; }
.btn-default   { background: #fff; border-color: #e7eaec; color: #676a6c; }
.btn-default:hover { background: #f5f5f5; }

/* ── Form controls ── */
.form-control {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #e7eaec;
    border-radius: 3px;
    color: #676a6c;
    background: #fff;
    font-family: inherit;
    transition: border-color .15s;
}

.form-control:focus {
    outline: none;
    border-color: #1ab394;
    box-shadow: 0 0 0 3px rgba(26,179,148,.1);
}

textarea.form-control { resize: vertical; min-height: 70px; }

/* ── Search bar ── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
}

.search-bar .form-control { flex: 1; }

/* ── Pipeline run timeline ── */
.run-card {
    background: #fff;
    border: 1px solid #e7eaec;
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.run-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    user-select: none;
}

.run-card-header:hover { background: #fafafa; }

.run-card-header .run-date {
    font-weight: 700;
    color: #676a6c;
    font-size: 13px;
}

.run-card-header .run-meta {
    font-size: 12px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 16px;
}

.run-card-body {
    padding: 12px 16px;
    display: none;
}

.run-card-body.open { display: block; }

.job-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 12px;
}

.job-row:last-child { border-bottom: none; }

.job-name { color: #676a6c; font-weight: 600; }
.job-meta { color: #aaa; }

/* ── Note modal ── */
.note-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}

.note-modal-overlay.open { display: flex; }

.note-modal {
    background: #fff;
    border-radius: 4px;
    width: 440px;
    max-width: 95vw;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    overflow: hidden;
}

.note-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e7eaec;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-modal-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #676a6c;
}

.note-modal-body { padding: 20px; }
.note-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e7eaec;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 0;
}

/* ── Utilities ── */
.row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 10px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 10px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 10px; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 10px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #aaa; }
.text-success { color: #1ab394; }
.text-warning { color: #f8ac59; }
.text-danger { color: #ed5565; }
.font-bold { font-weight: 700; }

.m-b-sm { margin-bottom: 8px; }
.m-b { margin-bottom: 16px; }
.m-t-sm { margin-top: 8px; }
.pull-right { float: right; }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #aaa;
}

.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; margin: 0; }

/* ── Footer ── */
.footer {
    background: #fff;
    border-top: 1px solid #e7eaec;
    padding: 12px 20px;
    font-size: 12px;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}

/* ── Scrollable table container ── */
.table-responsive { overflow-x: auto; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .navbar-static-side { transform: translateX(-220px); }
    #page-wrapper { margin-left: 0; }
    .col-4, .col-3 { flex: 0 0 100%; max-width: 100%; }
}
