@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --navy:        #0b2545;
  --navy-deep:   #071a33;
  --blue:        #1a5fa8;
  --blue-mid:    #2271c7;
  --sky:         #4a9fd4;
  --teal:        #3ab5c8;
  --water:       #b3dce8;
  --gold:        #c09a3a;
  --gold-light:  #e4be5a;
  --white:       #ffffff;
  --surface:     #f4f6f9;
  --surface2:    #eaecf2;
  --surface3:    #dde3ee;
  --text:        #0d1e34;
  --text-2:      #3d506a;
  --muted:       #6b829e;
  --border:      #d0d9e8;
  --border-2:    #e6ebf4;
  --danger:      #c0392b;
  --success:     #18885a;
  --warn:        #c97b1a;
  --shadow:    0 1px 4px rgba(11,37,69,0.08), 0 4px 16px rgba(11,37,69,0.05);
  --shadow-md: 0 4px 12px rgba(11,37,69,0.10), 0 8px 32px rgba(11,37,69,0.06);
  --shadow-lg: 0 8px 24px rgba(11,37,69,0.14), 0 20px 48px rgba(11,37,69,0.08);
  --shadow-xl: 0 20px 60px rgba(11,37,69,0.20);
  --r:    6px;
  --r-md: 10px;
  --r-lg: 14px;
  --sb-w: 240px;
  --font: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-display: 'Playfair Display', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--surface); color: var(--text); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

/* ── LOGIN ── */
#login-screen { position: fixed; inset: 0; background: var(--navy-deep); display: flex; align-items: center; justify-content: center; z-index: 1000; transition: opacity .5s ease, transform .5s ease; overflow: hidden; }
#login-screen.hidden { opacity: 0; pointer-events: none; transform: scale(1.04); }
.login-grid { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-grid::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 50%, rgba(26,95,168,.18) 0%, transparent 60%), radial-gradient(circle at 80% 20%, rgba(58,181,200,.12) 0%, transparent 50%), radial-gradient(circle at 60% 85%, rgba(192,154,58,.08) 0%, transparent 45%); }
.login-grid::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(0deg, transparent, transparent 48px, rgba(255,255,255,.018) 48px, rgba(255,255,255,.018) 49px), repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(255,255,255,.018) 48px, rgba(255,255,255,.018) 49px); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.orb1 { width: 500px; height: 500px; background: rgba(26,95,168,.15); top: -150px; right: -120px; animation: orbFloat 14s ease-in-out infinite; }
.orb2 { width: 380px; height: 380px; background: rgba(58,181,200,.10); bottom: -100px; left: -80px; animation: orbFloat 18s ease-in-out infinite reverse; }
@keyframes orbFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-20px) scale(1.05); } }
.login-card { background: rgba(255,255,255,0.98); border-radius: 18px; width: 420px; max-width: 96vw; box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); overflow: hidden; animation: loginIn .7s cubic-bezier(.16,1,.3,1) both; }
@keyframes loginIn { from { opacity: 0; transform: translateY(40px) scale(.96); } }
.login-header { background: linear-gradient(150deg, var(--navy-deep) 0%, #0f3060 60%, var(--blue) 100%); padding: 36px 32px 28px; text-align: center; position: relative; overflow: hidden; }
.login-header::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.login-logo { width: 76px; height: 76px; margin: 0 auto 18px; filter: drop-shadow(0 4px 20px rgba(0,0,0,.5)); }
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-header .city { color: rgba(255,255,255,.45); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 5px; font-weight: 500; }
.login-header h2 { color: var(--white); font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: .2px; }
.lang-switch { display: inline-flex; border-radius: 5px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); margin-top: 16px; }
.lang-btn { background: transparent; border: none; color: rgba(255,255,255,.5); padding: 5px 16px; cursor: pointer; font-size: 11px; font-weight: 600; font-family: var(--font); letter-spacing: .8px; transition: all .2s; }
.lang-btn.active { background: var(--gold); color: var(--navy-deep); }
.lang-btn:hover:not(.active) { background: rgba(255,255,255,.10); color: white; }
.login-body { padding: 30px 32px 32px; }
.form-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.form-input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md); font-family: var(--font); font-size: 14px; color: var(--text); outline: none; transition: all .2s; background: var(--surface); }
.form-input:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 3px rgba(26,95,168,.10); }
.form-group { margin-bottom: 18px; }
.btn-login { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--navy) 0%, var(--blue-mid) 100%); color: white; border: none; border-radius: var(--r-md); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .22s; letter-spacing: .3px; box-shadow: 0 4px 18px rgba(26,95,168,.30); position: relative; overflow: hidden; }
.btn-login::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.06), transparent); }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(26,95,168,.40); }
.demo-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border-2); }
.demo-label { font-size: 10.5px; color: var(--muted); text-align: center; font-weight: 600; margin-bottom: 10px; letter-spacing: .4px; text-transform: uppercase; }
.demo-accounts { display: flex; gap: 8px; }
.demo-pill { flex: 1; padding: 9px 8px; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: var(--r-md); cursor: pointer; font-size: 11px; text-align: center; transition: all .18s; font-family: var(--font-mono); color: var(--muted); }
.demo-pill strong { display: block; color: var(--navy); font-size: 12px; margin-bottom: 2px; font-family: var(--font); }
.demo-pill:hover { background: var(--navy); color: rgba(255,255,255,.65); border-color: var(--navy); transform: translateY(-1px); }
.demo-pill:hover strong { color: var(--gold-light); }

/* ── TOPBAR ── */
#app { display: none; flex-direction: column; min-height: 100vh; }
#app.visible { display: flex; }
.topbar { background: var(--navy-deep); border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 58px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 16px rgba(0,0,0,.25); position: relative; }
.topbar::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-light) 40%, transparent 70%); pointer-events: none; }
.topbar-logo { height: 38px; width: 38px; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.topbar-logo img { height: 100%; width: 100%; object-fit: contain; }
.topbar-divider { width: 1px; height: 28px; background: rgba(255,255,255,.12); margin: 0 2px; }
.topbar-title { flex: 1; }
.topbar-org { color: white; font-size: 13.5px; font-weight: 600; letter-spacing: .1px; }
.topbar-sub { color: rgba(255,255,255,.38); font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase; margin-top: 1px; }
.topbar-lang { display: flex; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; overflow: hidden; }
.topbar-lang .lang-btn { font-size: 10.5px; padding: 4px 12px; }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); border-radius: var(--r-md); cursor: pointer; transition: background .18s; }
.tb-user:hover { background: rgba(255,255,255,.11); }
.tb-avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--navy-deep); flex-shrink: 0; letter-spacing: .5px; }
.tb-name { color: white; font-size: 12px; font-weight: 600; }
.tb-role { color: rgba(255,255,255,.40); font-size: 10px; margin-top: 1px; }
.btn-logout { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.70); padding: 7px 14px; border-radius: var(--r); font-family: var(--font); font-size: 12px; font-weight: 500; cursor: pointer; transition: all .18s; letter-spacing: .2px; }
.btn-logout:hover { background: rgba(255,255,255,.14); color: white; }

/* ── LAYOUT ── */
.app-body { display: flex; flex: 1; }

/* ── SIDEBAR ── */
.sidebar { width: var(--sb-w); background: white; border-right: 1px solid var(--border-2); display: flex; flex-direction: column; flex-shrink: 0; box-shadow: 1px 0 8px rgba(11,37,69,.04); }
.sb-section { padding: 16px 10px 8px; }
.sb-section-label { font-size: 9.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); padding: 0 8px; margin-bottom: 6px; opacity: .7; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; transition: all .15s; margin-bottom: 1px; font-size: 13px; color: var(--text-2); font-weight: 500; position: relative; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: rgba(26,95,168,.08); color: var(--blue); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: -1px; top: 20%; bottom: 20%; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.nav-icon { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; opacity: .85; }
.nav-badge { margin-left: auto; background: var(--blue); color: white; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-family: var(--font-mono); }

/* ── MAIN CONTENT ── */
.main-content { flex: 1; overflow-y: auto; min-width: 0; }
.view { display: none; padding: 24px 28px; }
.view.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--navy); letter-spacing: -.2px; line-height: 1.2; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; font-weight: 400; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--r-md); font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .18s; border: none; letter-spacing: .15px; white-space: nowrap; }
.btn-primary { background: var(--blue); color: white; box-shadow: 0 2px 8px rgba(26,95,168,.25); }
.btn-primary:hover { background: var(--blue-mid); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,95,168,.30); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--surface2); }
.btn-gold { background: linear-gradient(135deg, #b8882e, #d4a83c); color: white; box-shadow: 0 2px 8px rgba(192,154,58,.25); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(192,154,58,.35); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { background: var(--surface); border: 1.5px solid var(--border); color: var(--muted); padding: 6px 9px; border-radius: var(--r); cursor: pointer; font-size: 14px; transition: all .15s; }
.btn-icon:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: var(--r-lg); padding: 20px; border: 1px solid var(--border-2); box-shadow: var(--shadow); transition: all .2s; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card:nth-child(1)::after { background: var(--blue); }
.stat-card:nth-child(2)::after { background: var(--teal); }
.stat-card:nth-child(3)::after { background: var(--success); }
.stat-card:nth-child(4)::after { background: var(--gold); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon-wrap { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px; }
.stat-icon-wrap.blue { background: rgba(26,95,168,.10); }
.stat-icon-wrap.teal { background: rgba(58,181,200,.12); }
.stat-icon-wrap.green { background: rgba(24,136,90,.10); }
.stat-icon-wrap.gold { background: rgba(192,154,58,.12); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); font-family: var(--font-mono); line-height: 1; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 500; }

/* ── CAP CARDS ── */
.cap-card { background: white; border-radius: var(--r-lg); padding: 18px 20px; border: 1.5px solid var(--border-2); box-shadow: var(--shadow); transition: all .2s; cursor: pointer; display: flex; align-items: center; gap: 14px; }
.cap-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--water); }

/* ── CARD PANELS ── */
.card { background: white; border-radius: var(--r-lg); border: 1px solid var(--border-2); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; justify-content: space-between; background: white; }
.card-title { font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: .1px; }
.card-body { padding: 0; }

/* ── DOC TABLE ── */
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th { padding: 10px 14px; background: var(--surface); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border-2); }
.doc-table td { padding: 12px 14px; border-bottom: 1px solid var(--surface2); font-size: 13px; vertical-align: middle; color: var(--text); }
.doc-table tr:hover td { background: rgba(26,95,168,.025); }
.doc-table tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.badge-blue { background: rgba(26,95,168,.10); color: var(--blue); }
.badge-green { background: rgba(24,136,90,.10); color: var(--success); }
.badge-gold { background: rgba(192,154,58,.12); color: #9a7220; }
.badge-red { background: rgba(192,57,43,.10); color: var(--danger); }
.badge-gray { background: var(--surface2); color: var(--muted); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.draft { background: rgba(107,130,158,.10); color: var(--muted); }
.status-badge.draft::before { background: var(--muted); }
.status-badge.active { background: rgba(24,136,90,.09); color: var(--success); }
.status-badge.active::before { background: var(--success); }
.status-badge.pending { background: rgba(201,123,26,.10); color: var(--warn); }
.status-badge.pending::before { background: var(--warn); }

/* ── NOTIFICATIONS ── */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item { display: flex; gap: 14px; align-items: flex-start; padding: 13px 20px; border-bottom: 1px solid var(--surface2); transition: background .15s; cursor: default; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(26,95,168,.025); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; margin-top: 6px; }
.notif-text { font-size: 13px; color: var(--text); line-height: 1.5; flex: 1; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }

/* ── USER CARDS ── */
.user-card { background: white; border-radius: var(--r-lg); border: 1px solid var(--border-2); box-shadow: var(--shadow); padding: 20px; transition: all .2s; }
.user-card:hover { box-shadow: var(--shadow-md); border-color: var(--water); transform: translateY(-1px); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.user-avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex-shrink: 0; letter-spacing: .5px; }

/* ── FORMS ── */
textarea, select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md); font-family: var(--font); font-size: 13px; color: var(--text); background: var(--surface); outline: none; cursor: pointer; transition: all .2s; }
textarea { cursor: text; resize: vertical; }
textarea:focus, select:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 3px rgba(26,95,168,.09); }
.format-card { background: white; border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; cursor: pointer; transition: all .18s; }
.format-card:hover { border-color: var(--blue); background: var(--surface); }
.format-card.selected { border-color: var(--blue); background: rgba(26,95,168,.06); box-shadow: 0 0 0 3px rgba(26,95,168,.08); }
.hyrje-section { margin-bottom: 16px; }
.hyrje-section-title { font-size: 10px; font-weight: 700; color: var(--navy); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--surface2); }
.hyrje-party { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; border-left: 3px solid var(--blue); }
.hyrje-party-title { font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.hyrje-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hyrje-notes { background: rgba(11,37,69,.03); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 12px 16px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.hyrje-notes ul { padding-left: 16px; margin: 0; }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(7,24,40,.6); backdrop-filter: blur(6px); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--r-lg); width: 560px; max-width: 96vw; box-shadow: var(--shadow-xl); animation: slideUp .3s cubic-bezier(.16,1,.3,1); overflow: hidden; }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.modal-head { background: linear-gradient(135deg, var(--navy-deep), var(--blue)); padding: 18px 22px; color: white; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--gold); }
.modal-head h3 { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.modal-close { background: rgba(255,255,255,.10); border: none; color: rgba(255,255,255,.7); font-size: 18px; cursor: pointer; width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.modal-close:hover { background: rgba(255,255,255,.18); color: white; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--border-2); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); }

/* ── USER MGMT MODAL ── */
.um-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(7,24,40,.65); backdrop-filter: blur(4px); z-index: 600; align-items: center; justify-content: center; }
.um-modal-overlay.open { display: flex; }
.um-modal { background: white; border-radius: var(--r-lg); width: 560px; max-width: 96vw; box-shadow: var(--shadow-xl); animation: slideUp .3s cubic-bezier(.16,1,.3,1); overflow: hidden; max-height: 90vh; overflow-y: auto; }
.um-modal-head { background: linear-gradient(135deg, var(--navy-deep), var(--blue)); color: white; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--gold); position: sticky; top: 0; z-index: 1; }
.um-modal-head h3 { font-size: 15px; font-weight: 700; }
.um-modal-body { padding: 24px; }
.um-modal-foot { padding: 16px 24px; border-top: 1px solid var(--border-2); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); }
.um-section-title { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--surface2); }
.um-section-title:first-child { margin-top: 0; }
.assign-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 8px; }
.assign-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--surface); transition: background .15s; }
.assign-item:hover { background: var(--surface2); }
.assign-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.assign-item label { font-size: 13px; font-weight: 500; cursor: pointer; flex: 1; }
.assign-item .assign-role { font-size: 10px; color: var(--muted); }
.confirm-del-overlay { display: none; position: fixed; inset: 0; background: rgba(7,24,40,.75); backdrop-filter: blur(4px); z-index: 700; align-items: center; justify-content: center; }
.confirm-del-overlay.open { display: flex; }
.confirm-del-box { background: white; border-radius: var(--r-lg); width: 380px; padding: 32px; text-align: center; box-shadow: var(--shadow-xl); animation: slideUp .25s ease; }

/* ── TOAST ── */
#toast { position: fixed; bottom: 28px; right: 28px; z-index: 9999; background: var(--navy); color: white; padding: 13px 18px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-xl); border-left: 3px solid var(--gold); transform: translateX(140%); transition: transform .35s cubic-bezier(.16,1,.3,1); max-width: 320px; line-height: 1.4; }
#toast.show { transform: translateX(0); }

.section-sep { height: 1px; background: var(--border-2); margin: 4px 0; }

/* ── FOLDER VIEW ── */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 18px; }
.folder-card { background: white; border: 1px solid var(--border-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); transition: all .2s; }
.folder-card:hover { box-shadow: var(--shadow-md); border-color: var(--water); transform: translateY(-1px); }
.folder-header { background: linear-gradient(135deg, var(--navy-deep) 0%, var(--blue) 100%); padding: 14px 18px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.folder-header .folder-icon { font-size: 18px; }
.folder-header .folder-name { color: white; font-weight: 600; font-size: 13px; flex: 1; }
.folder-header .folder-count { font-size: 11px; color: rgba(255,255,255,.6); background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 10px; }
.folder-header .folder-toggle { color: rgba(255,255,255,.55); font-size: 11px; transition: transform .2s; }
.folder-header.collapsed .folder-toggle { transform: rotate(-90deg); }
.folder-body { border-top: 1px solid var(--border-2); }
.folder-body.hidden { display: none; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--surface2); cursor: pointer; transition: background .15s; }
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: rgba(26,95,168,.035); }
.doc-row-info { flex: 1; min-width: 0; }
.doc-row-num { font-size: 11px; font-weight: 600; color: var(--navy); font-family: var(--font-mono); }
.doc-row-subject { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.doc-row-date { font-size: 10.5px; color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }
.doc-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.doc-row:hover .doc-row-actions { opacity: 1; }
.folder-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }

/* ── SAVE INDICATOR ── */
.save-indicator { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px; }
.save-indicator.saving { background: #fff3cd; color: #856404; }
.save-indicator.saved  { background: #d1fae5; color: #065f46; }
.save-indicator.error  { background: #fee2e2; color: #991b1b; }

/* ── PRINT ── */
@media print {
  body > *:not(#print-frame) { display: none !important; }
  #print-frame { display: block !important; position: fixed; inset: 0; background: white; width: 100%; height: 100%; z-index: 99999; }
  .no-print { display: none !important; }
  .print-page { width: 210mm; min-height: 270mm; margin: 0 auto; padding: 0; }
  .print-header, .print-footer { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#print-frame { display: none; }
.print-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 500; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.print-modal-overlay.open { display: flex; }
.print-modal-inner { background: white; border-radius: var(--r-lg); width: 860px; max-width: 100%; box-shadow: var(--shadow-xl); animation: slideUp .3s cubic-bezier(.16,1,.3,1); overflow: hidden; }
.print-modal-topbar { background: var(--navy); color: white; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--gold); }
.print-modal-topbar h3 { font-size: 14px; font-weight: 700; }
.print-actions { display: flex; gap: 8px; }
.print-page { font-family: var(--font); width: 100%; background: white; }
.print-header { background: white; padding: 14px 22px 0; }
.print-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.print-header-left { flex: 1; }
.print-header-left .mun-name { font-size: 13px; font-weight: 700; color: #0d2b52; line-height: 1.75; }
.print-header-center { width: 90px; flex-shrink: 0; text-align: center; }
.print-header-right { flex: 1; text-align: right; font-size: 10px; color: #444; line-height: 1.85; }
.print-header-border { height: 5px; background: #000; margin: 0 -22px; }
.print-header-border-blue { height: 2px; background: #1a5fa8; margin: 0 -22px; margin-bottom: 10px; }
.print-header-meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 4px; font-size: 10px; border-top: 1px solid #ddd; margin-top: 6px; }
.print-header-meta .doc-label { font-size: 11px; font-weight: 700; color: #0d2b52; }
.print-meta-row { display: grid; grid-template-columns: 1fr 1fr; background: #f0f4f8; border-bottom: 1px solid #ccd6e4; margin-top: 18px; }
.print-meta-col { padding: 12px 22px; font-size: 11px; }
.print-meta-col:first-child { border-right: 1px solid #ccd6e4; }
.print-meta-col table { width: 100%; border-collapse: collapse; }
.print-meta-col td { padding: 3px 0; vertical-align: top; }
.print-meta-col td:first-child { width: 90px; color: #5a7090; font-weight: 700; }
.print-meta-col td:last-child { font-weight: 600; color: #0d1e34; }
.print-title-row { display: grid; grid-template-columns: 1fr 1fr; padding: 16px 22px 8px; border-bottom: 1px solid #e4eaf2; }
.print-title-col { padding: 0 12px; }
.print-title-col:first-child { padding-left: 0; border-right: 1px solid #ccd6e4; }
.print-title-col h2 { font-size: 15px; font-weight: 800; color: #0d2b52; line-height: 1.3; }
.print-body-row { display: grid; grid-template-columns: 1fr 1fr; padding: 16px 22px; min-height: 180px; }
.print-body-col { padding: 0 12px; }
.print-body-col:first-child { padding-left: 0; border-right: 1px solid #e4eaf2; }
.print-lang-bar { display: none; }
.print-body-text { font-size: 12px; line-height: 1.8; color: #0d1e34; white-space: pre-wrap; }
.print-sign-row { display: grid; grid-template-columns: 1fr 1fr; padding: 16px 22px; background: #f0f4f8; border-top: 1px solid #ccd6e4; }
.print-sign-col { padding: 0 12px; }
.print-sign-col:first-child { padding-left: 0; border-right: 1px solid #ccd6e4; }
.print-sign-label { font-size: 10px; color: #5a7090; margin-bottom: 28px; }
.print-sign-line { border-top: 1.5px solid #0d2b52; padding-top: 6px; }
.print-sign-name { font-size: 12px; font-weight: 700; color: #0d2b52; }
.print-sign-dept { font-size: 10px; color: #5a7090; }
.print-footer { background: #0d2b52; padding: 8px 22px; display: flex; justify-content: space-between; align-items: center; }
.print-footer span { font-size: 9px; color: rgba(255,255,255,.45); font-family: var(--font-mono); }
.phyrje-col { padding: 0 14px; font-size: 11px; line-height: 1.85; }
.phyrje-col:first-child { padding-left: 0; padding-right: 14px; border-right: 1px solid #ccd6e4; }
.phyrje-heading { font-size: 12px; font-weight: 800; color: #0d2b52; letter-spacing: .3px; margin-bottom: 10px; }
.phyrje-field { margin-bottom: 7px; }
.phyrje-label { font-weight: 700; color: #5a7090; }
.phyrje-party-block { margin-bottom: 10px; padding-left: 8px; border-left: 2px solid #ccd6e4; }
.phyrje-party-name { font-weight: 700; color: #0d2b52; font-size: 11px; margin-bottom: 4px; }
.phyrje-notes-block { font-size: 10px; color: #444; line-height: 1.75; margin-top: 8px; }
.phyrje-notes-block ul { padding-left: 14px; margin: 0; }
.phyrje-sign-block { margin-top: 10px; font-size: 10.5px; }
.phyrje-sign-line { border-top: 1.5px solid #0d2b52; margin-top: 22px; padding-top: 4px; font-weight: 700; color: #0d2b52; }

/* ── MISC ── */
#add-user-btn { display: inline-flex !important; }
#form-hyrje { display: none; }
#form-general { display: block; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::selection { background: rgba(26,95,168,.15); color: var(--text); }
