/* ============================================================
   MARY'S PIZZA SCHEDULER — MOBILE-FIRST STYLESHEET
   ============================================================ */

:root {
  --navbar-bg:      #1c1c1e;
  --navbar-height:  56px;
  --bottom-nav-h:   64px;
  --sidebar-w:      220px;
  --accent:         #c0392b;
  --accent-dark:    #a93226;
  --accent-light:   #fdf2f2;
  --bg:             #f4f5f7;
  --surface:        #ffffff;
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;
  --text:           #111827;
  --text-muted:     #6b7280;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

/* ---- Top Navbar ---- */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--navbar-bg);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.nav-logo {
  height: 38px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-page-title {
  color: rgba(255,255,255,0.80);
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: rgba(255,255,255,0.80);
  text-decoration: none;
  font-size: 19px;
  transition: background .15s;
  flex-shrink: 0;
  position: relative;
}

.nav-icon-btn:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.nav-user {
  color: rgba(255,255,255,0.80);
  font-size: 13px;
  white-space: nowrap;
}

/* ---- App Layout ---- */
.app-body {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

/* ---- Sidebar (desktop only) ---- */
.app-sidebar {
  width: var(--sidebar-w);
  background: #1a1a1a;
  flex-shrink: 0;
  padding: 16px 12px;
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
}

.app-sidebar .nav-link {
  color: rgba(255,255,255,0.60);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 2px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.app-sidebar .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.app-sidebar .nav-link.active {
  background: var(--accent);
  color: #fff;
}

.app-sidebar .nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 10px 0;
}

/* ---- Main Content ---- */
.app-main {
  flex: 1;
  padding: 16px;
  min-width: 0;
}

/* ---- Bottom Nav (mobile only) ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--navbar-bg);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: stretch;
  z-index: 1020;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  gap: 3px;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  letter-spacing: .01em;
}

.bottom-nav-item i {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav-item.active  { color: var(--accent); }
.bottom-nav-item:hover   { color: rgba(255,255,255,0.80); }

/* ---- More Sheet (admin mobile) ---- */
.more-sheet {
  border-radius: 16px 16px 0 0;
  height: auto !important;
}

.more-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}

.more-sheet-item:last-child { border-bottom: none; }
.more-sheet-item:hover      { background: var(--bg); color: var(--text); }

.more-sheet-item i {
  font-size: 20px;
  color: var(--accent);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.more-sheet-item .item-label { font-weight: 600; }
.more-sheet-item .item-sub   { font-size: 12px; color: var(--text-muted); }

/* ---- Cards ---- */
.stat-card, .app-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

/* ---- Buttons ---- */
.btn,
a.btn,
button.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  line-height: 1;
  min-height: 42px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  vertical-align: middle;
}

.btn-sm {
  min-height: 34px;
  font-size: 13px;
}

.btn i,
.btn svg {
  line-height: 1;
  flex-shrink: 0;
  display: block;
}

.btn-danger {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-danger:hover,
.btn-danger:active,
.btn-danger:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* ---- Button Groups ---- */
.btn-group .btn,
.btn-group a.btn,
.btn-group button.btn {
  border-radius: 0 !important;
}

.btn-group .btn:first-child,
.btn-group a.btn:first-child,
.btn-group button.btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}

.btn-group .btn:last-child,
.btn-group a.btn:last-child,
.btn-group button.btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

/* ---- Shift action buttons (inside shift cards — no min-height) ---- */
.shift-actions button {
  min-height: unset !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,0.3);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  cursor: pointer;
  line-height: 1;
}

.shift-actions button:hover { background: rgba(0,0,0,0.6); }

/* ---- Forms — 16px prevents iOS zoom ---- */
.form-control, .form-select {
  min-height: 46px;
  border-radius: var(--radius-sm);
  border-color: var(--border);
  font-size: 16px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-text { font-size: 12px; }

/* ---- Tables ---- */
.table-responsive { -webkit-overflow-scrolling: touch; }

/* ---- Schedule Grid ---- */
.schedule-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.schedule-table {
  min-width: 700px;
  font-size: 13px;
}

.schedule-table th {
  white-space: nowrap;
  background: #f8f9fa;
  font-size: 12px;
}

.schedule-table td {
  vertical-align: top;
  min-width: 110px;
}

.shift-card {
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  position: relative;
}

.shift-card:hover .shift-actions { display: flex; }

.shift-actions {
  display: none;
  position: absolute;
  top: 2px;
  right: 4px;
  gap: 4px;
}

.add-shift-btn {
  width: 100%;
  border: 2px dashed var(--border-strong);
  background: none;
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  min-height: unset !important;
  display: block !important;
  text-align: center;
}

.add-shift-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ---- Login Page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--navbar-bg);
}

.login-logo {
  height: 80px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  margin-bottom: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-header {
  background: #111111;
  padding: 22px 24px;
  text-align: center;
  color: rgba(255,255,255,0.90);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.login-header h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 3px;
  letter-spacing: -.01em;
}

.login-header p {
  font-size: 13px;
  opacity: .60;
  margin: 0;
}

.login-body    { padding: 24px; }
.login-footer  {
  text-align: center;
  padding-bottom: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.30);
}

/* ---- Modals — bottom sheet on mobile ---- */
@media (max-width: 575px) {
  .modal-dialog {
    margin: 0;
    max-width: 100%;
    display: flex;
    align-items: flex-end;
    min-height: 100%;
  }

  .modal-content {
    border-radius: var(--radius) var(--radius) 0 0;
    border: none;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-dialog.modal-lg { align-items: flex-end; }
}

/* ---- Alerts ---- */
.alert {
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* ---- Desktop overrides ---- */
@media (min-width: 768px) {
  body { padding-bottom: 0; }

  .bottom-nav { display: none !important; }

  .app-main { padding: 24px 28px; }

  .page-title { font-size: 22px; }

  .modal-dialog  { margin: 40px auto; }
  .modal-content { border-radius: var(--radius); }
}

@media (min-width: 992px) {
  .app-main { padding: 28px 32px; }
}

/* ---- Utility ---- */
.today-col      { background: #fffbf0; }
.cursor-pointer { cursor: pointer; }

/* ---- Employee shift list cards ---- */
.shift-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.shift-list-item:last-child { border-bottom: none; }

.shift-color-bar {
  width: 4px;
  height: 44px;
  border-radius: 2px;
  flex-shrink: 0;
}

.shift-list-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.shift-list-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}