/* ============================================================
   Media & TV tab styles — append to public/css/main.css (or inline)
   ============================================================ */

/* Layout: sidebar + main content */
.media-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1000px) { .media-layout { grid-template-columns: 1fr; } }

.media-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  position: sticky;
  top: 14px;
}
.media-sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.media-sidebar-header h3 { margin: 0; font-size: 13px; font-weight: 600; }
.m-upload-btn {
  background: var(--podravka); color: white; border: none; border-radius: 6px;
  padding: 6px 10px; font-size: 12px; cursor: pointer; font-weight: 500;
}
.m-upload-btn:hover { filter: brightness(.92); }
.m-last-upload { font-size: 11px; color: var(--muted); margin-bottom: 12px; font-style: italic; }

.m-filter { margin-bottom: 8px; }
.m-filter label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.m-filter select {
  width: 100%; padding: 6px 8px; font-size: 12px; border: 1px solid var(--border);
  border-radius: 6px; background: white; cursor: pointer;
}
.m-reset {
  width: 100%; margin-top: 10px; padding: 7px; font-size: 12px; background: white;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--muted);
}
.m-reset:hover { color: var(--text); border-color: #94a3b8; }

/* Main */
.media-main { min-width: 0; }
.media-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.media-subtab {
  padding: 9px 18px; border: none; background: none; cursor: pointer; font-size: 13px;
  color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500;
}
.media-subtab.active { color: var(--text); border-bottom-color: var(--podravka); font-weight: 600; }
.media-subcontent { display: none; }
.media-subcontent.active { display: block; }

/* Grid for charts */
.m-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.m-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .m-grid-2 { grid-template-columns: 1fr; } }
.chartbox { position: relative; height: 240px; }

/* Card (re-use existing if available, else this) */
.media-main .card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
}
.media-main .card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }

/* Tables */
.m-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.m-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; }
.m-table th.num { text-align: right; }
.m-table td { padding: 7px 8px; border-bottom: 1px solid #f3f4f6; }
.m-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.m-table tr:hover td { background: #f9fafb; }

/* Dimension picker */
.m-dimpicker { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.m-dimpicker span { color: var(--muted); }
.m-dimpicker button {
  padding: 4px 10px; border: 1px solid var(--border); background: white; border-radius: 999px;
  font-size: 11px; cursor: pointer; color: var(--muted);
}
.m-dimpicker button.active { background: var(--podravka); color: white; border-color: var(--podravka); }

/* Upload modal */
.m-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; align-items: center; justify-content: center; }
.m-modal.open { display: flex; }
.m-modal-card { background: white; border-radius: 12px; padding: 28px; width: 480px; max-width: 92vw; position: relative; }
.m-modal-card h3 { margin: 0 0 6px; }
.m-modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.m-modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.m-upload-drop {
  border: 2px dashed var(--border); border-radius: 10px; padding: 36px; text-align: center;
  cursor: pointer; transition: all .15s;
}
.m-upload-drop.hover { border-color: var(--podravka); background: #fef3f4; }
.m-upload-hint { color: var(--muted); font-size: 14px; }
.m-upload-status { margin-top: 14px; font-size: 13px; text-align: center; min-height: 18px; }
.m-upload-status.pending { color: var(--muted); }
.m-upload-status.ok { color: var(--good); }
.m-upload-status.err { color: var(--bad); }
