/* INTELI — zajednički svijetli stil (prijava, maintenance, jednostavne stranice) */

@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope-800.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --inteli-blue: #1e6bb8;
    --inteli-blue-dark: #155a9c;
    --inteli-ink: #0b1220;
    --inteli-ink-muted: #3a4556;
    --inteli-bg: #ffffff;
    --inteli-bg-subtle: #f3f7fc;
    --inteli-border: #d7e0ea;
    --bg: #f3f7fc;
    --surface: #ffffff;
    --border: #d7e0ea;
    --text: #0b1220;
    --muted: #3a4556;
    --primary: #1e6bb8;
    --primary-hover: #155a9c;
    --save: #16a34a;
    --save-hover: #15803d;
    --error: #dc2626;
    --success: #15803d;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(11 18 32 / 4%), 0 8px 24px rgb(11 18 32 / 4%);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.topbar,
.maint-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.topbar__brand,
.maint-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
}

.maint-header__logo-img {
    display: block;
    height: 28px;
    width: auto;
}

.topbar__nav,
.maint-header__nav {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.topbar__nav a,
.maint-header__nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.topbar__nav a:hover,
.maint-header__nav a:hover {
    text-decoration: underline;
}

.topbar__user,
.maint-header__user {
    color: var(--muted);
    font-size: 0.9rem;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.container--narrow { max-width: 440px; }

h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--inteli-ink);
}

.lead { color: var(--muted); margin-bottom: 24px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.muted a { color: var(--primary); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

.card--auth { margin-top: 0; }

.grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.form label {
    display: block;
    margin-bottom: 16px;
}

.form label span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    background: #f9fafb;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(30 107 184 / 18%);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    background: var(--surface);
    color: var(--text);
}

.btn:hover {
    background: #f3f4f6;
}

.btn--primary {
    background: var(--inteli-blue);
    border-color: var(--inteli-blue);
    color: #fff;
    font-weight: 600;
}

.btn--primary:hover {
    background: var(--inteli-blue-dark);
    border-color: var(--inteli-blue-dark);
    color: #fff;
}

.btn--save {
    background: var(--save);
    border-color: var(--save);
    color: #fff;
    font-weight: 600;
}

.btn--save:hover {
    background: var(--save-hover);
    border-color: var(--save-hover);
}

.btn--success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    font-weight: 600;
}

.btn--success:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.btn--block { width: 100%; text-align: center; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error);
}

.alert--warn {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

.stats dt { color: var(--muted); font-size: 0.75rem; margin-top: 12px; }
.stats dd { margin: 4px 0 0; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.badge--ok { background: #dcfce7; color: var(--success); }
.badge--err { background: #fee2e2; color: var(--error); }

.module-list { list-style: none; padding: 0; margin: 0; }
.module-list__item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.module-list__item--disabled { color: var(--muted); }

.footer {
    text-align: center;
    padding: 24px;
    color: var(--muted);
    font-size: 0.8rem;
    background: var(--bg);
}

.footer a { color: var(--primary); }

code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #374151;
}

.table-wrap { overflow-x: auto; margin-top: 16px; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th,
.data-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}
.data-table th {
    background: #f9fafb;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.data-table a { color: var(--primary); font-weight: 500; }
.data-table tbody tr:hover { background: #f9fafb; }

.fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    background: var(--surface);
}
.fieldset legend {
    padding: 0 8px;
    color: var(--primary);
    font-weight: 600;
}
.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.form--wide textarea {
    width: 100%;
    min-height: 60px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.terminal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    align-items: center;
}
.btn--danger {
    background: #fff;
    border: 1px solid var(--error);
    color: var(--error);
}
.btn--danger:hover {
    background: #fef2f2;
}

.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}

.btn--link {
    background: none;
    border: none;
    color: var(--error);
    padding: 4px 8px;
    font-size: 0.85rem;
}

.btn--link:hover {
    text-decoration: underline;
    background: none;
}

/* Tabovi (company-edit) */
.maint-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.maint-tabs a {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.maint-tabs a.is-active,
.maint-tabs a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.maint-app .container { max-width: 1100px; }

/* Mobilni / touch */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 720px) {
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    input[type="text"],
    input[type="search"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px;
        min-height: 44px;
    }
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
}
