/* MYABI Build Control - tamna profesionalna tema */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #14161a;
    color: #e6e6e6;
    font-size: 15px;
}

.layout { display: flex; min-height: 100vh; }

/* --- Lijevi izbornik --- */
.sidebar {
    width: 230px;
    background: #0e0f12;
    border-right: 1px solid #26282e;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}
.brand {
    padding: 20px 18px;
    font-size: 18px;
    font-weight: 800;
    border-bottom: 1px solid #26282e;
}
.brand.big { font-size: 24px; text-align: center; margin-bottom: 18px; border: 0; }
.brand-red { color: #d32029; }
.sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sidebar nav a {
    display: block;
    padding: 13px 20px;
    color: #c9cdd4;
    text-decoration: none;
    font-size: 15px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #1b1d22; color: #fff; }
.sidebar nav a.active {
    background: #1b1d22;
    color: #fff;
    border-left-color: #d32029;
    font-weight: 600;
}
.sidebar-user {
    padding: 14px 18px;
    border-top: 1px solid #26282e;
    font-size: 13px;
}
.sidebar-user .uname { font-weight: 600; }
.sidebar-user .urole { color: #8b9099; margin: 2px 0 8px; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.sidebar-user a { color: #d32029; text-decoration: none; }

/* --- Sadržaj --- */
.content { flex: 1; padding: 24px 28px; min-width: 0; }
.topbar h1 { margin: 0 0 20px; font-size: 24px; }

/* --- Paneli i tablice --- */
.panel {
    background: #1b1d22;
    border: 1px solid #26282e;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.panel-head.wrap, .search-form.wrap { flex-wrap: wrap; }
.panel-head h2 { margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #26282e; vertical-align: middle; }
th { color: #8b9099; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: #20232a; }
table.kv td:first-child { width: 220px; color: #8b9099; }
.row-fail td { background: rgba(211, 32, 41, .08) !important; }
.nowrap { white-space: nowrap; }
.muted { color: #8b9099; }

/* --- Badge --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.b-new  { background: #2a2e36; color: #c9cdd4; }
.b-info { background: #14324a; color: #5db3f0; }
.b-warn { background: #4a3a14; color: #f0c45d; }
.b-ok   { background: #14401f; color: #5df08a; }
.b-done { background: #123c3c; color: #5de0e0; }
.b-bad  { background: #4a1414; color: #f05d5d; }

/* --- Gumbi --- */
.btn {
    display: inline-block;
    background: #2a2e36;
    color: #e6e6e6;
    border: 1px solid #3a3e47;
    padding: 9px 18px;
    border-radius: 7px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}
.btn:hover { background: #343942; }
.btn-primary { background: #d32029; border-color: #d32029; color: #fff; font-weight: 600; }
.btn-primary:hover { background: #b31b23; }
.btn-big { padding: 13px 26px; font-size: 16px; }
.btn-small { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #4a1414; border-color: #6b1d1d; color: #f05d5d; }
form.inline { display: inline; }

/* --- Obrasci --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    align-items: end;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #8b9099; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: #e6e6e6; font-size: 14px; padding: 8px 0; }
label.big-check { font-weight: 700; color: #5df08a; }
input, select, textarea {
    background: #0e0f12;
    border: 1px solid #3a3e47;
    border-radius: 6px;
    color: #e6e6e6;
    padding: 9px 11px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #d32029; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: #d32029; }
input[type="file"] { padding: 7px; }
fieldset { border: 0; padding: 0; margin: 0; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input, .search-form select { width: auto; }

.radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #3a3e47;
    cursor: pointer;
    flex-direction: row;
    color: #c9cdd4;
    font-size: 13px;
}
.radio-pill:has(input:checked) { border-color: currentColor; font-weight: 700; }
.st-done:has(input:checked) { background: #14401f; color: #5df08a; }
.st-fail:has(input:checked) { background: #4a1414; color: #f05d5d; }
.st-na:has(input:checked)   { background: #2a2e36; color: #c9cdd4; }

/* --- Statistike --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: #1b1d22;
    border: 1px solid #26282e;
    border-radius: 10px;
    padding: 18px;
    border-top: 3px solid #d32029;
}
.stat-card.bad { border-top-color: #f05d5d; }
.stat-card.ok { border-top-color: #5df08a; }
.stat-card.done { border-top-color: #5de0e0; }
.stat-num { font-size: 34px; font-weight: 800; }
.stat-label { color: #8b9099; font-size: 13px; margin-top: 4px; }

/* --- Ostalo --- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash-ok { background: #14401f; color: #5df08a; border: 1px solid #1f5c2e; word-break: break-all; }
.flash-err { background: #4a1414; color: #f05d5d; border: 1px solid #6b1d1d; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wo-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.wo-number { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.wo-actions { display: flex; gap: 8px; }
.phase-links { display: flex; gap: 10px; flex-wrap: wrap; }
.pager { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Prijava --- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
    background: #1b1d22;
    border: 1px solid #26282e;
    border-radius: 12px;
    padding: 34px 38px;
    width: 380px;
    max-width: 92vw;
}
.login-box form { display: flex; flex-direction: column; gap: 14px; }

/* --- Responzivnost (tablet) --- */
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .sidebar nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 10px 14px; }
    .sidebar nav a.active { border-bottom-color: #d32029; }
    .grid-2 { grid-template-columns: 1fr; }
    .content { padding: 16px; }
}
