:root {
    --navy-950: #081525;
    --navy-900: #0d1d30;
    --navy-800: #142b45;
    --navy-700: #1e3a59;
    --blue-600: #1769e0;
    --blue-100: #eaf2ff;
    --green-600: #16834a;
    --green-100: #e7f7ee;
    --amber-600: #a96408;
    --amber-100: #fff4db;
    --red-600: #b42318;
    --red-100: #ffefed;
    --ink: #132033;
    --muted: #68778a;
    --line: #dfe5eb;
    --line-dark: #cbd4dd;
    --surface: #ffffff;
    --background: #f2f5f8;
    --shadow-sm: 0 2px 8px rgba(8, 21, 37, .05);
    --shadow-md: 0 12px 32px rgba(8, 21, 37, .09);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 100% 0, rgba(23, 105, 224, .045), transparent 28rem),
        var(--background);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(23, 105, 224, .16), transparent 24rem),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.login-card {
    width: min(430px, 100%);
    padding: 42px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
}

.brand {
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .19em;
}

.login-card h1 {
    margin: 8px 0 2px;
    font-size: 34px;
    letter-spacing: -.04em;
}

.muted {
    color: var(--muted);
}

.small {
    margin-top: 24px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* Forms */
label {
    display: block;
    margin-top: 18px;
    color: #27364a;
    font-size: 13px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 7px;
    padding: 12px 14px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #aab7c4;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, .12);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: #edf1f4;
    color: #84909b;
    cursor: not-allowed;
}

button,
.button {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 11px 17px;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
    color: #fff;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 5px 13px rgba(13, 29, 48, .14);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

button:hover,
.button:hover {
    filter: brightness(1.12);
    box-shadow: 0 8px 18px rgba(13, 29, 48, .2);
    transform: translateY(-1px);
}

button:active,
.button:active {
    transform: translateY(0);
}

.login-card button {
    width: 100%;
    margin-top: 24px;
    padding: 13px 18px;
}

.alert {
    margin: 18px 0;
    padding: 12px 14px;
    border: 1px solid #ffd5d1;
    border-radius: var(--radius-sm);
    background: var(--red-100);
    color: var(--red-600);
}

/* Header */
.top {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(8, 21, 37, .035);
    backdrop-filter: blur(12px);
}

.top b {
    color: var(--navy-950);
    font-size: 14px;
    letter-spacing: .08em;
}

.top span {
    margin-left: 10px;
    color: var(--muted);
}

.top a {
    color: var(--blue-600);
    font-weight: 700;
    text-decoration: none;
}

.top a:hover {
    text-decoration: underline;
}

/* Application layout */
.layout {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    min-height: calc(100vh - 68px);
}

aside {
    position: sticky;
    top: 68px;
    align-self: start;
    height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 22px 14px;
    background:
        linear-gradient(
            180deg,
            rgba(8, 21, 37, .62),
            rgba(13, 29, 48, .72)
        ),
        url('../images/zurich-sidebar.jpg') center center / cover no-repeat;
    border-right: 1px solid rgba(255, 255, 255, .04);
    scrollbar-width: thin;
}

aside a {
    position: relative;
    display: block;
    margin: 3px 0;
    padding: 11px 14px;
    border-radius: 9px;
    color: #b8c6d5;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

aside a:hover {
    background: rgba(255, 255, 255, .075);
    color: #fff;
    transform: translateX(2px);
}

aside a.active {
    background: linear-gradient(135deg, var(--blue-600), #3d83e8);
    color: #fff;
    font-weight: 750;
    box-shadow: 0 8px 18px rgba(23, 105, 224, .28);
}

aside a.active::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -8px;
    width: 3px;
    border-radius: 4px;
    background: #7db4ff;
    content: "";
}

main {
    width: 100%;
    max-width: 1480px;
    padding: 36px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.page-title h1 {
    margin: 0;
    color: var(--navy-950);
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.2;
    letter-spacing: -.035em;
}

.page-title p {
    margin: 7px 0 0;
    color: var(--muted);
}

/* Cards and statistics */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stats article,
.panel {
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stats article {
    position: relative;
    overflow: hidden;
    min-height: 124px;
    padding: 22px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stats article::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 76px;
    height: 76px;
    border-radius: 0 0 0 76px;
    background: linear-gradient(135deg, rgba(23, 105, 224, .13), transparent);
    content: "";
}

.stats article:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.stats strong {
    display: block;
    margin-top: 9px;
    color: var(--navy-950);
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -.04em;
}

.panel {
    padding: 24px;
}

.panel h2 {
    margin: 0 0 16px;
    color: var(--navy-950);
    font-size: 21px;
    letter-spacing: -.02em;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line-dark);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    color: #29384a;
    vertical-align: middle;
}

tbody tr {
    transition: background .14s ease;
}

tbody tr:hover {
    background: #f7faff;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* Common status styles */
.badge,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 750;
}

.success {
    background: var(--green-100);
    color: var(--green-600);
}

.warning {
    background: var(--amber-100);
    color: var(--amber-600);
}

.error,
.danger {
    background: var(--red-100);
    color: var(--red-600);
}

/* Responsive */
@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .top {
        height: auto;
        min-height: 62px;
        padding: 14px 18px;
    }

    .top span {
        display: none;
    }

    .layout {
        display: block;
        min-height: calc(100vh - 62px);
    }

    aside {
        position: sticky;
        top: 62px;
        z-index: 90;
        height: auto;
        display: flex;
        gap: 5px;
        overflow-x: auto;
        padding: 10px 12px;
        background:
            linear-gradient(rgba(8, 21, 37, .91), rgba(8, 21, 37, .91)),
            url('../images/zurich-sidebar.jpg') center 45% / cover no-repeat;
        border: 0;
        white-space: nowrap;
    }

    aside a {
        flex: 0 0 auto;
        margin: 0;
        padding: 9px 12px;
    }

    aside a:hover {
        transform: none;
    }

    aside a.active::before {
        display: none;
    }

    main {
        padding: 24px 18px;
    }

    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .login-card {
        padding: 30px 24px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .stats article {
        min-height: 108px;
    }

    .page-title > button,
    .page-title > .button,
    .page-title > a {
        width: 100%;
        text-align: center;
    }

    main {
        padding: 20px 14px;
    }
}

/* STUWISOFT global override: nadjačava stare stilove unutar PHP stranica */
body .layout {
    grid-template-columns: 238px minmax(0, 1fr) !important;
}

body .layout > aside {
    position: sticky !important;
    top: 68px !important;
    align-self: start !important;
    height: calc(100vh - 68px) !important;
    padding: 22px 14px !important;
    overflow-y: auto !important;
    background-color: #0d1d30 !important;
    background-image:
        linear-gradient(180deg, rgba(8, 21, 37, .76), rgba(13, 29, 48, .90)),
        url('../images/zurich-sidebar.jpg') !important;
    background-position: center center, center center !important;
    background-size: cover, cover !important;
    background-repeat: no-repeat, no-repeat !important;
    border-right: 1px solid rgba(255, 255, 255, .07) !important;
    box-shadow: 8px 0 24px rgba(8, 21, 37, .10) !important;
}

body .layout > aside a {
    display: block !important;
    margin: 3px 0 !important;
    padding: 11px 14px !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #d2dce7 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .65) !important;
}

body .layout > aside a:hover {
    background: rgba(255, 255, 255, .13) !important;
    color: #fff !important;
    transform: translateX(2px) !important;
}

body .layout > aside a.active {
    background: linear-gradient(135deg, rgba(23, 105, 224, .95), rgba(61, 131, 232, .90)) !important;
    color: #fff !important;
    font-weight: 750 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .24) !important;
}

body .top {
    height: 68px !important;
    background: rgba(255, 255, 255, .96) !important;
    border-bottom: 1px solid #dfe5eb !important;
    box-shadow: 0 3px 14px rgba(8, 21, 37, .05) !important;
}

body main {
    padding: 36px !important;
}

body .stats article,
body .panel {
    background: rgba(255, 255, 255, .98) !important;
    border: 1px solid #dfe5eb !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 12px rgba(8, 21, 37, .06) !important;
}

@media (max-width: 850px) {
    body .layout {
        display: block !important;
    }

    body .layout > aside {
        position: sticky !important;
        top: 62px !important;
        z-index: 90 !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        gap: 5px !important;
        padding: 10px 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
    }

    body .layout > aside a {
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 9px 12px !important;
    }

    body main {
        padding: 24px 18px !important;
    }
}
