/* Minimal modern stylesheet for HRM app
   - Clean reset
   - Theme variables
   - Header (top bar)
   - Main content container
   - Cards and tables
   - Footer
*/

@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --muted: #6b7280;
  --text: #0f172a;
  --accent: #0b6d75;
  --accent-2: #0ea5a3;
  --border: #e6e9ef;
  --shadow: 0 8px 24px rgba(15,23,42,0.06);
  --container: 1200px;
  --sidebar-w: 96px;
  --header-h: 64px;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* Reset basics */
* { box-sizing: border-box; }
html, body, #app { height:100%; margin:0; padding:0; background:var(--bg); color:var(--text); overflow-x: hidden !important; }
img { max-width:100%; display:block; }
a { color:inherit; text-decoration:none; }

/* App shell */
.hrm-shell { min-height:100vh; display:flex; flex-direction:column; }
.app-header {
  height:var(--header-h);
  background:var(--panel);
  display:flex;
  align-items:center;
  border-bottom:1px solid var(--border);
  position:fixed;
  top:0; left:0; right:0;
  z-index:1000;
  box-shadow: 0 2px 6px rgba(2,6,23,0.04);
  padding: 0;
}

/* Header layout */
.hrm-header-inner {
  width:100%;
  max-width:var(--container);
  margin:0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}
.hrm-left { display:flex; align-items:center; gap:8px; padding-left:6px; justify-self:start; max-width:300px; }
.hrm-brand { display:inline-flex; align-items:center; gap:8px; padding:4px 6px; border-radius:12px; background: rgba(255,255,255,0.95); border: 1px solid rgba(15,23,42,0.04); text-decoration:none; }
.hrm-brand img { height:40px; width:auto; object-fit:contain; border-radius:6px; box-shadow: 0 6px 16px rgba(2,6,23,0.06); }
.brand-full {
    font-weight: 750;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #0b6d75;
    margin: 0;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.brand-short {
    display: none;
}

/* Center nav */
.simple-nav { background: transparent; position: static; box-shadow: none; padding: 0; margin: 0; }
.header-search { grid-column: 2; justify-self: center; width: 100%; display:flex; justify-content:center; padding:0 6px; }
.header-nav-list { display:flex; gap:18px; justify-content:center; align-items:center; margin:0; padding:0; list-style:none; white-space:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.header-nav-list::-webkit-scrollbar { height:6px; }
.header-nav-list li { flex: 0 0 auto; display:inline-flex; }
.simple-nav-link { color: var(--accent); padding: 6px 12px; border-radius:8px; background:transparent; font-weight:600; text-decoration:none !important; display:inline-flex; align-items:center; gap:8px; height:36px; }
.simple-nav-link:hover { background: rgba(11,109,117,0.06); }
.simple-nav-link.active { color: var(--accent-2); font-weight:700; border-bottom:3px solid var(--accent-2); padding-bottom:4px; }

/* Right workspace */
.header-workspace { justify-self: end; display:flex; align-items:center; gap:8px; max-width:280px; }
.header-action-btn, .hrm-profile-btn { background: transparent; border: none; padding: 6px; border-radius:8px; box-shadow:none; }
.header-action-btn:hover, .hrm-profile-btn:hover { background: rgba(2,6,23,0.04); }

/* Profile */
.hrm-profile { position: relative; display:inline-flex; align-items:center; gap:8px; }
.hrm-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(2,6,23,0.12);
  background: var(--panel) !important;
  border: 1px solid var(--border);
  transform-origin: top right;
  transition: transform 160ms cubic-bezier(.2,.9,.3,1), opacity 160ms ease;
  opacity: 1;
  z-index: 1200;
}
.hrm-profile-menu.hidden { transform: scale(0.98); opacity: 0; pointer-events: none; }
.hrm-profile-menu::before { content: ""; position: absolute; top: -6px; right: 12px; width:12px; height:12px; background:var(--panel); transform: rotate(45deg); border-left:1px solid var(--border); border-top:1px solid var(--border); z-index:-1; }
.hrm-profile-menu ul { list-style:none !important; margin:0; padding:6px 0; }
.profile-menu-item { display:block; width:100%; padding:10px 14px; margin:4px 0; background:transparent !important; border:none !important; color:var(--text) !important; text-align:left; font-weight:700; border-radius:8px; cursor:pointer; }
.profile-menu-item:hover { background: rgba(15,23,42,0.04) !important; }
.profile-menu-item:focus-visible { outline: 2px solid var(--accent) !important; }
.hrm-profile-btn { display:inline-flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px; cursor:pointer; }
.profile-avatar { width:36px; height:36px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background: linear-gradient(180deg,var(--accent),var(--accent-2)); color:#fff; font-weight:800; font-size:13px; }
.profile-name { max-width:140px; font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.caret { font-size:12px; transition: transform 180ms ease; }
.caret.open { transform: rotate(180deg); }

/* Main content container */
.hrm-body { display:flex; margin-top: calc(var(--header-h) + 10px); }
.hrm-main { flex: 1 1 auto; padding: 0; }
.hrm-main-inner { width:100%; max-width:var(--container); margin:0 auto; padding: 0 16px; box-sizing:border-box; }
.hrm-main-inner .hrm-content { background:#ffffff; border-radius:12px; padding:24px; margin-top:12px; max-width:100%; }
.hrm-main-inner .hrm-content > .card { margin:0; box-shadow:none; border:none; }

/* Footer — modern centered design */
.hrm-footer {
  background: transparent; /* keep page background visible */
  border-top: 1px solid var(--border);
  padding: 14px 0;
  margin-top: auto; /* push to bottom of app shell */
}
.hrm-footer .hrm-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: center; /* center the content */
  align-items: center;
  gap: 0;
}
.hrm-footer small {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  display: block;
  line-height: 1.2;
}

/* Make footer more compact on very small screens */
@media (max-width: 480px) {
  .hrm-footer { padding: 10px 0; }
  .hrm-footer small { font-size: 12px; }
}

/* Cards */
.card { background:var(--panel); border-radius:12px; padding:0; box-shadow: 0 8px 24px rgba(2,6,23,0.06); overflow:hidden; }
.card-header { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border); }
.card-body { padding: 12px 18px; }

/* Recent list */
.recent-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.recent-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px dashed rgba(0,0,0,0.04); }
.recent-left { display:flex; align-items:center; gap:12px; min-width:0; }
.recent-avatar { width:44px; height:44px; border-radius:8px; display:flex; align-items:center; justify-content:center; background:linear-gradient(180deg,var(--accent),var(--accent-2)); color:#fff; font-weight:700; flex:0 0 44px; }
.recent-info { display:flex; flex-direction:column; gap:4px; min-width:0; overflow:hidden; }
.recent-name { font-weight:700; margin:0; line-height:1.1; }
.recent-meta { color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-actions { flex:0 0 auto; margin-left:12px; }
.recent-actions .btn { white-space:nowrap; }

/* Employee table */
.table-modern { width:100%; border-collapse: separate; border-spacing: 0 8px; font-size:0.95rem; }
.table-modern thead th { text-align:left; font-size:0.85rem; font-weight:700; color:var(--muted); padding:10px 14px; vertical-align:middle; }
.table-modern tbody tr { background:#fff; border:1px solid var(--border); border-radius:10px; box-shadow:0 6px 18px rgba(2,6,23,0.04); }
.table-modern tbody tr td { padding:12px 14px; vertical-align:middle; border:none; }
.table-modern tbody tr:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(2,6,23,0.06); }
.table-modern td[data-label="#"], .table-modern td[data-label="Profile"] { width:72px; }

.employee-photo { height:48px; width:48px; border-radius:8px; object-fit:cover; display:block; }
.employee-avatar { height:48px; width:48px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; background: linear-gradient(180deg,var(--accent),var(--accent-2)); color:#fff; font-weight:700; }

.header-icon { margin-right:6px; color:var(--muted); }
.header-text { font-weight:700; color:var(--muted); }

.btn-view, .btn-doc, .btn-job, .btn-danger { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:8px; font-weight:600; font-size:0.85rem; border:1px solid transparent; cursor:pointer; text-decoration:none; color:var(--text); }
.btn-view { background: rgba(11,109,117,0.06); color:var(--accent); }
.btn-doc { background: rgba(37,99,235,0.06); color:#2563eb; }
.btn-job { background: rgba(14,165,163,0.06); color:var(--accent-2); }
.btn-danger { background: rgba(220,38,38,0.06); color:#dc2626; border:1px solid rgba(220,38,38,0.12); }
.btn-view:hover, .btn-doc:hover, .btn-job:hover, .btn-danger:hover { transform: translateY(-1px); }

.table-wrapper .table-responsive { overflow:auto; padding:6px; }
.table-modern tbody tr td .p-3 { padding:18px 12px; text-align:center; }

/* Loading overlay */
.loading-overlay { background: rgba(255,255,255,0.75); }
.loading-overlay .spinner { color: var(--accent); }

/* Page header styles removed (moved or intentionally omitted). If you need scoped header styles, add them to individual page .razor.css files. */

/* Mobile hamburger button (hidden on larger screens) */
.nav-toggle-mobile { display:none; background:transparent; border:none; padding:8px; border-radius:8px; font-size:18px; color:var(--muted); align-items:center; justify-content:right; }
.nav-toggle-icon { transition: transform 200ms cubic-bezier(.2,.9,.3,1), opacity 200ms ease; }
.nav-toggle-icon.open { transform: rotate(90deg); }

/* Mobile nav panel */
.mobile-nav { display:none; position:fixed; top:var(--header-h); left:0; right:0; background:var(--panel); border-bottom:1px solid var(--border); box-shadow:0 8px 24px rgba(2,6,23,0.06); z-index:1100; transform:translateY(-10px); opacity:0; transition:transform 160ms ease, opacity 160ms ease; }
.mobile-nav.open { display:block; transform:translateY(0); opacity:1; }
.mobile-nav-list { list-style:none; margin:0; padding:8px 12px; display:flex; flex-direction:column; gap:6px; }
.mobile-nav-link { display:flex; gap:10px; align-items:center; padding:10px 12px; border-radius:8px; color:var(--text); text-decoration:none; font-weight:700; }
.mobile-nav-link:hover { background: rgba(2,6,23,0.03); }

/* Responsive enhancements: header + main content for tablet and mobile */

/* Base header adjustments for medium screens */
@media (max-width: 900px) {
  :root { --container: 720px; }

  /* Compact header layout */
  .hrm-header-inner { grid-template-columns: min-content 1fr min-content; padding: 0 12px; }
  .header-nav-list { display: none !important; }
  .nav-toggle-mobile { display: inline-flex !important; }

  /* Reduce left brand footprint */
  .hrm-left { max-width: 160px; padding-left: 4px; }
  .hrm-brand img { height: 34px; }

  /* Right workspace shrink */
  .header-workspace { max-width: 160px; gap: 6px; }
  .profile-name { display: none; }

  /* Main content spacing */
  .hrm-body { margin-top: calc(var(--header-h) + 8px); }
  .hrm-main-inner { padding: 0 12px; }
  .hrm-main-inner .hrm-content { padding: 16px; border-radius: 10px; }

  /* Page header: allow wrapping and actions to move below title */
  .page-header { flex-wrap: wrap; gap: 8px; }
  .page-header .title { min-width: 0; flex: 1 1 auto; }
  .page-header .page-actions { flex: 0 0 auto; }
}

/* Narrow/mobile phones */
@media (max-width: 700px) {
  :root { --container: 100%; }

  /* Smaller header height and layout */
  :root { --header-h: 56px; }
  .app-header { height: var(--header-h); }
  .hrm-header-inner { grid-template-columns: auto 1fr min-content; padding: 0 10px; }

  /* Brand compact */
  .hrm-left { max-width: 120px; }
  .hrm-brand img { height: 30px; }
    .brand-full {
        display: none;
    }

    .brand-short {
        display: inline;
        font-weight: 750;
        color: #0b6d75;
    }

  /* Show mobile toggle centrally */
  .nav-toggle-mobile { display: inline-flex !important; justify-self: right; }

  /* Main content adjustments for small screens */
  .hrm-main-inner { padding: 0 10px; }
  .hrm-main-inner .hrm-content { padding: 12px; }

  /* Cards and widgets full width */
  .widgets-grid, .container-grid, .content-grid { display: block; }
  .widget, .card, .kpi-card { width: 100% !important; box-sizing: border-box; }

  /* Page header stacks vertically */
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 0; }
  .page-header .title h1 { font-size: clamp(1rem, 4vw, 1.25rem); white-space: normal; }
  .page-header .page-actions, .page-header .actions-group { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
  .page-header .actions-group > * { flex: 1 1 calc(50% - 6px); min-width: 0; }

  /* Ensure card header actions wrap and don't overflow */
  .card-header { gap: 8px; }
  .card-header .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .card-header .page-actions .actions-group > * { flex: 1 1 auto; min-width: 0; }

  /* Reserve scrollbar space and padding to avoid controls being hidden */
  .hrm-main-inner .hrm-content, .card { scrollbar-gutter: stable both-edges; padding-right: 8px; }
}

/* Very small screens / narrow devices */
@media (max-width: 480px) {
  :root { --header-h: 52px; }
  .hrm-header-inner { padding: 0 8px; grid-template-columns: auto 1fr min-content; }

  /* Further reduce paddings and font sizes for tiny screens */
  .hrm-main-inner { padding: 0 8px; }
  .hrm-main-inner .hrm-content { padding: 10px; }
  .card-header { padding: 10px 12px; }
  .card-body { padding: 10px 12px; }

  .page-header .title h1 { font-size: 1rem; }
  .page-header .subtitle { font-size: 0.85rem; }

  /* Make action buttons full width in super small viewports */
  .page-header .actions-group > * { flex: 1 1 100% !important; max-width: 100% !important; }
  .card-header .page-actions .actions-group > * { flex: 1 1 100% !important; }

  /* Hide non-essential UI */
  .header-search { display: none !important; }
  .header-nav-list { display: none !important; }
  .header-workspace .header-action-btn { display: none !important; }
}

/* Ensure header and card buttons become full width and use consistent padding on small screens */
@media (max-width: 700px) {
  .page-header .actions-group > *,
  .page-header .page-actions .btn,
  .card .page-actions .btn,
  .page-header.modern-header .actions-group > * {
    /* allow two buttons per row without forcing full width; prevent overflow */
    flex: 1 1 calc(50% - 6px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Reduce extra margins that may cause overflow */
  .page-header { padding-right: 6px; padding-left: 6px; }
  .hrm-main-inner { padding-right: 10px; }
}

/* Force single column for very small screens */
@media (max-width: 480px) {
  .page-header .actions-group > *,
  .page-header .page-actions .btn,
  .card .page-actions .btn,
  .page-header.modern-header .actions-group > * {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Accessibility: ensure focusable header controls remain visible */
.app-header :focus { outline: 3px solid rgba(14,165,163,0.12); outline-offset: 2px; }

/* End of responsive header / main content rules */

/* Small-screen alignment fixes for user lists, headers and buttons */
@media (max-width: 700px) {
  /* Allow list rows to wrap and their children to shrink */
  .recent-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .recent-left, .recent-info, .recent-actions {
    min-width: 0;
  }

  .recent-left { flex: 0 0 auto; }
  .recent-info { flex: 1 1 auto; overflow: hidden; }
  .recent-actions { flex: 0 0 auto; margin-left: 0; }

  .recent-meta { white-space: normal; overflow: hidden; text-overflow: ellipsis; }

  /* Ensure header actions behave and don't force overflow */
  .page-header .actions-group,
  .page-header .page-actions,
  .card-header .page-actions {
    display: flex !important;
    gap: 8px;
    flex-wrap: wrap !important;
    align-items: center;
    justify-content: flex-start;
  }

  /* Two-per-row buttons on small screens, full-width on very small */
  .page-header .actions-group > *,
  .page-header .page-actions .btn,
  .card-header .page-actions .btn {
    flex: 1 1 calc(50% - 6px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .page-header .actions-group:only-child > *,
  .card-header .page-actions:only-child > * {
    flex: 1 1 100% !important;
  }

  /* Prevent buttons from stretching beyond container */
  .btn, .header-action-btn, .hrm-profile-btn {
    max-width: 100%;
  }

  /* Small padding so scrollbar doesn't cover content */
  .hrm-main-inner .hrm-content { padding-right: 12px !important; }
}

/* Force single-column actions on very small screens */
@media (max-width: 480px) {
  .page-header .actions-group > *,
  .page-header .page-actions .btn,
  .card-header .page-actions .btn {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }
}

/* Alignment fixes for page headers and tables on small screens */
@media (max-width: 700px) {
  /* Make page header flush with content */
  .hrm-main-inner .page-header {
    width: 100%;
    box-sizing: border-box !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    margin: 0 0 12px 0 !important;
  }

  /* Stabilize gutter so scrollbar appearance doesn't shift layout */
  .hrm-main-inner, .hrm-main-inner .hrm-content {
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent horizontal overflow from appearing inside content */
  .hrm-main-inner .hrm-content {
    overflow-x: hidden !important;
  }

  /* Action group: consistent two-per-row sizing and fixed height for visual stability */
  .page-header .actions-group,
  .card-header .page-actions .actions-group {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }

  .page-header .actions-group > *,
  .card-header .page-actions .actions-group > * {
    flex: 1 1 calc(50% - 6px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    height: 44px !important; /* fixed height keeps layout stable */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* If only one action, make it full width but keep fixed height */
  .page-header .actions-group:only-child > *,
  .card-header .page-actions .actions-group:only-child > * {
    flex: 1 1 100% !important;
  }

  /* Avoid buttons with huge line-height/sizing from expanding container */
  .page-header .actions-group button, .page-header .actions-group .btn,
  .card-header .page-actions button, .card-header .page-actions .btn {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Reduce side paddings that cause overflow */
  .page-header { padding-left: 6px !important; padding-right: 6px !important; }
}

/* Very small screens: single-column actions, same fixed height */
@media (max-width: 480px) {
  .page-header .actions-group > *,
  .card-header .page-actions .actions-group > * {
    flex: 1 1 100% !important;
    height: 44px !important;
  }
}

/* Prevent underlines on header/brand links when hovering */
.hrm-brand, .hrm-brand a, .brand-full, .brand-short, .simple-nav-link {
  text-decoration: none !important;
}

/* Ensure hover styles don't reintroduce underline */
.hrm-brand:hover, .hrm-brand a:hover, .brand-full:hover, .brand-short:hover, .simple-nav-link:hover {
  text-decoration: none !important;
}

/* Keep focus visible for keyboard users (do not remove focus outline) */
.hrm-brand:focus, .simple-nav-link:focus {
  outline: 3px solid rgba(14,165,163,0.12);
  outline-offset: 2px;
}




