*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body        { font-family: system-ui, sans-serif; background: #f5f5f5; color: #1a1a1a; }
.container  { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }
.navbar     { background: #1e293b; color: white; padding: 0.75rem 2rem;
              display: flex; align-items: center; gap: 2rem; }
.brand      { font-weight: 700; font-size: 1.1rem; }
.nav-link   { color: #94a3b8; text-decoration: none; }
.nav-link:hover { color: white; }

/* Cards */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.device-card { background: white; border-radius: 8px; padding: 1.25rem;
               border: 1px solid #e2e8f0; }
.device-card.online  { border-left: 4px solid #22c55e; }
.device-card.offline { border-left: 4px solid #94a3b8; }
.device-meta { color: #64748b; font-size: 0.85rem; margin-top: 0.25rem; }

/* Status dot */
.dot         { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-green   { background: #22c55e; }
.dot-grey    { background: #94a3b8; }

/* Device detail */
.device-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.device-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid #e2e8f0; margin-bottom: 1.25rem; }
.device-tab  { padding: 0.5rem 0.9rem; color: #64748b; text-decoration: none; font-size: 0.9rem;
               border-bottom: 2px solid transparent; margin-bottom: -1px; }
.device-tab:hover { color: #1a1a1a; }
.device-tab.active { color: #1e293b; font-weight: 600; border-bottom-color: #1e293b; }
.badge       { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-grey  { background: #e2e8f0; color: #475569; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.update-stale { color: #9a3412; }

.panel       { background: white; border-radius: 8px; padding: 1.25rem;
               border: 1px solid #e2e8f0; margin-bottom: 1rem; }
.panel-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

.screenshot  { max-width: 100%; border-radius: 4px; border: 1px solid #e2e8f0; }

.btn         { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px;
               border: 1px solid #e2e8f0; background: white; cursor: pointer;
               font-size: 0.9rem; text-decoration: none; color: inherit; }
.btn:hover   { background: #f1f5f9; }
.btn-primary { background: #1e293b; color: white; border-color: #1e293b; }
.btn-primary:hover { background: #334155; }
.btn-danger  { background: #ef4444; color: white; border-color: #ef4444; }
.btn-sm      { padding: 0.2rem 0.6rem; font-size: 0.8rem; }

/* Commands */
.command-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.input       { padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0;
               border-radius: 6px; font-size: 0.9rem; margin-right: 0.5rem; }
.mt-2        { margin-top: 0.5rem; }

/* Chat */
.chat-tabs        { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.chat-scroll      { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column;
                     gap: 0.4rem; padding: 0.5rem; background: #f8fafc; border-radius: 6px; }
.chat-messages    { display: flex; flex-direction: column; gap: 0.4rem; }
.chat-bubble-parent, .chat-bubble-kid {
                     max-width: 75%; padding: 0.5rem 0.75rem; border-radius: 12px; font-size: 0.9rem; }
.chat-bubble-parent { align-self: flex-end; background: #1e293b; color: white; border-bottom-right-radius: 2px; }
.chat-bubble-kid    { align-self: flex-start; background: #e2e8f0; color: #1a1a1a; border-bottom-left-radius: 2px; }
.chat-bubble-parent time, .chat-bubble-kid time {
                     display: block; font-size: 0.65rem; opacity: 0.7; margin-top: 0.15rem; }
.chat-input-row    { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.chat-input-row .input { flex: 1; margin-right: 0; }
.chat-bubble-img   { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; cursor: pointer; }
.chat-bubble-img + span { display: block; margin-top: 0.35rem; }

/* Process table */
.process-table      { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.process-table th,
.process-table td   { text-align: left; padding: 0.4rem 0.75rem; border-bottom: 1px solid #f1f5f9; }
.process-table th   { background: #f8fafc; font-weight: 600; }
.process-table tfoot td { background: #f8fafc; border-top: 2px solid #e2e8f0; }
.pagination         { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.6rem; }
.pagination button:disabled { opacity: 0.4; cursor: default; }

.day-checkboxes  { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.day-checkbox    { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; }

/* Usage chart */
.usage-chart  { display: flex; gap: 6px; align-items: flex-end; height: 120px; margin-top: 0.5rem; }
.usage-bar    { flex: 1; height: 100%; display: flex; flex-direction: column;
                justify-content: flex-end; align-items: center; font-size: 0.7rem; color: #64748b; }
.usage-fill   { width: 60%; background: #1e293b; border-radius: 3px 3px 0 0; min-height: 2px; }
.today-total  { font-size: 1.1rem; margin-top: 0.25rem; }
.usage-by-user { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-direction: column; gap: 0.25rem; }
.usage-by-user li { font-size: 0.85rem; color: #334155; }
.usage-by-user details { margin-top: 0.15rem; }
.usage-by-user summary { font-size: 0.78rem; color: #64748b; cursor: pointer; }
.usage-app-list { list-style: none; padding: 0.2rem 0 0 0.8rem; margin: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.usage-app-list li { font-size: 0.78rem; color: #64748b; }

/* Screenshot gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.gallery-item { position: relative; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: white; }
.gallery-link { display: block; text-decoration: none; color: inherit; }
.gallery-item img { width: 100%; height: 130px; object-fit: cover; display: block; }
.gallery-caption   { display: block; padding: 0.4rem 0.6rem; font-size: 0.75rem; color: #64748b; }
.gallery-delete-btn {
  position: absolute; top: 0.35rem; right: 0.35rem; z-index: 1;
  width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center; padding: 0;
  border: none; border-radius: 999px; background: rgba(15, 23, 42, 0.65); color: white;
  font-size: 0.85rem; cursor: pointer;
}
.gallery-delete-btn:hover { background: #dc2626; }

/* Alerts */
.alert         { padding: 0.75rem 1rem; border-radius: 6px; margin-top: 0.5rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* Login */
.login-box   { max-width: 360px; margin: 6rem auto; background: white;
               padding: 2rem; border-radius: 8px; border: 1px solid #e2e8f0; }
.login-box h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.login-box label { display: block; margin-bottom: 1rem; font-size: 0.9rem; font-weight: 500; }
.login-box input { display: block; width: 100%; margin-top: 0.25rem; padding: 0.5rem 0.75rem;
                   border: 1px solid #e2e8f0; border-radius: 6px; }
.login-box button { width: 100%; margin-top: 0.5rem; padding: 0.6rem; background: #1e293b;
                    color: white; border: none; border-radius: 6px; cursor: pointer; }
