/* ════════════════════════════════════════════════════════════
   ConstruSoft — Design System
   Svi stilovi su ovdje. Inline style="" u templateovima
   treba da nestane; koristiti ove klase ili Tailwind utilities.
   ════════════════════════════════════════════════════════════ */

/* ── Critical layout utilities (CDN-independent) ────────────────
   Definirani ovdje da ne ovise o Tailwind CDN JIT generaciji.
   Tailwind CDN generiše iste vrijednosti — ovo je samo sigurnosna
   mreža za bg-cs-bg, bg-white i slične na layoutu.
   ─────────────────────────────────────────────────────────────── */

.bg-cs-bg      { background-color: #F5F7FA; }
.bg-white      { background-color: #FFFFFF; }
.bg-navy       { background-color: #1A304A; }
.bg-cs-orange  { background-color: #E87B1E; }
.bg-steel-light { background-color: #EBF3FA; }
.text-navy     { color: #1A304A; }
.text-steel    { color: #2E6DA4; }
.text-cs-label { color: #9E9E9E; }
.text-cs-body  { color: #606060; }
.text-cs-orange { color: #E87B1E; }
.border-cs-border { border-color: #E0E6ED; }

/* ── Form elements ──────────────────────────────────────────── */

.cs-input,
.cs-select,
.cs-textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #E0E6ED;
    border-radius: 8px;
    font-size: 13px;
    color: #1A304A;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.cs-input,
.cs-select {
    height: 40px;
    padding: 0 12px;
}

.cs-textarea {
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.55;
}

.cs-select {
    padding-right: 36px;
    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='%239E9E9E' 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;
    cursor: pointer;
}

.cs-input::placeholder,
.cs-textarea::placeholder { color: #9E9E9E; font-weight: 400; }

.cs-input:focus,
.cs-select:focus,
.cs-textarea:focus {
    border-color: #2E6DA4;
    box-shadow: 0 0 0 1px #2E6DA4, 0 0 0 4px #EBF3FA;
}

.cs-input-error                 { border-color: #C02A2A !important; }
.cs-input-error:focus           { box-shadow: 0 0 0 1px #C02A2A, 0 0 0 4px #FBE9E9 !important; }

/* Padding for inputs with a leading icon overlay */
.cs-input-icon { padding-left: 40px; }

/* Compact (sm) input variant — used in inline table edit rows */
.cs-input-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', system-ui, sans-serif;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: opacity .15s, background .15s;
    text-decoration: none;
    line-height: 1;
}
.cs-btn:hover       { opacity: .88; }
.cs-btn-primary     { background: #2E6DA4; color: #fff;     border-color: #2E6DA4; }
.cs-btn-cta         { background: #E87B1E; color: #fff;     border-color: #E87B1E; }
.cs-btn-secondary   { background: #fff;    color: #2E6DA4;  border-color: #2E6DA4; }
.cs-btn-ghost       { background: transparent; color: #1A304A; border-color: #E0E6ED; }
.cs-btn-danger      { background: #C02A2A; color: #fff;     border-color: #C02A2A; }
.cs-btn-sm          { height: 32px; padding: 0 12px; font-size: 12px; }

/* ── Cards ───────────────────────────────────────────────────── */

.cs-card {
    background: #fff;
    border: 1px solid #E0E6ED;
    border-radius: 8px;
}

/* Card section header — white background, bottom separator, standard padding */
.cs-card-header {
    padding: 1rem 1.5rem;          /* px-6 py-4 */
    border-bottom: 1px solid #E0E6ED;
}

/* Card section footer — white background, top separator, standard padding */
.cs-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E0E6ED;
}

/* ── Typography ──────────────────────────────────────────────── */

/* Main page title (h1) */
.cs-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1A304A;
    letter-spacing: -0.3px;
}

/* Card / section heading (h2) */
.cs-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A304A;
}

/* Small uppercase field label used on show/detail pages */
.cs-field-label {
    font-size: 11px;
    font-weight: 600;
    color: #9E9E9E;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 4px;
    display: block;
}

/* ── Sidebar nav ─────────────────────────────────────────────── */

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 16px 0 19px;
    font-size: 13px;
    font-weight: 500;
    color: #606060;
    cursor: pointer;
    text-decoration: none;
    transition: background .1s, color .1s;
}

.nav-item:hover:not(.nav-item-active):not(.nav-item-disabled) {
    background: #F5F7FA;
}

.nav-item-active {
    background: #EBF3FA !important;
    color: #1A304A !important;
    font-weight: 700;
}

.nav-item-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #E87B1E;
    border-radius: 0 2px 2px 0;
}

.nav-item-disabled {
    color: #9E9E9E;
    opacity: .6;
    cursor: not-allowed;
}

.nav-item-icon {
    display: flex;
    width: 18px;
    flex-shrink: 0;
}

/* Nav section group title ("Pregled", "Nabavka" ...) */
.nav-section-title {
    padding: 0 19px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #9E9E9E;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* "F2" coming-soon badge in sidebar nav */
.nav-f2-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #F5F7FA;
    color: #9E9E9E;
    border: 1px solid #E0E6ED;
}

/* ── Logo mark ───────────────────────────────────────────────── */

.cs-logo-mark { letter-spacing: -0.5px; }
.cs-logo-name { letter-spacing: -0.2px; }

/* ── Badges ──────────────────────────────────────────────────── */

.cs-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Neutral (default) badge variant */
.cs-badge-neutral {
    background: #F5F7FA;
    border: 1px solid #E0E6ED;
    color: #9E9E9E;
}

/* Success (green) badge variant */
.cs-badge-success {
    background: #E8F6EE;
    border: 1px solid #A3D9B8;
    color: #1A7A45;
}

/* Warning (amber) badge variant */
.cs-badge-warning {
    background: #FEF9E8;
    border: 1px solid #F5D782;
    color: #92650A;
}

/* Danger (red) badge variant */
.cs-badge-danger {
    background: #FBE9E9;
    border: 1px solid rgba(192,42,42,.25);
    color: #C02A2A;
}

/* Info (blue) badge variant — Investitor, info statuses */
.cs-badge-info {
    background: #EBF3FA;
    border: 1px solid #B8D8F0;
    color: #2E6DA4;
}

/* Purple badge variant — "Rešeno, čeka verifikaciju" */
.cs-badge-purple {
    background: #F1EAFB;
    border: 1px solid rgba(122,63,184,.25);
    color: #7A3FB8;
}

/* ── Trade/skill tag chip ─────────────────────────────────────── */

.cs-trade-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #2E6DA4;
    background: #EBF4FB;
    border: 1px solid #B8D8F0;
}

/* ── Tables ──────────────────────────────────────────────────── */

.cs-table                       { width: 100%; border-collapse: collapse; }
.cs-table th                    { background: #1A304A; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 10px 16px; text-align: left; }
.cs-table td                    { padding: 12px 16px; font-size: 13px; color: #606060; }
.cs-table tbody tr              { border-bottom: 1px solid #E0E6ED; }
.cs-table tbody tr:last-child   { border-bottom: none; }
.cs-table tbody tr:hover        { background: #F5F7FA; }

/* ── List dividers ───────────────────────────────────────────── */

/* Very subtle separator between list items (same color as page bg) */
.cs-list-item {
    border-bottom: 1px solid #F5F7FA;
}

/* ── Search bar (header) ─────────────────────────────────────── */

.cs-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 18rem;       /* w-72 */
    height: 36px;       /* h-9 */
    padding: 0 12px;
    border-radius: 8px;
    background: #F5F7FA;
    border: 1px solid #E0E6ED;
    color: #9E9E9E;
    font-size: 13px;
    flex-shrink: 0;
}

.cs-search-kbd {
    font-size: 11px;
    background: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #E0E6ED;
    font-family: ui-monospace, monospace;
}

/* ── Misc ────────────────────────────────────────────────────── */

[x-cloak]       { display: none !important; }
.cs-form-error  { font-size: 12px; color: #C02A2A; margin-top: 4px; }
.cs-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #606060;
    margin-bottom: 5px;
}
.cs-label-required::after { content: ' *'; color: #C02A2A; }
