/* =====================================================================
   Regjistri i Aseteve - K.R.U. "Hidroregjioni Jugor" Sh.A.
   Ngjyrat kryesore vijne nga logoja: blu e erret (indigo) dhe jeshile.
   ===================================================================== */
:root {
    --brand-navy: #24155d;
    --brand-navy-rgb: 36, 21, 93;
    --brand-navy-dark: #170d42;
    --brand-indigo: #3b2f86;
    --brand-green: #2e9d62;
    --brand-green-rgb: 46, 157, 98;
    --brand-green-soft: #81c28e;

    --bg: #f3f5fb;
    --surface: #ffffff;
    --ink: #1d2340;
    --muted: #6a7391;
    --line: #e3e8f2;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(20, 24, 64, .05), 0 6px 18px rgba(20, 24, 64, .05);
    --shadow-md: 0 2px 4px rgba(20, 24, 64, .06), 0 16px 34px rgba(20, 24, 64, .12);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --sidebar-w: 270px;

    /* Bootstrap: ngjyrat e markes */
    --bs-primary: #24155d;
    --bs-primary-rgb: 36, 21, 93;
    --bs-success: #2e9d62;
    --bs-success-rgb: 46, 157, 98;
    --bs-link-color: #24155d;
    --bs-link-color-rgb: 36, 21, 93;
    --bs-link-hover-color: #2e9d62;
    --bs-link-hover-color-rgb: 46, 157, 98;
    --bs-body-bg: #f3f5fb;
    --bs-body-color: #1d2340;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bs-border-color: #e3e8f2;
}

html { scroll-behavior: smooth; }
body { font-family: var(--bs-body-font-family); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { transition: color .2s ease; }
::selection { background: rgba(var(--brand-green-rgb), .25); }

h1, h2, h3, h4, h5, h6 { color: var(--brand-navy); font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.65rem; }
.text-muted { color: var(--muted) !important; }

/* ---------- Skeleti: menyja anesore + permbajtja ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 28px 30px 56px; width: 100%; max-width: 1500px; }
.no-sidebar .content { margin: 0 auto; }

.sidebar {
    display: flex; flex-direction: column;
    background: linear-gradient(176deg, var(--brand-navy-dark) 0%, var(--brand-navy) 58%, #1d5a62 150%);
    color: #fff;
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    box-shadow: 4px 0 24px rgba(23, 13, 66, .18);
    z-index: 1040;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 6px; }
.sidebar-head { padding: 20px 18px 4px; }
.brand-card {
    display: flex; justify-content: center; background: #fff; border-radius: 12px; padding: 19px 12px;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.brand-card:hover { transform: translateY(-2px); }
.brand-card img { height: 98px; max-width: 100%; width: auto; object-fit: contain; display: block; }
.sidebar-title { padding: 14px 24px 2px; font-size: .95rem; font-weight: 650; color: #fff; letter-spacing: .01em; }
.sidebar-sub { padding: 0 24px 6px; font-size: .74rem; color: rgba(255, 255, 255, .55); }

.side-nav { padding: 8px 0 12px; }
.side-section {
    padding: 16px 26px 6px; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
    color: rgba(255, 255, 255, .45); font-weight: 600;
}
.side-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; margin: 2px 14px; border-radius: 12px;
    color: rgba(255, 255, 255, .82) !important; text-decoration: none; font-weight: 500; font-size: .92rem;
    transition: background-color .22s ease, color .22s ease, transform .22s var(--ease), box-shadow .22s ease;
}
.side-link i { font-size: 1.12rem; width: 22px; text-align: center; opacity: .92; }
.side-link:hover { background: rgba(255, 255, 255, .11); color: #fff !important; transform: translateX(4px); }
.side-link.active {
    background: linear-gradient(90deg, rgba(var(--brand-green-rgb), .96), rgba(var(--brand-green-rgb), .72));
    color: #fff !important; box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}
.sidebar-foot { margin-top: auto; padding: 14px 24px 20px; font-size: .72rem; color: rgba(255, 255, 255, .5); line-height: 1.5; }
.sidebar-backdrop { display: none; }

/* ---------- Shiriti lart ---------- */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 30px;
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.menu-toggle {
    display: none; border: 0; background: transparent; font-size: 1.7rem; color: var(--brand-navy);
    line-height: 1; padding: 2px 6px; border-radius: 10px; transition: background-color .2s;
}
.menu-toggle:hover { background: rgba(var(--brand-navy-rgb), .08); }
.topbar-search { position: relative; flex: 0 1 400px; }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topbar-search input {
    width: 100%; border: 1px solid var(--line); background: #f3f6fc; border-radius: 999px;
    padding: 9px 16px 9px 40px; font-size: .9rem; transition: all .22s ease;
}
.topbar-search input:focus {
    outline: none; background: #fff; border-color: var(--brand-green);
    box-shadow: 0 0 0 .22rem rgba(var(--brand-green-rgb), .16);
}
.user-chip {
    display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff;
    border-radius: 999px; padding: 4px 14px 4px 4px; font-size: .88rem; font-weight: 500; color: var(--ink);
    transition: box-shadow .22s ease, border-color .22s ease;
}
.user-chip:hover, .user-chip:focus { box-shadow: var(--shadow-sm); border-color: #cfd7ea; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-green)); color: #fff; font-weight: 700; font-size: .78rem;
}
.dropdown-menu { border: 0; border-radius: 14px; box-shadow: var(--shadow-md); padding: 8px; animation: fadeUp .18s var(--ease) both; }
.dropdown-item { border-radius: 9px; padding: 8px 12px; font-size: .9rem; transition: background-color .15s; }
.dropdown-item:hover { background: rgba(var(--brand-navy-rgb), .07); }

/* ---------- Animacione te buta ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes floatIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
.content > * { animation: fadeUp .42s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }

/* ---------- Kartela, butona, forma, tabela ---------- */
.card {
    border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
    overflow: hidden; transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
a > .card:hover, a.text-reset > .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-header {
    background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--brand-navy);
    padding: .9rem 1.15rem;
}
.card-body { padding: 1.15rem; }

.btn { border-radius: 11px; font-weight: 500; padding: .5rem 1rem; transition: transform .18s var(--ease), box-shadow .22s ease, background-color .22s ease, border-color .22s ease, color .22s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { border-radius: 9px; padding: .3rem .7rem; }
.btn-primary {
    --bs-btn-bg: var(--brand-navy); --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-bg: var(--brand-indigo); --bs-btn-hover-border-color: var(--brand-indigo);
    --bs-btn-active-bg: var(--brand-navy-dark); --bs-btn-active-border-color: var(--brand-navy-dark);
    --bs-btn-disabled-bg: var(--brand-navy); --bs-btn-disabled-border-color: var(--brand-navy);
    box-shadow: 0 6px 14px rgba(var(--brand-navy-rgb), .22);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-navy); --bs-btn-border-color: rgba(var(--brand-navy-rgb), .35);
    --bs-btn-hover-bg: var(--brand-navy); --bs-btn-hover-border-color: var(--brand-navy);
    --bs-btn-active-bg: var(--brand-navy-dark); --bs-btn-active-border-color: var(--brand-navy-dark);
}
.btn-success {
    --bs-btn-bg: var(--brand-green); --bs-btn-border-color: var(--brand-green);
    --bs-btn-hover-bg: #258652; --bs-btn-hover-border-color: #258652;
    --bs-btn-active-bg: #1e7345; --bs-btn-active-border-color: #1e7345;
    box-shadow: 0 6px 14px rgba(var(--brand-green-rgb), .24);
}
.btn-outline-success {
    --bs-btn-color: var(--brand-green); --bs-btn-border-color: rgba(var(--brand-green-rgb), .5);
    --bs-btn-hover-bg: var(--brand-green); --bs-btn-hover-border-color: var(--brand-green);
}
.btn-outline-secondary { --bs-btn-color: #55607f; --bs-btn-border-color: #cfd6e6; --bs-btn-hover-bg: #eef1f8; --bs-btn-hover-color: var(--brand-navy); --bs-btn-hover-border-color: #cfd6e6; }
.btn-outline-dark { --bs-btn-color: var(--brand-navy); --bs-btn-border-color: rgba(var(--brand-navy-rgb), .4); --bs-btn-hover-bg: var(--brand-navy); --bs-btn-hover-border-color: var(--brand-navy); }

.form-control, .form-select {
    border-radius: 11px; border: 1px solid #d9e0ee; padding: .55rem .85rem; background-color: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-green); box-shadow: 0 0 0 .22rem rgba(var(--brand-green-rgb), .16);
}
.form-label { font-weight: 500; font-size: .86rem; color: #3d4668; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--brand-green); border-color: var(--brand-green); }
.form-check-input:focus { border-color: var(--brand-green); box-shadow: 0 0 0 .22rem rgba(var(--brand-green-rgb), .16); }

.table { margin-bottom: 0; --bs-table-bg: transparent; }
.table > thead > tr > th {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    font-weight: 650; background: #f7f9fd; border-bottom: 1px solid var(--line); white-space: nowrap; padding-top: .8rem; padding-bottom: .8rem;
}
.table > :not(caption) > * > * { border-bottom-color: #edf0f7; padding-top: .72rem; padding-bottom: .72rem; }
.table-hover { --bs-table-hover-bg: rgba(var(--brand-green-rgb), .06); }
.table > tbody > tr { transition: background-color .18s ease; }
.table-report th { white-space: nowrap; }
.table-light { --bs-table-bg: #f7f9fd; }
code { color: var(--brand-indigo); background: rgba(var(--brand-navy-rgb), .06); padding: .1em .4em; border-radius: 6px; font-size: .85em; }

.badge { font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: .4em .75em; }
.alert { border: 0; border-radius: 14px; box-shadow: var(--shadow-sm); }
.alert-success { background: #e7f6ee; color: #14663c; }
.alert-danger { background: #fdecee; color: #a3243a; }
.alert-warning { background: #fff4de; color: #7a5200; }
.alert-info { background: #e8f0ff; color: #1f4fa8; }
.nav-tabs { border-bottom-color: var(--line); }
.nav-tabs .nav-link { border: 0; color: var(--muted); font-weight: 500; border-radius: 10px 10px 0 0; transition: color .2s, background-color .2s; }
.nav-tabs .nav-link:hover { color: var(--brand-navy); background: rgba(var(--brand-navy-rgb), .05); }
.nav-tabs .nav-link.active { color: var(--brand-navy); font-weight: 650; border-bottom: 3px solid var(--brand-green); background: transparent; }
dt { color: var(--muted); font-weight: 500; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { margin-bottom: 2px; }

/* ---------- Kartelat e dashboard-it (KPI) ---------- */
.kpi {
    --kpi-color: var(--brand-navy);
    position: relative; display: flex; align-items: center; gap: 14px; height: 100%;
    background: #fff; border-radius: var(--radius); padding: 16px 18px 16px 22px; box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none; overflow: hidden;
    transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--kpi-color); }
.kpi-icon {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.35rem; color: var(--kpi-color); background: color-mix(in srgb, var(--kpi-color) 12%, white);
    transition: transform .3s var(--ease);
}
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 500; line-height: 1.25; }
.kpi-value { font-size: 1.55rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: inherit; }
a.kpi:hover .kpi-icon { transform: scale(1.08) rotate(-4deg); }
.kpi-navy { --kpi-color: var(--brand-navy); }
.kpi-green { --kpi-color: var(--brand-green); }
.kpi-blue { --kpi-color: #3b6fd4; }
.kpi-amber { --kpi-color: #e09a14; }
.kpi-red { --kpi-color: #d6455b; }
.kpi-teal { --kpi-color: #12a5a0; }

/* ---------- Etiketat QR / barkod ---------- */
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.label-card { border: 1px dashed #888; padding: 8px; background: #fff; break-inside: avoid; border-radius: 6px; }
.label-head { font-size: .65rem; text-transform: uppercase; letter-spacing: .03em; color: #555; margin-bottom: 4px; }
.label-qr { width: 84px; height: 84px; image-rendering: pixelated; }
.label-code { font-weight: 700; font-size: 1.1rem; }
.label-name { font-size: .8rem; line-height: 1.15; }
.label-sub { font-size: .7rem; color: #555; }
.label-barcode { margin-top: 6px; }
.barcode { width: 100%; height: 40px; display: block; }

/* ---------- Dokument zyrtar (formulari i pranim-dorezimit) ---------- */
.doc { background: #fff; padding: 36px; max-width: 800px; margin: 0 auto; box-shadow: var(--shadow-sm); border-radius: 12px; }
.doc-logo { height: 62px; width: auto; }
.sig-line { border-top: 1px solid #000; margin: 56px 24px 0; padding-top: 4px; font-size: .85rem; }

/* ---------- Hyrja (login) ---------- */
.login-body { background: var(--bg); }
.login-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
    padding: 56px; color: #fff;
    background:
        radial-gradient(900px 520px at 15% 8%, rgba(var(--brand-green-rgb), .38), transparent 62%),
        linear-gradient(160deg, #170d42 0%, #24155d 55%, #1b4b63 125%);
}
.hero-inner { position: relative; z-index: 2; max-width: 470px; text-align: center; }
.logo-card {
    display: inline-block; background: #fff; border-radius: 22px; padding: 18px 24px; margin-bottom: 34px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, .3); animation: floatIn .8s var(--ease) both;
}
.logo-card img { height: 118px; width: auto; display: block; }
.login-hero h1 { color: #fff; font-weight: 700; font-size: 2.25rem; letter-spacing: -.02em; margin-bottom: 10px; animation: fadeUp .7s .1s var(--ease) both; }
.login-hero p { color: rgba(255, 255, 255, .78); font-size: 1.02rem; animation: fadeUp .7s .18s var(--ease) both; }
.hero-points { list-style: none; padding: 0; margin: 34px auto 0; display: inline-grid; gap: 12px; text-align: left; }
.hero-points li { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .9); font-size: .96rem; animation: fadeUp .7s var(--ease) both; }
.hero-points li:nth-child(1) { animation-delay: .26s; }
.hero-points li:nth-child(2) { animation-delay: .32s; }
.hero-points li:nth-child(3) { animation-delay: .38s; }
.hero-points li:nth-child(4) { animation-delay: .44s; }
.hero-points i { color: #7fd6a6; font-size: 1.15rem; line-height: 1; }
.hero-company { margin-top: 40px; color: rgba(255, 255, 255, .6); font-size: .85rem; animation: fadeUp .7s .5s var(--ease) both; }
.hero-wave { position: absolute; left: 0; bottom: 0; width: 200%; height: 250px; z-index: 1; animation: waveMove 18s ease-in-out infinite alternate; }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(-32%); } }
.login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 32px 20px 56px; }
.login-powered { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: var(--muted); font-size: .78rem; }
.login-card {
    width: 100%; max-width: 430px; background: #fff; border-radius: 24px; padding: 38px 36px;
    box-shadow: var(--shadow-md); animation: fadeUp .6s var(--ease) both;
}
.login-logo { height: 72px; width: auto; display: block; margin: 0 auto 26px; }
.login-card h2 { font-size: 1.55rem; margin-bottom: 4px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 2; pointer-events: none; }
.input-icon .form-control { padding-left: 44px; padding-right: 44px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 6px 9px; border-radius: 9px; z-index: 2; transition: background-color .2s, color .2s; }
.pw-toggle:hover { background: rgba(var(--brand-navy-rgb), .08); color: var(--brand-navy); }
.btn-login {
    width: 100%; border: 0; color: #fff; padding: .85rem 1rem; font-weight: 600; border-radius: 13px;
    background: linear-gradient(135deg, var(--brand-navy), #3d2d90);
    box-shadow: 0 12px 24px rgba(var(--brand-navy-rgb), .3);
    transition: transform .22s var(--ease), box-shadow .22s ease;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(var(--brand-navy-rgb), .38); color: #fff; }
.validation-summary-errors { background: #fdecee; color: #a3243a; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: .9rem; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.field-validation-error { color: #a3243a; font-size: .82rem; }

/* ---------- Pergjigjshmeria (telefon / tablet) ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; height: 100%;
        transform: translateX(-102%); transition: transform .34s var(--ease);
    }
    body.sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(12, 8, 44, .5); z-index: 1039;
        opacity: 0; pointer-events: none; transition: opacity .3s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .menu-toggle { display: inline-block; }
    .topbar { padding: 10px 14px; }
    .content { padding: 20px 14px 48px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .label-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Printimi ---------- */
@page { size: A4; margin: 14mm; }
@media print {
    .sidebar, .sidebar-backdrop, .topbar, nav, .no-print, .btn { display: none !important; }
    body { background: #fff !important; }
    .app-shell { display: block; }
    .content { padding: 0; max-width: 100%; }
    .content > * { animation: none !important; }
    .card { box-shadow: none !important; border: 0 !important; }
    table { font-size: 11px; }
    .doc { box-shadow: none; padding: 0; max-width: 100%; border-radius: 0; }
    .label-grid { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
