/* ===================================================
   EMS TASK MANAGER — Flight Progress Strip Styling
   =================================================== */

:root {
  --bg-dark:        #1a1d21;
  --bg-panel:       #22262c;
  --bg-panel-alt:   #1e2228;
  --border:         #3a3f47;
  --border-light:   #4a5060;

  --strip-open-bg:  #fdf3d0;
  --strip-open-bar: #e6a817;
  --strip-done-bg:  #d4edda;
  --strip-done-bar: #28a745;
  --strip-text:     #1a1a1a;

  --header-bg:      #111316;
  --header-text:    #c8d0db;
  --nav-active:     #e6a817;

  --btn-primary:    #e6a817;
  --btn-primary-fg: #1a1a1a;
  --btn-success:    #28a745;
  --btn-success-fg: #fff;
  --btn-secondary:  #4a5060;
  --btn-secondary-fg: #fff;
  --btn-danger:     #dc3545;

  --input-bg:       #fff;
  --input-border:   #aaa;

  --font-mono: 'Courier New', Courier, monospace;
}

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

body {
  background: var(--bg-dark);
  color: var(--header-text);
  font-family: var(--font-mono);
  min-height: 100vh;
}

/* ---- Header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header-bg);
  border-bottom: 2px solid var(--strip-open-bar);
  padding: 0.6rem 1.4rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--strip-open-bar);
  letter-spacing: 0.06em;
}

.header-nav { display: flex; gap: 1.5rem; }

.nav-link {
  color: var(--header-text);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover   { color: var(--nav-active); }
.nav-link.active  { color: var(--nav-active); border-bottom-color: var(--nav-active); }
.nav-link.logout  { color: #888; }
.nav-link.logout:hover { color: var(--btn-danger); }

/* ---- Main layout ---- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ---- Board toolbar ---- */
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.board-title {
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--header-text);
  font-weight: normal;
}

.strip-count {
  display: inline-block;
  background: var(--strip-open-bar);
  color: var(--btn-primary-fg);
  border-radius: 3px;
  padding: 0 6px;
  font-size: 0.85rem;
  margin-left: 6px;
  font-weight: bold;
}

/* ---- Strip Board ---- */
.strip-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-board {
  text-align: center;
  padding: 3rem;
  color: #555;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  border: 1px dashed #333;
  border-radius: 4px;
}

/* ====================================================
   FLIGHT PROGRESS STRIP
   ==================================================== */
.strip {
  background: var(--strip-open-bg);
  color: var(--strip-text);
  border-radius: 3px;
  border-left: 8px solid var(--strip-open-bar);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  overflow: hidden;
  transition: opacity 0.3s;
}

.strip.completed {
  background: var(--strip-done-bg);
  border-left-color: var(--strip-done-bar);
  opacity: 0.88;
}

/* Strip Header */
.strip-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0,0,0,0.07);
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  position: relative;
}

.strip-id {
  font-weight: bold;
  color: #5a3e00;
  font-size: 0.95rem;
  min-width: 52px;
}

.strip-datetime { color: #444; }
.strip-separator { color: #999; }
.strip-initiator { color: #333; }

.strip-delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #c0392b;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.15s;
  padding: 0 4px;
}
.strip-delete-btn:hover { opacity: 1; }

/* Strip Title */
.strip-title {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.35);
}

/* Sub-tasks area */
.strip-subtasks {
  padding: 0.25rem 0.75rem 0.25rem;
}

.subtask-header-row,
.subtask-row {
  display: grid;
  grid-template-columns: 28px 1fr 160px 28px;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
}

.subtask-header-row {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: #666;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding-bottom: 4px;
  margin-bottom: 2px;
  font-weight: bold;
}

.subtask-row {
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.subtask-row.completed .st-desc {
  text-decoration: line-through;
  color: #888;
}

.col-check  { display: flex; align-items: center; justify-content: center; }
.col-desc   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-person { color: #444; font-size: 0.78rem; text-align: right; }
.col-action { display: flex; align-items: center; justify-content: center; }

.subtask-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--strip-done-bar);
}

.btn-icon.delete-st {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.15s;
  padding: 0;
  line-height: 1;
}
.btn-icon.delete-st:hover { opacity: 1; }

.no-subtasks {
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
  padding: 4px 0;
}

/* Add sub-task row */
.strip-add-subtask {
  padding: 0.4rem 0.75rem;
  background: rgba(0,0,0,0.04);
  border-top: 1px solid rgba(0,0,0,0.08);
}

.add-subtask-form {
  display: grid;
  grid-template-columns: 1fr 160px 80px;
  gap: 6px;
  align-items: center;
}

.add-subtask-form input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 2px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #222;
}

.add-subtask-form input:focus {
  outline: 2px solid var(--strip-open-bar);
  outline-offset: -1px;
}

/* Strip Footer */
.strip-footer {
  padding: 0.4rem 0.75rem;
  background: rgba(0,0,0,0.05);
  border-top: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.completed-footer {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.signoff-label, .del-note-label { color: #555; font-weight: bold; }
.signoff-name, .del-note-value  { color: #1a6b2e; }
.signoff-date  { color: #444; }
.signoff-sep   { color: #aaa; }

/* ====================================================
   BUTTONS
   ==================================================== */
.btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  border: none;
  border-radius: 2px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { filter: brightness(0.9); }

.btn-primary   { background: var(--btn-primary);   color: var(--btn-primary-fg); }
.btn-success   { background: var(--btn-success);   color: var(--btn-success-fg); }
.btn-secondary { background: var(--btn-secondary); color: var(--btn-secondary-fg); }
.btn-full      { width: 100%; padding: 0.6rem; }

.btn-sm { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
.btn-add { background: #5a7a5a; color: #fff; }
.btn-signoff { font-size: 0.75rem; padding: 0.3rem 0.7rem; }

/* ====================================================
   MODALS
   ==================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--strip-open-bar);
  border-radius: 3px;
  width: 420px;
  max-width: 95vw;
  padding: 1.2rem;
}

.modal-header {
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: var(--strip-open-bar);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.modal .form-group  { margin-bottom: 0.8rem; }
.modal label        { display: block; font-size: 0.7rem; color: #aaa; letter-spacing: 0.08em; margin-bottom: 4px; }
.modal input        { width: 100%; background: var(--input-bg); border: 1px solid var(--input-border);
                      border-radius: 2px; padding: 6px 10px; font-family: var(--font-mono);
                      font-size: 0.85rem; color: #222; }
.modal input:focus  { outline: 2px solid var(--strip-open-bar); outline-offset: -1px; }

.optional { color: #888; font-style: italic; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ====================================================
   LOGIN PAGE
   ==================================================== */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 4px solid var(--strip-open-bar);
  border-radius: 3px;
  width: 360px;
  padding: 2rem;
}

.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header .logo { font-size: 1.2rem; }
.login-subtitle {
  font-size: 0.7rem;
  color: #666;
  letter-spacing: 0.15em;
  margin-top: 0.3rem;
}

.login-error {
  background: rgba(220,53,69,0.15);
  border: 1px solid var(--btn-danger);
  color: #ff6b6b;
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}

.login-box .form-group  { margin-bottom: 0.9rem; }
.login-box label        { display: block; font-size: 0.7rem; color: #aaa; letter-spacing: 0.08em; margin-bottom: 4px; }
.login-box input        { width: 100%; background: var(--input-bg); border: 1px solid var(--input-border);
                          border-radius: 2px; padding: 7px 10px; font-family: var(--font-mono);
                          font-size: 0.9rem; color: #222; }
.login-box input:focus  { outline: 2px solid var(--strip-open-bar); outline-offset: -1px; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 600px) {
  .add-subtask-form { grid-template-columns: 1fr; }
  .subtask-header-row,
  .subtask-row { grid-template-columns: 28px 1fr 100px 28px; }
  .col-person { font-size: 0.7rem; }
}
