/* =====================================================
   Advanced Grow System Pro – styles.css v4.1
   ===================================================== */

/* ── Base ──────────────────────────────────────────── */
.ags-main-wrapper { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; }
*, .ags-main-wrapper * { box-sizing: border-box; }

/* ── Header ────────────────────────────────────────── */
.ags-header { display:flex; justify-content:space-between; align-items:center; background:#1a1a1a; color:#fff; padding:14px 24px; border-radius:8px 8px 0 0; }
.ags-title-area { display:flex; align-items:center; gap:10px; }
.ags-title-area h1 { color:#fff; margin:0; font-size:1.1rem; font-weight:600; }
.status-offline { font-size:0.75rem; background:#444; color:#bbb; padding:4px 10px; border-radius:12px; border:1px solid #555; }

/* ── Tabs ──────────────────────────────────────────── */
.ags-tabs { display:flex; background:#f5f5f5; border-bottom:2px solid #e0e0e0; padding:0 4px; }
.ags-tab { background:none; border:none; padding:12px 20px; font-size:0.88rem; font-weight:600; color:#666; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; transition:all 0.15s; }
.ags-tab:hover { color:#2e7d32; background:#fff; }
.ags-tab-active { color:#2e7d32; border-bottom-color:#2e7d32; background:#fff; }

/* ── Tab content ───────────────────────────────────── */
.ags-tab-content { padding:20px 0; }

/* ── Grid layout ───────────────────────────────────── */
.ags-grid { display:grid; grid-template-columns:300px 1fr; gap:20px; }

/* ── Cards ─────────────────────────────────────────── */
.ags-card { background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:20px; margin-bottom:16px; box-shadow:0 2px 4px rgba(0,0,0,0.05); }
.ags-card.highlight { border-left:4px solid #2e7d32; }
.ags-card h3 { margin:0 0 15px; font-size:0.95rem; border-bottom:1px solid #eee; padding-bottom:10px; display:flex; align-items:center; gap:8px; }

/* ── Forms ─────────────────────────────────────────── */
.ags-form-group { margin-bottom:14px; }
.ags-form-group label { display:block; font-weight:600; margin-bottom:5px; font-size:0.83rem; color:#555; }
.ags-form-group input, .ags-form-group select, .ags-form-group textarea { width:100%; border:1px solid #ccc; border-radius:4px; padding:8px; font-size:0.88rem; }
.ags-form-group input:focus, .ags-form-group select:focus, .ags-form-group textarea:focus { border-color:#2e7d32; outline:none; box-shadow:0 0 0 2px rgba(46,125,50,0.1); }

/* ── Log grid ──────────────────────────────────────── */
.ags-log-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:12px; }
@media (min-width:900px) { .ags-log-grid { grid-template-columns:repeat(6,1fr); } }

/* ── Buttons ───────────────────────────────────────── */
.ags-btn { cursor:pointer; border:none; padding:9px 16px; border-radius:4px; font-weight:600; font-size:0.88rem; transition:opacity 0.15s; }
.ags-btn:hover { opacity:0.88; }
.ags-btn-primary { background:#2271b1; color:#fff; }
.ags-btn-success { background:#2e7d32; color:#fff; }
.ags-btn-danger  { background:#d32f2f; color:#fff; }

/* ── Batch list ────────────────────────────────────── */
.ags-list { max-height:340px; overflow-y:auto; }
.ags-batch-item { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-bottom:1px solid #eee; cursor:pointer; transition:background 0.15s; border-radius:4px; }
.ags-batch-item:hover { background:#f0f7f0; }
.ags-batch-item-active { background:#e8f5e9; font-weight:600; }
.ags-batch-stage { font-size:10px; color:#fff; padding:2px 8px; border-radius:10px; white-space:nowrap; }

/* ── Stage badge ───────────────────────────────────── */
.ags-stage-badge { font-size:11px; color:#fff; padding:3px 10px; border-radius:12px; font-weight:600; }

/* ── Tags ──────────────────────────────────────────── */
.v-tag { font-size:11px; padding:3px 8px; border-radius:10px; display:inline-block; }

/* ── Progress bar ──────────────────────────────────── */
.ags-progress-track { background:#e0e0e0; height:18px; border-radius:9px; overflow:hidden; border:1px solid #ccc; }
.ags-progress-fill  { background:linear-gradient(90deg,#2e7d32,#66bb6a,#aed581); height:100%; width:0%;
                      transition:width 0.7s cubic-bezier(0.4,0,0.2,1); min-width:4px; }

/* ── Tables ────────────────────────────────────────── */
.ags-table-container { overflow-x:auto; }
#logs-table, #all-logs-table { width:100%; border-collapse:collapse; }
#logs-table th, #all-logs-table th { padding:10px 12px; background:#f9f9f9; border-bottom:2px solid #eee; font-size:0.82rem; text-align:left; white-space:nowrap; }
#logs-table td, #all-logs-table td { padding:10px 12px; border-bottom:1px solid #eee; font-size:0.85rem; }
#logs-table tr:hover td, #all-logs-table tr:hover td { background:#fafff9; }

/* ── Strain / harvest cards ────────────────────────── */
.ags-strain-card { background:#fafafa; border:1px solid #eee; border-radius:8px; padding:14px; margin-bottom:10px; }

/* ── Search dropdown ───────────────────────────────── */
#search-results { background:#fff; border:1px solid #ccc; position:absolute; width:100%; z-index:1000; max-height:160px; overflow-y:auto; border-radius:0 0 6px 6px; box-shadow:0 4px 8px rgba(0,0,0,.1); }
.search-suggestion { padding:10px 12px; border-bottom:1px solid #f0f0f0; cursor:pointer; font-size:0.88rem; }
.search-suggestion:hover { background:#f0f7f0; }

/* ── Calendar ──────────────────────────────────────── */
.ags-calendar-wrap { background:#fff; border:1px solid #e5e5e5; border-radius:8px; padding:24px; box-shadow:0 2px 4px rgba(0,0,0,0.05); }
.ags-cal-header { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.ags-cal-dow { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-bottom:4px; }
.ags-cal-dow div { text-align:center; font-size:11px; font-weight:700; color:#888; padding:4px 0; }
.ags-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; min-height:200px; }
.ags-cal-cell { min-height:72px; height:72px; background:#fafafa; border:1px solid #eee; border-radius:6px; padding:6px; position:relative; transition:background 0.15s; overflow:hidden; }
.ags-cal-cell:hover { background:#f0f7f0; }
.ags-cal-empty { background:transparent; border-color:transparent; }
.ags-cal-today { background:#e8f5e9; border-color:#2e7d32; }
.ags-cal-day-num { font-size:12px; font-weight:700; color:#333; margin-bottom:4px; }
.ags-cal-today .ags-cal-day-num { color:#2e7d32; }
.ags-cal-dots { display:flex; flex-wrap:wrap; gap:3px; }
.ags-cal-dot { display:inline-block; width:9px; height:9px; border-radius:50%; }
.ags-cal-legend { margin-top:16px; font-size:12px; color:#666; display:flex; flex-wrap:wrap; gap:4px 0; align-items:center; }
.ags-cal-legend .ags-cal-dot { width:10px; height:10px; }
.ags-cal-detail { margin-top:20px; background:#f9f9f9; border:1px solid #eee; border-radius:8px; padding:18px; }

/* ── Misc ──────────────────────────────────────────── */
.empty-msg { color:#999; font-style:italic; text-align:center; padding:20px; }
.ags-spinner { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,.3); border-radius:50%; border-top-color:#fff; animation:agspin 1s linear infinite; margin-right:6px; }
@keyframes agspin { to { transform:rotate(360deg); } }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .ags-grid { grid-template-columns:1fr; }
    .ags-tabs { overflow-x:auto; }
    .ags-tab  { padding:10px 14px; font-size:0.82rem; white-space:nowrap; }
    .ags-cal-cell { min-height:52px; }
}
