/* CCForce dark theme (WorkLog) */
:root {
  --cc-navy: #1E467D;
  --cc-orange: #EF8D22;
  --cc-red: #C30000;
  --cc-yellow: #FFC300;
  --bg-main: #0b1120;
  --bg-section-alt: #0f172a;
  --bg-card: #1e293b;
  --border-card: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --nav-bg: rgba(11, 17, 32, 0.95);
  --accent: #3b82f6;
  --hours-low: #fef9c3;
  --hours-ok: #dcfce7;
  --hours-high: #fee2e2;
  --hours-zero-bg: #64748b;
  --hours-zero-text: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

h1, h2, h3, .brand-font, .logo-text {
  font-family: 'Days One', sans-serif;
}

.hidden {
  display: none !important;
}

.site-header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-card);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 42px;
  height: 42px;
}

.logo-text {
  line-height: 1;
  letter-spacing: 0.02em;
}

.logo-cc { font-size: 36px; color: #1E467D; }
.logo-f { font-size: 24px; color: #C30000; }
.logo-o { font-size: 18px; color: #EF8D22; }
.logo-r { font-size: 18px; color: #FFC300; }
.logo-c2 { font-size: 18px; color: #EF8D22; }
.logo-e { font-size: 18px; color: #C30000; }
.logo-llc { font-size: 12px; color: #1E467D; }

nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 0.85rem;
  font-size: 0.95rem;
}

nav a.active, nav a:hover {
  color: var(--text-main);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.auth-shell {
  min-height: 80vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(420px, 100%);
}

label {
  display: block;
  margin: 0.65rem 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: var(--bg-section-alt);
  color: var(--text-main);
}

textarea {
  resize: vertical;
  min-height: 3.2rem;
  line-height: 1.35;
}

button, .btn {
  cursor: pointer;
  border: 1px solid var(--border-card);
  background: var(--cc-navy);
  color: #fff;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
}

button.secondary {
  background: transparent;
  color: var(--text-main);
}

button.danger {
  background: #7f1d1d;
  border-color: #991b1b;
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}

.toolbar-label {
  display: inline;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.toolbar-date {
  width: auto;
  flex: 0 1 auto;
  min-width: 9.5rem;
}

.range-toggle {
  display: inline-flex;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  overflow: hidden;
}

.range-btn {
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.range-btn.is-active {
  background: var(--cc-navy);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.range-btn:not(.is-active):hover {
  background: var(--bg-section-alt);
  color: var(--text-main);
}

select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: var(--bg-section-alt);
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

select option {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Native date/month picker icons - white calendar on dark fields */
input[type="date"],
input[type="month"] {
  color-scheme: dark;
  color: var(--text-main);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  opacity: 1;
  width: 1.15em;
  height: 1.15em;
  margin-left: 0.15em;
  filter: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center / contain no-repeat;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.icon-btn {
  min-width: 2.4rem;
  min-height: 2.4rem;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.35rem;
}

.entry-row {
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.entry-row .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.entry-actions {
  display: flex;
  gap: 0.35rem;
}

.hours-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.hours-cell {
  border-radius: 6px;
  padding: 0.55rem 0.4rem;
  border: 1px solid var(--border-card);
  text-align: center;
  min-height: 4.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.hours-cell .date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.hours-cell .value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.hours-low .date,
.hours-ok .date,
.hours-high .date {
  color: inherit;
  opacity: 0.75;
}

.hours-low { background: var(--hours-low); color: #1e293b; }
.hours-ok { background: var(--hours-ok); color: #14532d; }
.hours-high { background: var(--hours-high); color: #7f1d1d; }
.hours-zero { background: var(--hours-zero-bg); color: var(--hours-zero-text); }

.month-total {
  font-size: 1.1rem;
  margin: 0.5rem 0 1rem;
}

.filter-hint {
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #111827;
  border: 1px solid var(--border-card);
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 20;
}

.toast.show {
  opacity: 1;
}

dialog {
  border: 1px solid var(--border-card);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-main);
  width: min(560px, 96vw);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dialog-heading h3 {
  margin: 0;
  flex: 1;
}

.dialog-close-btn {
  flex-shrink: 0;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.35rem 0.5rem;
}

.dialog-back-btn {
  font-size: 1.35rem;
  line-height: 1;
}

.dialog-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.radio-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 600px) {
  .logo-cc { font-size: 28px; }
  .logo-f { font-size: 20px; }
  .logo-o, .logo-r, .logo-c2, .logo-e { font-size: 15px; }

  .hours-grid {
    gap: 0.4rem;
  }

  .hours-cell {
    min-height: 3.75rem;
    padding: 0.45rem 0.25rem;
  }

  .hours-cell .date {
    font-size: 0.65rem;
  }

  .hours-cell .value {
    font-size: 1rem;
  }
}
