/* ============================================
   MONCEPT CRM - Dizajn sistem
   Paleta: antracit + bezbednosno-narandžasta
   ============================================ */

:root {
    --ink: #1E2126;          /* glavni tekst / antracit */
    --ink-soft: #4B5058;      /* sekundarni tekst */
    --paper: #F6F4EF;         /* pozadina, topla nijansa betona/papira */
    --panel: #FFFFFF;         /* kartice */
    --line: #DEDAD0;          /* linije/border */
    --accent: #D9691E;        /* bezbednosno-narandžasta, glavni akcenat */
    --accent-dark: #B8560F;
    --ok: #4F7942;            /* zelena za pozitivne iznose */
    --bad: #B3392C;           /* crvena za negativne iznose */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

.logo-chip {
    display: inline-flex;
    align-items: center;
    background: #fff;
    padding: 8px 14px;
    border-radius: 6px;
}

.logo-chip img {
    height: 22px;
    width: auto;
    display: block;
}

.auth-card .logo-chip img { height: 30px; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em 0;
}

a { color: var(--accent-dark); }

/* Layout: login (centered) */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

.auth-card .brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 28px;
}

.auth-card .brand .mark {
    width: 10px;
    height: 10px;
    background: var(--accent);
    display: inline-block;
    border-radius: 2px;
}

.auth-card .brand span.name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
}

.auth-card .brand span.tag {
    color: var(--ink-soft);
    font-size: 13px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 6px;
    margin-top: 16px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    background: var(--panel);
    color: var(--ink);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

button, .btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

button:hover, .btn:hover { background: var(--accent-dark); }

button.full { width: 100%; margin-top: 22px; }

.error-box {
    background: #FBEAE6;
    border: 1px solid var(--bad);
    color: var(--bad);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 16px;
}

.hint {
    color: var(--ink-soft);
    font-size: 12.5px;
    margin-top: 24px;
    text-align: center;
}

/* App shell (dashboard i dalje stranice) */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--ink);
    color: #fff;
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidebar .brand .mark {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 2px;
}

.sidebar .brand span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
}

.sidebar nav a {
    display: block;
    padding: 10px 24px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-left-color: var(--accent);
}

.sidebar .who {
    position: absolute;
    bottom: 20px;
    padding: 0 24px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.6);
}

.main {
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.topbar .logout-link {
    font-size: 13px;
    color: var(--ink-soft);
    text-decoration: none;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
}

/* Tabele */
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
}

table.data td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.data tr:last-child td { border-bottom: none; }

/* Bedž za ulogu/status */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    background: #EEE9DE;
    color: var(--ink);
}

.badge.on { background: #E7F0E4; color: var(--ok); }
.badge.off { background: #F3E4E1; color: var(--bad); }

.section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 32px 0 12px 0;
}

.section-title:first-child { margin-top: 0; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    .two-col { grid-template-columns: 1fr; }
}

/* Checkbox grid za matricu dozvola */
table.perm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.perm-matrix th, table.perm-matrix td {
    border: 1px solid var(--line);
    padding: 8px 10px;
    text-align: center;
}

table.perm-matrix th:first-child, table.perm-matrix td:first-child {
    text-align: left;
    font-weight: 500;
}

table.perm-matrix th {
    background: #F0EDE5;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
}

table.perm-matrix input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 5px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--paper);
}

.success-box {
    background: #E7F0E4;
    border: 1px solid var(--ok);
    color: var(--ok);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Stream - istorija aktivnosti */
.stream-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.stream-item:last-child { border-bottom: none; }

.stream-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
}

.stream-content {
    font-size: 14px;
    line-height: 1.7;
}

.stream-content .badge {
    margin-right: 8px;
    vertical-align: middle;
}

.stream-actor {
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.stream-actor:hover { color: var(--accent-dark); }

.stream-text { color: var(--ink-soft); margin: 0 4px; }

.stream-entity {
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.stream-entity:hover { color: var(--accent-dark); }

.stream-entity-plain { font-weight: 600; color: var(--ink); }

.stream-date {
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 2px;
}

@media (max-width: 700px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; padding: 16px; }
    .sidebar .who { display: none; }
    .main { padding: 20px; }
}
