:root{
  --bg:#f6f7fb;--card:#fff;--text:#2b2f33;--muted:#6c757d;--primary:#0d6efd;
  --danger:#dc3545;--border:#e6e8ee;--success:#1a7f37;--warning:#ff9a3c;
  --shadow:0 10px 24px rgba(16,24,40,.06)
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,'Noto Sans','Helvetica Neue',Arial,sans-serif;color:var(--text);background:var(--bg)}
a{color:var(--primary);text-decoration:none}

/* ====== LAYOUT (admin) ====== */
.layout{display:flex;min-height:100vh}
.sidebar{width:250px;background:linear-gradient(180deg,#10151c,#171c24);color:#c9d1d9;position:sticky;top:0;height:100vh;padding:16px 0;overflow:auto}
.sidebar .logo{padding:0 16px 16px}
.sidebar .logo img{max-width:180px;display:block;filter:brightness(1.2)}
.menu{list-style:none;margin:0;padding:0}
.menu li a{display:flex;gap:10px;align-items:center;color:#c9d1d9;padding:10px 16px;border-left:3px solid transparent}
.menu li.active>a{background:#0d6efd1a;border-left-color:#0d6efd;color:#fff}
.menu li a:hover{background:#223043}
.content{flex:1;display:flex;flex-direction:column}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--card);position:sticky;top:0;z-index:5}
.brand{font-weight:600}
.container{padding:20px}

/* Grids, tables, forms */
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media(max-width:900px){.grid-3{grid-template-columns:1fr}.sidebar{position:fixed;transform:none}}

.stat{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:14px;box-shadow:var(--shadow)}
.stat-title{color:var(--muted);font-size:12px}
.stat-value{font-size:28px;font-weight:700;margin-top:6px}

/* ===== Modern buttons ===== */
.btn{display:inline-flex;align-items:center;gap:8px;border:1px solid transparent;background:var(--primary);color:#fff;padding:9px 14px;border-radius:10px;cursor:pointer;box-shadow:var(--shadow);transition:transform .06s ease,filter .15s ease}
.btn:hover{filter:brightness(.97)}
.btn:active{transform:translateY(1px)}
.btn i{font-size:14px}

.btn-primary{background:linear-gradient(180deg,#3b82f6,#2563eb);border-color:#2563eb}
.btn-secondary{background:#eef1f6;color:#111;border-color:#dfe3ea}
.btn-danger{background:linear-gradient(180deg,#dc3545,#b02a37);border-color:#b02a37}
.btn-outline{background:transparent;border-color:#dfe3ea;color:#1f2937}
.btn-light{background:#e9ecef;color:#111;border-color:#dfe3ea}
.btn-success{background:linear-gradient(180deg,#22c55e,#16a34a);border-color:#16a34a}

.btn-icon{padding:8px;border-radius:10px;min-width:36px;justify-content:center}
.btn-group{display:inline-flex;gap:6px}

/* Toolbar */
.toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.input-search{position:relative;flex:1 1 260px;min-width:240px}
.input-search input{width:100%;padding:10px 12px 10px 36px;border:1px solid var(--border);border-radius:10px;background:#fff}
.input-search i{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:#9aa3af}

/* ===== Modern tables ===== */
.table-card{background:var(--card);border:1px solid var(--border);border-radius:14px;overflow:hidden;box-shadow:var(--shadow)}
.table-wrap{overflow:auto}
.table{width:100%;border-collapse:separate;border-spacing:0}
.table thead th{position:sticky;top:0;background:#f8fafc;border-bottom:1px solid var(--border);font-size:12px;letter-spacing:.02em;text-transform:uppercase;color:#667085;padding:12px}
.table td{padding:12px;border-bottom:1px solid var(--border);vertical-align:top}
.table-modern tbody tr:hover{background:#f9fbff}
.table-striped tbody tr:nth-child(even){background:#fcfdff}
.table .actions{white-space:nowrap}

.chip{display:inline-flex;align-items:center;gap:6px;background:color-mix(in srgb, var(--chip) 16%, white);color:#111;border:1px solid var(--border);padding:4px 10px;border-radius:999px;font-weight:600}
.pw-cell{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

/* Cards / alerts / forms */
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:10px;box-shadow:var(--shadow)}
.alert{padding:10px 12px;border-radius:10px}
.alert-danger{background:#ffe0e3;color:#6b0e18;border:1px solid #ffd3d8}

/* Small utils */
.inline{display:inline}
.form-actions{display:flex;gap:8px;justify-content:flex-end}
.muted{color:#6c757d;font-size:12px}

/* ====== AUTH MODE ====== */
.auth-mode{color:#fff;background:linear-gradient(135deg,#1e293b,#0f172a 45%,#1c1c1c)}
.auth-mode .topbar-auth{background:transparent;border-bottom-color:rgba(255,255,255,.12);color:#fff}
.auth-mode .brand{color:#fff}
.auth-mode .container-auth{display:flex;align-items:center;justify-content:center;min-height:calc(100vh - 60px);padding:30px}
.auth-card{
  background:rgba(255,255,255,0.06);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border:1px solid rgba(255,255,255,0.16);
  border-radius:16px;
  width:100%;max-width:440px;padding:30px 26px;
  box-shadow:0 10px 40px rgba(0,0,0,0.28)
}
.auth-logo{text-align:center;margin-bottom:14px}
.auth-logo img{height:48px;filter:drop-shadow(0 2px 2px rgba(0,0,0,.55))}
.auth-title{text-align:center;font-size:22px;font-weight:700;margin:6px 0 16px}
.auth-sub{text-align:center;color:#d0d6e1;margin:-6px 0 16px}
.auth-input{position:relative;margin-bottom:12px}
.auth-input i{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#aab3c0}
.auth-input input{width:100%;padding:10px 12px 10px 38px;border:1px solid rgba(255,255,255,0.25);border-radius:8px;background:rgba(255,255,255,0.08);color:#fff}
.auth-input input::placeholder{color:#b8c0cc}
.pw-toggle{position:absolute;right:10px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:#b8c0cc;font-size:14px;cursor:pointer}
.btn-auth{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;background:linear-gradient(90deg,#ff7a00,#ff9a3c);color:#fff;border:0;border-radius:8px;padding:10px 0;font-weight:600;cursor:pointer;transition:opacity .15s}
.btn-auth:hover{opacity:.92}

/* Responsive tweaks */
@media (max-width:720px){
  .btn-group{gap:4px}
  .btn{padding:8px 10px}
  .table thead th{font-size:11px}
  .table td{padding:10px}
}
/* === Fix: full-width inputs u formama + bolji spacing === */
.form{max-width:960px}
.field{margin-bottom:14px}
.field label{display:block;font-weight:600;margin-bottom:6px;color:#475467}
.card .field input,
.card .field select,
.card .field textarea{width:100%}
/* ======== FORM RE-STYLE (clean, modern) ======== */
.page{max-width:1040px;margin:0 auto}
.card.form{box-shadow:0 10px 30px rgba(16,24,40,.08);border-radius:16px;padding:22px;border:1px solid #e7eaf0;background:#fff}
.form-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:920px){.form-grid{grid-template-columns:1fr}}
.form-field{display:flex;flex-direction:column}
.form-field label{font-weight:600;margin:4px 0 6px;color:#334155}
.form-control, .form-select, .form-textarea{
  width:100%;border:1px solid #e6e8ee;background:#fff;border-radius:12px;
  padding:12px 14px;font-size:14px;line-height:1.35;min-height:44px
}
.form-textarea{min-height:88px;resize:vertical}
.form-control:focus, .form-select:focus, .form-textarea:focus{
  outline:none;border-color:#93c5fd;box-shadow:0 0 0 4px rgba(59,130,246,.15)
}
.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:6px}
.btn{display:inline-flex;align-items:center;gap:8px;border-radius:12px;padding:10px 14px}
.btn-secondary{background:#eef2f7;border:1px solid #e3e7ef;color:#111}
.btn-success{background:linear-gradient(180deg,#22c55e,#16a34a);border:1px solid #16a34a;color:#fff}
.btn-secondary:hover{filter:brightness(.98)}
.btn-success:hover{filter:brightness(.98)}
.input-row{display:flex;gap:12px}
.input-row>*{flex:1}
.help{color:#6b7280;font-size:12px;margin-top:4px}
/* ===== CATEGORIES POLISH ===== */
.page-wide{max-width:1200px;margin:0 auto}
.section-title{margin:0 0 18px}
.section-title h1{font-size:26px;margin:0}
.columns{display:grid;grid-template-columns:360px 1fr;gap:18px}
@media(max-width:980px){.columns{grid-template-columns:1fr}}

.card-elev{background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 10px 26px rgba(16,24,40,.08);padding:16px;display:flex;flex-direction:column;gap:10px}
.card-elev h3{margin:0 0 6px}

.form-compact .form-field{margin-bottom:10px}
.form-compact label{display:block;font-weight:600;margin:4px 0 6px;color:#344054}
.form-compact input{width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:12px}

.table-pro{width:100%;border-collapse:separate;border-spacing:0}
.table-shell{background:#fff;border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:0 10px 26px rgba(16,24,40,.06)}
.table-pro thead th{background:#f8fafc;color:#667085;font-size:12px;text-transform:uppercase;letter-spacing:.02em;padding:12px;border-bottom:1px solid var(--border);position:sticky;top:0}
.table-pro td{padding:12px;border-bottom:1px solid var(--border);vertical-align:middle}
.table-pro tbody tr:hover{background:#fafcff}

.pill{display:inline-flex;align-items:center;gap:8px;font-weight:600;border-radius:999px;padding:6px 10px;border:1px solid var(--border);background:#f8fafc;color:#111}
.pill-soft{background:rgba(0,0,0,.03)}
.swatch{width:18px;height:18px;border-radius:5px;border:1px solid var(--border);background:var(--c);display:inline-block}

.td-actions{white-space:nowrap}
.btn-ghost{background:#eef2f7;border:1px solid #e3e7ef;color:#111}
.btn-ghost:hover{filter:brightness(.98)}
.btn-icon-round{width:38px;height:38px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;padding:0}
/* ===== DASHBOARD ===== */
.dash .dash-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.dash-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:18px}
@media(max-width:1100px){.dash-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){.dash-stats{grid-template-columns:1fr}}

.stat-card{
  display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--border);
  border-radius:16px;box-shadow:0 10px 26px rgba(16,24,40,.06);padding:14px 16px;min-height:88px
}
.stat-ico{
  width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:18px;flex:0 0 44px
}
.stat-meta .stat-title{color:#667085;font-size:12px;text-transform:uppercase;letter-spacing:.03em}
.stat-meta .stat-value{font-size:22px;font-weight:800;margin-top:6px}
.stat-blue  .stat-ico{background:linear-gradient(180deg,#60a5fa,#3b82f6)}
.stat-purple.stat-card .stat-ico{background:linear-gradient(180deg,#a78bfa,#7c3aed)}
.stat-green .stat-ico{background:linear-gradient(180deg,#34d399,#10b981)}
.stat-amber .stat-ico{background:linear-gradient(180deg,#fbbf24,#f59e0b)}

.dash-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media(max-width:1100px){.dash-grid{grid-template-columns:1fr}}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.section-head h3{margin:0}

/* Top kategorije */
.topcats{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media(max-width:600px){.topcats{grid-template-columns:1fr}}
.topcat{display:flex;gap:12px;align-items:center;border:1px solid var(--border);border-radius:14px;padding:12px;background:#fff}
.topcat-ico{width:38px;height:38px;border-radius:10px;background:var(--c);display:flex;align-items:center;justify-content:center;color:#fff}
.topcat-name{font-weight:700}
.topcat-sub{color:#667085;font-size:12px;margin-top:2px}

/* Mini tablica */
.table-pro.mini thead th{font-size:11px}
.table-pro.mini td{padding:10px}

/* ===== CATEGORY BAR CHART ===== */
.chart{display:flex;flex-direction:column;gap:8px}
.chart-row{display:grid;grid-template-columns:240px 1fr 64px;gap:12px;align-items:center}
@media(max-width:900px){.chart-row{grid-template-columns:1fr}}
.chart-label{display:flex;align-items:center;gap:10px;min-width:0}
.chart-label .dot{width:12px;height:12px;border-radius:999px;background:var(--c);display:inline-block;border:1px solid #e5e7eb}
.chart-label .name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.chart-bar{position:relative;height:14px;background:#f1f5f9;border:1px solid #e5e7eb;border-radius:999px;overflow:hidden}
.chart-bar .bar-fill{
  position:absolute;left:0;top:0;bottom:0;width:var(--w);
  background:linear-gradient(180deg, color-mix(in srgb, var(--c) 92%, white) , var(--c));
  border-right:1px solid color-mix(in srgb, #000 10%, var(--c));
}

.chart-value{text-align:right;font-weight:700;color:#334155}

/* clickable topcat */
.topcat{text-decoration:none;color:inherit;transition:transform .06s ease, box-shadow .15s}
.topcat:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(16,24,40,.08)}

/* ===== Passwords Grid (refined) ===== */
.grid-cards{
  display:grid;grid-template-columns:repeat(3,1fr);gap:16px
}
@media(max-width:1200px){.grid-cards{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.grid-cards{grid-template-columns:1fr}}

.pw-card{
  background:#fff;border:1px solid var(--border);border-radius:16px;padding:14px;
  box-shadow:0 12px 28px rgba(16,24,40,.07);display:flex;flex-direction:column;gap:10px;
  transition:transform .06s ease, box-shadow .15s ease
}
.pw-card:hover{transform:translateY(-1px);box-shadow:0 16px 32px rgba(16,24,40,.10)}

/* header */
.pw-card-head{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center}
.pw-avatar{
  width:42px;height:42px;border-radius:12px;background:var(--cat);
  color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px
}
.pw-head-meta{min-width:0}
.pw-title{font-size:16px;line-height:1.2}
.pw-host{color:#667085;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chip-soft{background:#f8fafc;border:1px solid var(--border);border-radius:999px;padding:6px 10px}

/* rows */
.pw-kv{display:flex;align-items:center;gap:8px;color:#475467}
.pw-kv i{width:16px;text-align:center;opacity:.75}

/* footer actions */
.pw-card-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:6px;flex-wrap:wrap}

/* Drag handle i ghost */
.drag-h{cursor:grab}
.drag-ghost{
  position:fixed; left:0; top:0; z-index:9999; pointer-events:none;
  box-shadow:0 16px 36px rgba(16,24,40,.18); transform:translate(0,0);
  border-radius:12px; opacity:.95; background:#fff
}

/* Placeholder za GRID */
.drag-placeholder{
  border:2px dashed #cbd5e1; border-radius:12px; background:rgba(148,163,184,.08)
}

/* Placeholder za LISTU (tablica) */
.drag-placeholder-row .drag-placeholder-cell{
  border:2px dashed #cbd5e1; background:rgba(148,163,184,.08); border-radius:8px;
}

