/* ===== Custom overrides for AdminLTE theme ===== */

:root {
    --primary: #3c8dbc;
    --primary-dark: #367fa9;
    --accent: #f39c12;
    --success: #00a65a;
    --danger: #dd4b39;
    --info: #00c0ef;
}

/* Sidebar active link */
.nav-sidebar .nav-link.active {
    background-color: var(--primary) !important;
}

/* Small stat boxes - match troskovi.com style */
.small-box {
    border-radius: 4px;
    position: relative;
    display: block;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
}

.small-box .inner h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    white-space: nowrap;
    padding: 0;
}

.small-box .inner p {
    font-size: 14px;
}

.small-box .icon {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 60px;
    color: rgba(0,0,0,.15);
}

/* Control panel action buttons - match troskovi.com grid */
.cp-action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.cp-action-grid .btn {
    white-space: nowrap;
    font-size: 13px;
    padding: 6px 12px;
}

/* DataTable - Serbian translations handled in JS */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d2d6de;
    border-radius: 4px;
    padding: 4px 8px;
}

/* Summary cards row */
.summary-cards-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.summary-cards-row .info-box {
    flex: 1;
    min-width: 250px;
}

/* Unit table - tighter columns to match troskovi.com */
.table-units th,
.table-units td {
    font-size: 13px;
    padding: 8px 10px;
    vertical-align: middle;
}

/* Badge styles for status */
.badge-u-izradi { background-color: #f39c12; color: #fff; }
.badge-otvoreno { background-color: #00c0ef; color: #fff; }
.badge-zatvoreno { background-color: #00a65a; color: #fff; }

/* Action buttons in table */
.btn-action {
    padding: 2px 8px;
    font-size: 12px;
    margin-right: 2px;
}

/* Form card style matching troskovi.com */
.form-card-custom {
    background: #fff;
    border-top: 3px solid var(--primary);
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
    padding: 20px;
    margin-bottom: 20px;
}

.form-card-custom .form-group label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.required-star {
    color: var(--danger);
    margin-left: 2px;
}

/* Hidden conditional sections */
.conditional-section {
    transition: all 0.2s;
}

/* Helptext under form fields */
.form-helptext {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

/* Landing page - hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 57px);
    text-align: center;
    background: linear-gradient(135deg, #3c8dbc 0%, #367fa9 100%);
    color: #fff;
    padding: 2rem;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero-buttons .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Auth pages (login/register) */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 57px);
    padding: 2rem;
}

.auth-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    border-top: 3px solid var(--primary);
}

.auth-card h2 {
    text-align: center;
    color: #444;
    margin-bottom: 1.5rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Profile page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.profile-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    padding: 1.5rem;
    border-top: 3px solid var(--primary);
}

.profile-card-title {
    color: #444;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f4f4f4;
}

/* Tabs navigation matching troskovi.com */
.nav-tabs-custom > .nav-tabs {
    border-bottom-color: #f4f4f4;
}

.nav-tabs-custom > .nav-tabs > li.active > a {
    border-top-color: var(--primary);
}

/* Text helpers */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-muted-custom { color: #999; }

/* Form errors */
.form-errors {
    background: #fdf7f7;
    border: 1px solid #eed3d7;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: var(--danger);
    font-size: 13px;
}

.form-errors ul {
    margin: 0;
    padding-left: 20px;
}

/* ===== Custom single-select dropdown (month picker) ===== */
.custom-select-wrap {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.cs-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
    background: #fff;
    cursor: pointer;
    min-height: 38px;
}

.cs-display:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(60,141,188,.25);
    outline: none;
}

.cs-placeholder {
    color: #999;
}

.cs-arrow {
    margin-left: 8px;
    font-size: 12px;
    color: #666;
}

.cs-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,.12);
    max-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cs-dropdown {
    display: none;
}

.cs-dropdown.open {
    display: flex;
    flex-direction: column;
}

.cs-search {
    border: none;
    border-bottom: 1px solid #eee;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.cs-options {
    overflow-y: auto;
    max-height: 240px;
}

.cs-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.cs-option:hover {
    background: #f0f7fc;
}

.cs-option.selected {
    background: var(--primary);
    color: #fff;
}

.cs-option[style*="display: none"] {
    /* filtered out by search */
}

/* ===== Multi-select (stanovi picker) ===== */
.multi-select-wrap {
    position: relative;
}

.ms-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 8px;
    background: #fff;
    cursor: pointer;
    min-height: 38px;
}

.ms-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ms-chip {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 13px;
}

.ms-chip-x {
    cursor: pointer;
    margin-right: 4px;
    color: #999;
    font-weight: bold;
}

.ms-chip-x:hover {
    color: var(--danger);
}

.ms-search-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 60px;
    font-size: 14px;
    padding: 2px 0;
}

.ms-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
}

.ms-dropdown.open {
    display: block;
}

.ms-group-header {
    padding: 6px 12px;
    font-weight: 600;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    background: #f8f9fa;
}

.ms-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.ms-option:hover {
    background: #f0f7fc;
}

.ms-checkbox {
    margin: 0;
}

/* ===== Stavka (line item) blocks ===== */
.stavka-block {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 12px;
    background: #fdfdfd;
}

.stavka-row-top,
.stavka-row-bottom {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stavka-row-bottom {
    margin-top: 10px;
}

.stavka-field {
    flex: 1;
    min-width: 180px;
}

.stavka-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.btn-remove-stavka {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.btn-remove-stavka:hover {
    color: var(--danger);
}

/* ===== Bill template controls ===== */
.bill-template-controls {
    border-top: 1px solid #eee;
    padding-top: 12px;
}
