/* =============================================
   APP.CSS — Home Office Base
   Dark red theme, Bootstrap 5 companion
   ============================================= */

:root {
  --red-900:  #4a0a0a;
  --red-800:  #6b1111;
  --red-700:  #8b1a1a;
  --red-600:  #a52424;
  --red-500:  #c0392b;
  --red-400:  #e05252;
  --red-100:  #fdecea;

  --sidebar-bg:    #1a0808;
  --sidebar-hover: #2e1010;
  --sidebar-active:#6b1111;
  --sidebar-border:#3d1515;
  --sidebar-text:  #e8d0d0;
  --sidebar-muted: #a07878;
  --sidebar-width: 230px;

  --topbar-bg:     #2a0e0e;
  --topbar-height: 56px;

  --body-bg:       #f5f5f5;
  --card-bg:       #ffffff;
  --border-color:  #e0e0e0;
  --text-main:     #212121;
  --text-muted:    #757575;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  background: var(--body-bg);
  color: var(--text-main);
}

/* ---- Wrapper ---- */
#app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: transform .25s ease;
}

#sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
  text-decoration: none;
  gap: 10px;
}
#sidebar-logo {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
}
#sidebar-logo .logo-city {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}
#sidebar-logo .logo-appname {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,.5);
  letter-spacing: .3px;
}
#sidebar-logo span.logo-dot {
  color: var(--red-400);
  font-weight: 700;
}

#sidebar nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

#sidebar .nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 14px 20px 4px;
}

#sidebar .nav-item a,
#sidebar .nav-item button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
#sidebar .nav-item a:hover,
#sidebar .nav-item button:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
#sidebar .nav-item a.active {
  background: var(--sidebar-active);
  border-left-color: var(--red-400);
  color: #fff;
  font-weight: 600;
}
#sidebar .nav-item a i,
#sidebar .nav-item button i {
  width: 16px;
  text-align: center;
  opacity: .8;
}

#sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 12px;
  color: var(--sidebar-muted);
}

/* =============================================
   MAIN AREA
   ============================================= */
#main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top bar ---- */
#topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--red-900);
}
#topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
#sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
#topbar-breadcrumb {
  font-size: 13px;
  color: #c0a0a0;
}
#topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #e8d0d0;
  font-size: 13px;
}
#topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
#topbar-user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ---- App tabs (topbar module switcher) ---- */
.app-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: var(--topbar-height);
  color: rgba(255,255,255,.5);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.app-tab:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.06);
  text-decoration: none;
}
.app-tab.active {
  color: #fff;
  border-bottom-color: var(--red-400);
  background: rgba(255,255,255,.08);
}
.app-tab i { font-size: 14px; }

/* ---- Subnav (tabs) ---- */
#subnav-bar {
  background: #fff;
  border-bottom: 2px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  gap: 0;
  min-height: 40px;
  align-items: flex-end;
}
#subnav-bar a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
#subnav-bar a:hover {
  color: var(--red-600);
}
#subnav-bar a.active {
  color: var(--red-700);
  border-bottom-color: var(--red-700);
  font-weight: 600;
}

/* ---- Page content ---- */
#page-content {
  padding: 24px;
  flex: 1;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

/* =============================================
   BUTTONS (legacy + new)
   ============================================= */
a.btn_edit, button.btn_edit,
a.btn_rm,   button.btn_rm,
a.btn_info, button.btn_info,
a.btn_y,    button.btn_y {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
  transition: background .15s, box-shadow .15s;
}
a.btn_edit, button.btn_edit {
  background: #e8f5e9; border-color: #66bb6a; color: #2e7d32;
}
a.btn_edit:hover, button.btn_edit:hover {
  background: #c8e6c9; color: #2e7d32; text-decoration: none;
}
a.btn_rm, button.btn_rm {
  background: #ffebee; border-color: #ef5350; color: #c62828;
}
a.btn_rm:hover, button.btn_rm:hover {
  background: #ffcdd2; color: #c62828; text-decoration: none;
}
a.btn_info, button.btn_info {
  background: var(--red-100); border-color: var(--red-400); color: var(--red-800);
}
a.btn_info:hover, button.btn_info:hover {
  background: #fbd8d5; color: var(--red-800); text-decoration: none;
}
a.btn_y, button.btn_y {
  background: #fffde7; border-color: #fdd835; color: #795548;
}
a.btn_y:hover, button.btn_y:hover {
  background: #fff9c4; color: #795548; text-decoration: none;
}

/* Primary action button */
.btn-primary-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--red-700);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary-app:hover { background: var(--red-800); color: #fff; text-decoration: none; }

/* =============================================
   TABLE
   ============================================= */
table.tabulka {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 20px;
}
table.tabulka thead th,
table.tabulka tr.names td {
  background: #f9f9f9;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border-color);
}
table.tabulka td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
table.tabulka tr.r:last-child td,
table.tabulka tbody tr:last-child td { border-bottom: none; }
table.tabulka tr.r:hover,
table.tabulka tbody tr:hover { background: #fff5f5; }

/* =============================================
   FORM
   ============================================= */
.form {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 28px 32px;
  max-width: 580px;
  margin-bottom: 20px;
}
.form h2 { display: none; }

.form_line {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  gap: 16px;
}
.form_line:last-of-type { border-bottom: none; }
.form_line:hover { background: #fff5f5; border-radius: 4px; }

.form_text {
  width: 180px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

.form_line input[type="text"],
.form_line input[type="email"],
.form_line input[type="password"],
.form_line input[type="number"],
.form_line select {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-main);
  background: #fafafa;
  transition: border-color .15s, box-shadow .15s;
  width: auto;
  min-width: 0;
}
.form_line input:focus,
.form_line select:focus {
  outline: none;
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(139,26,26,.12);
  background: #fff;
}
.form_line select { cursor: pointer; }

.form input[type="submit"],
.form button[type="submit"] {
  margin-top: 16px;
  padding: 9px 22px;
  background: var(--red-700);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.form input[type="submit"]:hover,
.form button[type="submit"]:hover { background: var(--red-800); }

/* =============================================
   ALERTS
   ============================================= */
.fail {
  padding: 10px 14px;
  background: #ffebee;
  border-left: 4px solid var(--red-500);
  border-radius: 4px;
  color: #b71c1c;
  font-size: 13px;
  margin-bottom: 14px;
}
.succes {
  padding: 10px 14px;
  background: #e8f5e9;
  border-left: 4px solid #43a047;
  border-radius: 4px;
  color: #2e7d32;
  font-size: 13px;
  margin-bottom: 14px;
}

/* =============================================
   CARDS (dashboard)
   ============================================= */
.stat-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border-left: 4px solid var(--red-600);
}
.stat-card .num { font-size: 32px; font-weight: 700; color: var(--red-700); }
.stat-card .info { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* =============================================
   MISC
   ============================================= */
.clear { clear: both; }
.page-actions { margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--red-100);
  color: var(--red-800);
}

/* =============================================
   RESPONSIVE
   ============================================= */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 999;
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.4);
  }
  #main-area { margin-left: 0; }
  #sidebar-toggle { display: block; }
  #page-content { padding: 16px; }
  .form { padding: 20px 16px; }
  .form_text { width: 130px; }
  table.tabulka { font-size: 12px; }
  table.tabulka td, table.tabulka tr.names td { padding: 8px 8px; }
}

/* =============================================
   LOGIN PAGE
   ============================================= */
body.login-page {
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 44px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.login-card .login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-card .login-logo .logo-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--red-800);
  letter-spacing: .5px;
}
.login-card .login-logo .logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(139,26,26,.12);
}
.login-card .btn-login {
  width: 100%;
  height: 42px;
  background: var(--red-700);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background .15s;
}
.login-card .btn-login:hover { background: var(--red-800); }
.login-error {
  margin-top: 12px;
  padding: 8px 12px;
  background: #ffebee;
  border-left: 3px solid var(--red-500);
  border-radius: 4px;
  color: #b71c1c;
  font-size: 13px;
}

/* =============================================
   HOME OFFICE MODULE
   ============================================= */

/* Status bar */
.ho-status-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  padding: 16px 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ho-status-prace { border-left: 4px solid #2e7d32; }
.ho-status-pauza { border-left: 4px solid #f57f17; }

.ho-timer {
  font-size: 26px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #222;
  letter-spacing: 1px;
}

/* Pulse dot for "working" state */
.ho-pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #2e7d32;
  border-radius: 50%;
  margin-right: 4px;
  animation: ho-pulse 2s ease-in-out infinite;
}
@keyframes ho-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.8); }
}

/* Notes / chat */
.ho-notes-wrap {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
  margin-bottom: 20px;
}
.ho-notes-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  background: #f7f7f7;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ho-live-badge {
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
}
.ho-notes-feed {
  min-height: 80px;
  max-height: 380px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.ho-note {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.ho-note.mine {
  align-self: flex-end;
  background: var(--red-100);
  border-bottom-right-radius: 3px;
}
.ho-note.other {
  align-self: flex-start;
  background: #f0f4f8;
  border-bottom-left-radius: 3px;
}
.ho-note-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 3px;
}
.ho-note-author {
  font-size: 11px;
  font-weight: 700;
  color: #888;
}
.ho-note-time {
  font-size: 11px;
  color: #bbb;
}
.ho-note-text { color: #333; }

/* Note input row */
.ho-note-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  background: #fafafa;
  align-items: flex-end;
}
.ho-note-input-row textarea {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: #fff;
  transition: border-color .15s;
  max-height: 100px;
  overflow-y: auto;
}
.ho-note-input-row textarea:focus { border-color: var(--red-500); }
.ho-note-input-row button {
  background: var(--red-700);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.ho-note-input-row button:hover { background: var(--red-900); }
.ho-note-input-row button:disabled { background: #ccc; cursor: default; }
