/* =============================================
   Absence - Aplikacija za odsustva
   Dizajn sistema
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --primary:       #0099cc;
  --primary-dark:  #007aa3;
  --primary-light: #e0f4fb;
  --sidebar-bg:    #1a2e40;
  --sidebar-width: 60px;
  --white:         #ffffff;
  --bg:            #f4f7fa;
  --card-bg:       #ffffff;
  --text:          #2c3e50;
  --text-muted:    #7f8c9a;
  --border:        #e8ecf0;
  --success:       #28a745;
  --danger:        #e74c3c;
  --warning:       #fd7e14;
  --info:          #17a2b8;
  --shadow:        0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:     0 8px 30px rgba(0,0,0,0.12);
  --radius:        10px;
  --radius-lg:     16px;
  --transition:    0.2s ease;
  --font-main:     'Nunito', sans-serif;
  --font-body:     'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 15px rgba(0,0,0,0.15);
}

.sidebar-logo {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-main);
  font-weight: 800;
  color: white;
  font-size: 14px;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  text-decoration: none;
}

.sidebar-nav {
  display: flex; flex-direction: column;
  gap: 2px; width: 100%;
  flex: 1;
  padding: 0 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}
.sidebar-nav::-webkit-scrollbar { display: none; } /* Chrome */

.sidebar-link {
  width: 44px; height: 38px;
  min-height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  /* Tooltip */
  --tip-text: '';
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(0,153,204,0.2);
  color: var(--primary);
}

/* Tooltip via pseudo-element - ne blokira klikove */
.sidebar-link::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,30,45,0.95);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-main);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 200;
}
.sidebar-link:hover::after { opacity: 1; }

.sidebar-link i { font-size: 16px; pointer-events: none; }

/* Separator između sekcija */
.sidebar-sep {
  width: 28px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px auto;
  flex-shrink: 0;
}

/* ---- MAIN LAYOUT ---- */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.topbar-title {
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.topbar-actions {
  display: flex; align-items: center; gap: 12px;
}

.btn-kreiranje {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.btn-kreiranje:hover { background: var(--primary-dark); }

.notif-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  background: var(--white);
  transition: var(--transition);
}
.notif-btn:hover { border-color: var(--primary); color: var(--primary); }

.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-main);
  cursor: pointer;
}

/* ---- CONTENT ---- */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ---- CARDS ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-body { padding: 22px; }

/* ---- BUTTONS ---- */
.btn {
  border: none; cursor: pointer;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #218838; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover  { background: #c0392b; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-main);
}
.badge-odobreno  { background: #d4edda; color: var(--success); }
.badge-odbijeno  { background: #fde8e8; color: var(--danger); }
.badge-cekanje   { background: #333; color: white; }
.badge-otkazano  { background: #f0f0f0; color: var(--text-muted); }

/* ---- TABLE ---- */
.table-Absence {
  width: 100%;
  border-collapse: collapse;
}
.table-Absence th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.table-Absence td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-Absence tr:last-child td { border-bottom: none; }
.table-Absence tr:hover td { background: #fafcfe; }

/* ---- FORM ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,153,204,0.1);
}

/* ---- FILTER SIDEBAR ---- */
.filter-sidebar {
  width: 280px;
  flex-shrink: 0;
}
.filter-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.filter-reset {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 16px;
  display: block;
}

/* Status filter buttons */
.status-filter-btn {
  border: 1.5px solid var(--border);
  background: var(--white);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
  color: var(--text);
}
.status-filter-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Checkbox custom */
.check-item {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
}
.check-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---- DASHBOARD CALENDAR ---- */
.mini-calendar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 16px;
}
.cal-nav-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
}
.cal-nav-btn:hover { border-color: var(--primary); color: var(--primary); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}
.cal-day {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  margin: auto;
}
.cal-day:hover { background: var(--primary-light); }
.cal-day.today {
  background: var(--primary);
  color: white;
  font-weight: 700;
}
.cal-day.has-event { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.cal-day.other-month { color: var(--border); }

/* ---- ODMOR WIDGET ---- */
.odmor-widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.odmor-circle {
  position: relative;
  width: 140px; height: 140px;
}
.odmor-circle svg {
  transform: rotate(-90deg);
  width: 100%; height: 100%;
}
.odmor-circle-text {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.odmor-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.odmor-broj  { font-size: 36px; font-weight: 800; color: var(--text); font-family: var(--font-main); line-height: 1; }
.odmor-sublabel { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.odmor-stats { display: flex; gap: 20px; font-size: 12px; color: var(--text-muted); }

/* ---- ZAHTJEVI TABLE RED ---- */
.request-type-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.red-border-left {
  border-left: 3px solid var(--danger);
  padding-left: 8px;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-main); font-weight: 700; font-size: 16px; }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--bg);
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
}
.modal-close:hover { background: #fee; color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Profil banner u modalu */
.profil-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  color: white;
  margin-bottom: 20px;
}
.profil-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  font-family: var(--font-main);
}
.profil-info small { display: block; font-size: 11px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }
.profil-info strong { font-size: 15px; font-weight: 700; }
.profil-info .dana-badge {
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block; margin-top: 4px;
}

/* Inline kalendar u modalu */
.modal-calendar {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ---- KALENDAR STRANICA ---- */
.full-calendar .cal-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.full-calendar .cal-day-name {
  background: var(--bg);
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: none;
}
.full-calendar .cal-cell {
  background: var(--white);
  min-height: 100px;
  padding: 8px;
  vertical-align: top;
}
.full-calendar .cal-cell-date {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.full-calendar .cal-cell.today .cal-cell-date {
  background: var(--primary);
  color: white;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.full-calendar .cal-cell.other-month .cal-cell-date { color: var(--border); }

.event-pill {
  display: block;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- TOAST ---- */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  min-width: 250px;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---- NOTIFIKACIJE DROPDOWN ---- */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown.show { display: block; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-item:last-child { border-bottom: none; }
.notif-item-title { font-weight: 600; font-size: 13px; }
.notif-item-body  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- LOGIN ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2e40 0%, #0099cc 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: white;
  border-radius: 20px;
  padding: 44px 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}
.login-logo-icon {
  width: 46px; height: 46px;
  background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 17px;
  font-family: var(--font-main);
}
.login-logo-text {
  font-family: var(--font-main);
  font-size: 22px; font-weight: 800;
  color: var(--text);
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin-bottom: 28px;
}
.login-error {
  background: #fde8e8;
  border: 1px solid #f5c6cb;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .filter-sidebar { display: none; }
  .page-content { padding: 16px; }
}

/* ---- LINK SEE ALL ---- */
.link-all {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.link-all:hover { text-decoration: underline; }

/* ---- TABS ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-link {
  padding: 10px 18px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-link:hover { color: var(--text); }

/* ---- PREUZMI DUGME ---- */
.btn-preuzmi {
  background: var(--white);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 8px;
  padding: 7px 16px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.btn-preuzmi:hover { background: var(--primary); color: white; }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 12px;
}
.empty-state i { font-size: 48px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ---- COLLISION WARNING ---- */
.collision-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #856404;
  display: none;
  margin-top: 8px;
}
.collision-ok {
  background: #d4edda;
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--success);
  display: none;
  margin-top: 8px;
}
