:root {
  --primary: #4285F4;
  --success: #0F9D58;
  --warning: #F4B400;
  --danger: #DB4437;
  --gray: #6c757d;
  --light: #f8f9fa;
  --border: #dee2e6;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  color: #1a1a2e;
  min-height: 100vh;
  padding-bottom: 80px;
}

.header {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 { font-size: 18px; font-weight: 700; }

.tab-nav {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 54px;
  z-index: 99;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: 72px;
  padding: 12px 4px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.page { display: none; padding: 16px; max-width: 480px; margin: 0 auto; }
.page.active { display: block; }

.card { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-title { font-size: 13px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }

.timer-slot { background: linear-gradient(135deg, #1a1a2e, #16213e); color: #fff; border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 10px; position: relative; }
.timer-slot.idle { background: #e9ecef; color: #495057; }
.timer-slot-label { font-size: 11px; color: rgba(255,255,255,.6); letter-spacing: 1px; margin-bottom: 6px; }
.timer-slot.idle .timer-slot-label { color: var(--gray); }
.timer-value { font-size: 40px; font-weight: 200; font-variant-numeric: tabular-nums; }
.timer-task-preview { margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.75); }

.quick-btn { width: 100%; padding: 16px; border: none; border-radius: var(--radius); font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); margin-top: 6px; }
.quick-btn.start { background: var(--success); color: #fff; }
.quick-btn.recording { background: var(--warning); color: #1a1a2e; }
.quick-btn.secondary-start { background: #fff; color: var(--primary); border: 2px solid var(--primary); }

.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--gray); margin-bottom: 6px; display: block; }
.form-label .required { color: var(--danger); margin-left: 2px; }

.label-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip { padding: 6px 12px; border-radius: 20px; border: 2px solid var(--border); background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; }
.label-chip.selected-classification { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.label-chip.selected-department { background: var(--success); color: #fff; border-color: var(--success); }
.label-chip.selected-other { background: #8e24aa; color: #fff; border-color: #8e24aa; }
.label-chip.selected-personal { background: #607d8b; color: #fff; border-color: #607d8b; }

.text-input, select.text-input { width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 15px; outline: none; background: #fff; }
.text-input:focus { border-color: var(--primary); }

.action-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn { padding: 14px; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #1a1a2e; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--light); color: #333; border: 1px solid var(--border); }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary); }

.scope-toggle { display: flex; background: var(--light); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.scope-btn { flex: 1; padding: 8px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; background: none; color: var(--gray); }
.scope-btn.active { background: #fff; color: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.1); }

.resume-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 2px solid var(--primary); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: #fff; font-size: 13px; }

.login-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #4285F4, #0F9D58); }
.login-card { background: #fff; border-radius: 20px; padding: 32px 24px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.2); text-align: center; }
.login-logo { font-size: 40px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--gray); margin-bottom: 24px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1a1a2e; color: #fff; padding: 12px 20px; border-radius: 24px; font-size: 14px; font-weight: 600; opacity: 0; transition: all .3s; z-index: 300; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.manual-entry-link { text-align: center; font-size: 13px; color: var(--primary); margin-top: 10px; cursor: pointer; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; justify-content: center; align-items: flex-end; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 20px 20px 16px 16px; padding: 24px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
