/* ============================================================
   LinkShort – Moderní responzivní CSS
   Tmavý zelený motiv, fluid layout, mobile-first
   ============================================================ */

/* ─── CSS proměnné ─────────────────────────────────────────── */
:root {
  --primary:        #1a5c2a;
  --primary-light:  #2d8c44;
  --primary-dark:   #134a20;
  --primary-muted:  rgba(26, 92, 42, 0.12);
  --accent:         #38b560;

  --bg:             #0f1117;
  --bg-card:        #161b22;
  --bg-card-hover:  #1c2330;
  --bg-input:       #0d1117;
  --bg-sidebar:     #0d1117;

  --text:           #e6edf3;
  --text-muted:     #8b949e;
  --text-subtle:    #6e7681;
  --text-primary:   #e6edf3;

  --border:         #21262d;
  --border-focus:   #2d8c44;
  --border-hover:   #30363d;

  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.6);
  --shadow-glow:    0 0 20px rgba(45,140,68,.25);

  --sidebar-w:      240px;
  --topbar-h:       60px;

  --transition:     0.2s ease;
  --transition-med: 0.35s ease;

  /* Stavové barvy */
  --green:   #2d8c44;
  --blue:    #1f6feb;
  --orange:  #d29922;
  --purple:  #8957e5;
  --red:     #da3633;
  --cyan:    #1f9ac1;
  --danger:  #da3633;
}

/* ─── Reset & základ ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;       /* Zabrání horizontálnímu scrollu na celé stránce */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; }

/* scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ─── Přihlašovací stránka ─────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(26,92,42,.35), transparent),
    var(--bg);
  padding: 1rem;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: slideUp .4s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: .5rem 0 .25rem;
}
.login-header p { color: var(--text-muted); font-size: .9rem; }

.login-icon {
  display: inline-flex;
  width: 64px; height: 64px;
  background: var(--primary-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: .5rem;
}

/* ─── App layout ───────────────────────────────────────────── */
.app-body { overflow-x: hidden; }

.app-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition-med);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.sidebar-header i {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.2rem;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  margin: .1rem .6rem;
  border-radius: var(--radius-md);
}
.nav-item i {
  width: 20px;
  text-align: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-muted);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  margin-left: -0.6rem;
}

.sidebar-footer {
  padding: .75rem .6rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-info {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .6rem;
  margin-bottom: .25rem;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.user-details { overflow: hidden; }
.user-name {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role { display: block; font-size: .75rem; color: var(--text-muted); }
.logout-link { color: var(--text-muted); }
.logout-link:hover { color: var(--red); background: rgba(218,54,51,.1); }

/* Collapsed (desktop) */
.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}
.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 1.25rem .6rem; }
.sidebar.collapsed .nav-item { justify-content: center; padding: .65rem; margin: .1rem .4rem; }
.sidebar.collapsed .sidebar-footer { padding: .4rem; }
.sidebar.collapsed .user-info { justify-content: center; }

/* ─── Hlavní obsah ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-w)); /* Nepřeteče přes viewport */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-med), max-width var(--transition-med);
  overflow-x: hidden;
}

.sidebar.collapsed ~ .main-content { margin-left: 64px; max-width: calc(100vw - 64px); }

/* ─── Top bar ──────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: rgba(15,17,23,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-hover); }

.page-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ─── Content area ─────────────────────────────────────────── */
.content-area {
  padding: 1.5rem;
  flex: 1;
}

/* ─── Alerts ───────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: .875rem;
  margin: 0 1.5rem 1rem;
  animation: slideDown .3s ease;
}
.alert i { flex-shrink: 0; margin-top: .1rem; }
.alert-close {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; font-size: 1.1rem;
  margin-left: auto; padding: 0 .2rem;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

.alert-success { background: rgba(45,140,68,.12); border-color: rgba(45,140,68,.3); color: #5dcb7e; }
.alert-error   { background: rgba(218,54,51,.12); border-color: rgba(218,54,51,.3); color: #f85149; }
.alert-warning { background: rgba(210,153,34,.12); border-color: rgba(210,153,34,.3); color: #e3b341; }
.alert-info    { background: rgba(31,106,235,.12); border-color: rgba(31,106,235,.3); color: #58a6ff; }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.card-header h3 {
  font-size: .95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
}
.card-header h3 i { color: var(--accent); }

.card-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

/* ─── Stat cards grid ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: default;
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.stat-icon.green  { background: rgba(45,140,68,.15);  color: var(--green); }
.stat-icon.blue   { background: rgba(31,106,235,.15); color: var(--blue); }
.stat-icon.orange { background: rgba(210,153,34,.15); color: var(--orange); }
.stat-icon.purple { background: rgba(137,87,229,.15); color: var(--purple); }
.stat-icon.red    { background: rgba(218,54,51,.15);  color: var(--red); }
.stat-icon.cyan   { background: rgba(31,154,193,.15); color: var(--cyan); }

.stat-info h4 { font-size: .77rem; color: var(--text-muted); font-weight: 500; margin-bottom: .2rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }

/* ─── Grid layouts ─────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.mb-4 { margin-bottom: 1.25rem; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(26,92,42,.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,92,42,.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--border-hover); }

.btn-danger {
  background: rgba(218,54,51,.12);
  color: #f85149;
  border-color: rgba(218,54,51,.3);
}
.btn-danger:hover { background: rgba(218,54,51,.22); color: #ff6b67; }

.btn-info {
  background: rgba(31,106,235,.14);
  color: #58a6ff;
  border-color: rgba(31,106,235,.35);
}
.btn-info:hover { background: rgba(31,106,235,.24); color: #9ecbff; }

.btn-warning {
  background: rgba(210,153,34,.15);
  color: #e3b341;
  border-color: rgba(210,153,34,.35);
}
.btn-warning:hover { background: rgba(210,153,34,.25); color: #f2cc60; }

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-xs { padding: .25rem .45rem; font-size: .75rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; justify-content: center; padding: .75rem 1rem; font-size: .95rem; }

.btn-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  background: var(--primary-muted);
  color: var(--accent);
  border: 1px solid rgba(45,140,68,.3);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.copy-btn:hover { background: rgba(45,140,68,.2); }
.copy-btn.copied { background: rgba(45,140,68,.25); color: #5dcb7e; }

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-success { background: rgba(45,140,68,.15);   color: #5dcb7e; }
.badge-error   { background: rgba(218,54,51,.15);   color: #f85149; }
.badge-warning { background: rgba(210,153,34,.15);  color: #e3b341; }
.badge-info    { background: rgba(31,106,235,.15);  color: #58a6ff; }
.badge-purple  { background: rgba(137,87,229,.15);  color: #c084fc; }
.badge-muted   { background: rgba(139,148,158,.1);  color: var(--text-muted); }

.mb-2 { margin-bottom: .5rem; }

/* ─── Formuláře ────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.form-group label i { font-size: .8rem; color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="datetime-local"],
input[type="date"],
input[type="color"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(45,140,68,.18);
}
input::placeholder, textarea::placeholder { color: var(--text-subtle); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
select option { background: var(--bg-card); color: var(--text); }

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: .76rem;
  color: var(--text-subtle);
  margin-top: .3rem;
}

/* Toggle switch */
.toggle-switch {
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: center !important;
  column-gap: .65rem;
  row-gap: .2rem;
  width: 100%;
  cursor: pointer;
  font-size: .875rem !important;
  color: var(--text-muted) !important;
  user-select: none;
  line-height: 1.35;
}
.toggle-switch input[type="checkbox"] { display: none; }
.toggle-slider {
  display: inline-block;
  width: 38px; height: 22px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-subtle);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked ~ .toggle-slider { background: var(--primary-light); }
.toggle-switch input:checked ~ .toggle-slider::after { transform: translateX(16px); background: #fff; }
.toggle-text {
  display: block;
  min-width: 0;
  word-break: break-word;
}

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: .55rem;
}

/* ─── Tabulky ──────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead tr { border-bottom: 1px solid var(--border); }
th {
  text-align: left;
  padding: .7rem 1rem;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
.table-link { color: var(--accent); font-weight: 500; }
.table-link:hover { color: var(--primary-light); text-decoration: underline; }

/* ─── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .85rem 1rem;
}

.search-input {
  flex: 1;
  min-width: 140px;        /* Sníženo aby nepřetékalo na tabletu */
  max-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}
.search-input > i {
  position: absolute;
  left: .8rem;
  color: var(--text-subtle);
  pointer-events: none;
  font-size: .85rem;
}
.search-input input[type="search"] {
  padding-left: 2.2rem;
  background: var(--bg-input);
}
.search-input form { display: contents; width: 100%; }

.filter-bar select {
  width: auto;
  min-width: 110px;        /* Mírně sníženo pro narrow viewport */
  flex-shrink: 1;          /* Povolí zmenšení pokud je málo místa */
}

.filter-bar .form-group label {
  font-size: .77rem;
  color: var(--text-subtle);
}

/* ─── Hromadné akce / seznam odkazů ───────────────────────── */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .75rem 1rem;
  margin-bottom: .9rem;
}

.bulk-check {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.bulk-counter {
  margin-left: auto;
  font-size: .82rem;
  color: var(--text-subtle);
}

.link-card {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: .9rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .95rem 1rem;
  margin-bottom: .7rem;
  transition: border-color var(--transition), transform var(--transition);
}
.link-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.link-select {
  padding-top: .2rem;
}

.link-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-light);
  cursor: pointer;
}

.link-type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  margin-top: .1rem;
}
.link-type-icon.url {
  background: rgba(31,106,235,.14);
  color: #58a6ff;
}
.link-type-icon.file {
  background: rgba(137,87,229,.14);
  color: #c084fc;
}

.link-details {
  min-width: 0;
}

.link-short {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .25rem;
  cursor: pointer;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.link-short:hover {
  text-decoration: underline;
}

.link-original {
  display: block;
  color: var(--text-muted);
  font-size: .83rem;
  margin-bottom: .5rem;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  font-size: .78rem;
  color: var(--text-subtle);
}
.link-meta span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.link-actions {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ─── Stránkování ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 .5rem;
  border-radius: var(--radius-sm);
  font-size: .83rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.page-link:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-hover); }
.page-link.active { background: var(--primary-muted); border-color: rgba(45,140,68,.4); color: var(--accent); }
.page-link.disabled { opacity: .35; pointer-events: none; }

/* ─── Result box ───────────────────────────────────────────── */
.result-box {
  text-align: center;
  background: var(--bg-input);
  border: 1px solid rgba(45,140,68,.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  animation: slideDown .3s ease;
}
.result-url {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
  overflow-wrap: anywhere;
  margin-bottom: .5rem;
}
.result-box img {
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
  margin: .75rem auto;
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.shorten-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: -.1rem;
}
.shorten-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.shorten-tab:hover { color: var(--text); }
.shorten-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .2s ease; }

/* ─── File upload ──────────────────────────────────────────── */
.file-drop-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.file-drop-area:hover, .file-drop-area.drag-over {
  border-color: var(--accent);
  background: var(--primary-muted);
  color: var(--text);
}
.file-drop-area i { font-size: 2rem; margin-bottom: .5rem; display: block; color: var(--accent); }
.file-drop-area p { font-size: .9rem; margin-bottom: .25rem; }
.file-info { font-size: .78rem; color: var(--text-subtle); }
.file-input-hidden { display: none; }
.file-preview {
  margin-top: .75rem;
  padding: .6rem .85rem;
  background: var(--primary-muted);
  border-radius: var(--radius-md);
  font-size: .85rem;
  color: var(--accent);
}

/* ─── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: .75rem; display: block; opacity: .35; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: .35rem; color: var(--text); }
.empty-state p { font-size: .875rem; margin-bottom: 1.25rem; }

/* ─── Progress bars ────────────────────────────────────────── */
.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .65rem;
}
.progress-label {
  min-width: 80px;
  max-width: 120px;
  font-size: .82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width .5s ease;
}
.progress-value {
  min-width: 38px;
  text-align: right;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

/* ─── Grafy ────────────────────────────────────────────────── */
.chart-container {
  position: relative;
  height: clamp(180px, 28vh, 280px);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.chart-container canvas {
  image-rendering: -webkit-optimize-contrast;
  max-width: 100% !important;
}

/* ─── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  word-break: break-word;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.3rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
  margin-left: 0.75rem;
}
.modal-close:hover {
  color: var(--text);
  background: var(--bg);
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

/* ─── Countdown / redirect stránka ────────────────────────── */
.redirect-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(26,92,42,.25), transparent),
    var(--bg);
}

.redirect-container {
  width: 100%;
  max-width: 520px;
}

.redirect-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.redirect-card h2 {
  font-size: 1.3rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.target-url {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .65rem 1rem;
  font-size: .83rem;
  color: var(--text-muted);
  word-break: break-all;
  overflow-wrap: anywhere;
  margin-bottom: 1.5rem;
  text-align: left;
}

/* SVG odpočet */
.countdown-circle {
  position: relative;
  width: 110px; height: 110px;
  margin: 0 auto 1.25rem;
}
.countdown-circle svg {
  width: 110px; height: 110px;
  transform: rotate(-90deg);
}
.countdown-circle .bg-circle {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 6;
}
.countdown-circle .progress-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(56,181,96,.5));
}
.countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

/* Alternativní conic-gradient varianta */
.countdown-ring {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress, 0%), var(--bg-input) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.25rem auto;
  position: relative;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.countdown-num {
  position: absolute;
  inset: 6px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

/* Reklama na redirect stránce */
.ad-container {
  margin: 1.2rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(13, 17, 23, .75);
  padding: .75rem;
  text-align: left;
}

.ad-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .55rem;
}

.ad-slot {
  width: 100%;
  min-height: 90px;
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.ad-placeholder {
  width: 100%;
  min-height: 90px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
  padding: .75rem;
}

.ad-container.is-loading .ad-slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.06) 35%,
    rgba(255,255,255,0) 70%
  );
  animation: adShimmer 1.2s infinite;
  pointer-events: none;
}

.ad-container.ad-fallback .ad-slot {
  display: none;
}

.ad-container.ad-fallback .ad-placeholder {
  display: flex;
}

.ad-container .ad-placeholder {
  display: none;
}

.skip-link {
  margin-top: .35rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--bg-input);
  transition: all var(--transition);
}

.skip-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  color: var(--accent);
}

@keyframes adShimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ─── Inline action butony v tabulkách ─────────────────────── */
.actions-cell {
  display: flex;
  gap: .3rem;
  flex-wrap: nowrap;
}
.action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  transition: all var(--transition);
  text-decoration: none;
}
.action-btn:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--border-hover); }
.action-btn.danger:hover { background: rgba(218,54,51,.12); color: var(--red); border-color: rgba(218,54,51,.3); }
.action-btn.success:hover { background: rgba(45,140,68,.12); color: var(--green); border-color: rgba(45,140,68,.3); }

/* ─── User karta (users.php) ───────────────────────────────── */
.user-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
  transition: border-color var(--transition);
  overflow: hidden;
  min-width: 0;
}
.user-card:hover { border-color: var(--border-hover); }
.user-card > div { min-width: 0; }

.user-avatar-lg {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--primary-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Modal body (extra padding) */
.modal-body { padding: .25rem 0 .75rem; }

/* Filter bar – form groups flexibilně */
.filter-bar .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 120px;
}

/* ─── Footer ───────────────────────────────────────────────── */
.footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .78rem;
  color: var(--text-subtle);
}

/* ─── Utility ──────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .83rem; }
.text-xs    { font-size: .75rem; }
.text-primary { color: var(--text-primary); }
.text-success { color: #5dcb7e; }
.text-danger  { color: #f85149; }
.text-warning { color: #e3b341; }
.fw-600    { font-weight: 600; }
.mt-1      { margin-top: .25rem; }
.mt-2      { margin-top: .5rem; }
.mb-1      { margin-bottom: .25rem; }
.mb-3      { margin-bottom: .75rem; }
.d-flex    { display: flex; }
.gap-2     { gap: .5rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Animace ──────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ─── Responzivita ─────────────────────────────────────────── */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ──────────────────────────────────────────────────────────
   Mobil (≤ 768px) — plně přizpůsobená mobilní verze
   ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ---------- Sidebar – fullscreen overlay ---------- */
  .sidebar {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100vw;
    transform: translateX(-100%);
    box-shadow: none;
    border-right: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-header {
    padding: 1.1rem 1.25rem;
    font-size: 1.15rem;
  }
  .sidebar-header i {
    width: 40px; height: 40px;
    font-size: 1.05rem;
  }

  .nav-item {
    padding: .85rem 1.25rem;
    font-size: 1rem;
    margin: .15rem .75rem;
  }
  .nav-item i {
    width: 24px;
    font-size: 1.1rem;
  }

  .sidebar-footer {
    padding: .85rem .75rem;
  }
  .user-avatar {
    width: 40px; height: 40px;
    font-size: 1.3rem;
  }
  .user-name { font-size: .95rem; }
  .user-role { font-size: .82rem; }
  .logout-link {
    padding: .85rem 1.25rem;
    font-size: 1rem;
  }

  /* Tmavý překryv (backdrop je vytvořen JS) */
  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
  }

  /* ---------- Hlavní obsah přes celou šířku ---------- */
  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    width: 100%;
  }

  /* ---------- Top bar ---------- */
  .top-bar {
    padding: 0 1rem;
    height: 56px;
  }
  .sidebar-toggle {
    width: 44px; height: 44px;
    font-size: 1.1rem;
  }
  .page-title {
    font-size: 1rem;
    font-weight: 600;
  }
  .top-bar-actions .btn {
    padding: .5rem .85rem;
    font-size: .85rem;
  }

  /* ---------- Content area ---------- */
  .content-area {
    padding: 1rem;
  }

  /* ---------- Alerts ---------- */
  .alert {
    margin: 0 1rem .85rem;
    font-size: .9rem;
    padding: .8rem 1rem;
  }

  /* ---------- Stat cards ---------- */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
  }
  .stat-card {
    padding: .9rem 1rem;
    gap: .75rem;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .stat-icon {
    width: 40px; height: 40px;
    font-size: 1rem;
  }
  .stat-info h4 {
    font-size: .78rem;
  }
  .stat-value {
    font-size: 1.35rem;
  }

  /* ---------- Cards ---------- */
  .card {
    border-radius: var(--radius-md);
    max-height: 85vh;
  }
  .card-header {
    padding: .9rem 1rem;
    flex-wrap: wrap;
    gap: .5rem;
  }
  .card-header h3 {
    font-size: .95rem;
  }
  .card-body {
    padding: 1rem;
  }

  /* ---------- Gridy ---------- */
  .grid-2 { grid-template-columns: 1fr; gap: 1rem; }
  .grid-3 { grid-template-columns: 1fr; gap: 1rem; }

  /* ---------- Formuláře ---------- */
  .form-row  { grid-template-columns: 1fr; }
  .input-with-unit { grid-template-columns: 1fr; }

  .form-group label {
    font-size: .85rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  input[type="datetime-local"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;          /* Zabrání auto-zoomu na iOS */
    padding: .7rem .9rem;
    min-height: 44px;         /* Dostatečný touch target */
  }

  /* ---------- Toggle switch ---------- */
  .toggle-switch {
    font-size: .9rem !important;
    column-gap: .75rem;
  }
  .toggle-slider {
    width: 44px; height: 26px;
  }
  .toggle-slider::after {
    width: 20px; height: 20px;
  }
  .toggle-switch input:checked ~ .toggle-slider::after {
    transform: translateX(18px);
  }

  /* ---------- Buttons – touch-friendly ---------- */
  .btn {
    padding: .6rem 1rem;
    font-size: .9rem;
    min-height: 44px;
    border-radius: var(--radius-md);
  }
  .btn-sm {
    padding: .45rem .8rem;
    font-size: .85rem;
    min-height: 38px;
  }
  .btn-xs {
    padding: .35rem .55rem;
    font-size: .78rem;
    min-height: 34px;
  }
  .btn-group {
    gap: .5rem;
    flex-wrap: wrap;
  }
  .copy-btn {
    padding: .6rem 1rem;
    font-size: .9rem;
    min-height: 44px;
  }

  /* ---------- Badges ---------- */
  .badge {
    padding: .25rem .65rem;
    font-size: .78rem;
  }

  /* ---------- Filter bar ---------- */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
    padding: .85rem 1rem;
  }
  .filter-bar select,
  .filter-bar .form-group,
  .search-input {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    flex: none;
  }
  .filter-bar .form-group input,
  .filter-bar .form-group select {
    width: 100%;
  }

  /* ---------- Link cards ---------- */
  .bulk-actions {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
    padding: .8rem 1rem;
  }
  .bulk-counter {
    margin-left: 0;
    text-align: center;
  }
  .bulk-check {
    font-size: .9rem;
  }

  .link-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: .5rem .75rem;
    padding: 1rem;
  }
  .link-select {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
  }
  .link-checkbox {
    width: 20px;
    height: 20px;
  }
  .link-type-icon {
    display: none;        /* Skryjeme na mobilu – šetříme místo */
  }
  .link-details {
    grid-column: 2;
    grid-row: 1 / 3;
    min-width: 0;
  }
  .link-short {
    font-size: .95rem;
  }
  .link-original {
    font-size: .85rem;
  }
  .link-meta {
    font-size: .8rem;
    gap: .35rem .65rem;
  }
  .link-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
    gap: .4rem;
    flex-wrap: wrap;
  }
  .link-actions .btn,
  .link-actions .action-btn {
    min-height: 38px;
  }

  /* ---------- Tabulky ---------- */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* Tabulka bez wrapperu – přidáme scrollování přímo */
  .card-body > table,
  .content-area > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  table {
    font-size: .85rem;
  }
  th, td {
    padding: .6rem .7rem;
  }

  /* ---------- Tabs ---------- */
  .shorten-tabs {
    gap: .15rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .shorten-tabs::-webkit-scrollbar { display: none; }
  .shorten-tab {
    padding: .6rem .85rem;
    font-size: .9rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ---------- File upload ---------- */
  .file-drop-area {
    padding: 2rem 1.25rem;
  }
  .file-drop-area i {
    font-size: 1.75rem;
  }
  .file-drop-area p {
    font-size: .9rem;
  }

  /* ---------- Stránkování ---------- */
  .pagination {
    gap: .25rem;
  }
  .page-link {
    min-width: 38px; height: 38px;
    font-size: .85rem;
  }

  /* ---------- Charts ---------- */
  .chart-container {
    height: clamp(210px, 34vh, 290px);
  }

  /* ---------- Modals ---------- */
  .modal-overlay {
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
  }
  .modal-content {
    width: 100%;
    max-width: 90vw;
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }
  .modal-header {
    padding: 1.25rem;
  }
  .modal-header h3 {
    font-size: 1rem;
  }
  .modal-body {
    padding: 1.25rem;
  }
  .modal-footer {
    padding: 1rem 1.25rem;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  /* ---------- Progress bars ---------- */
  .progress-bar-wrapper {
    gap: .5rem;
  }
  .progress-label {
    min-width: 60px;
    max-width: 90px;
    font-size: .8rem;
  }

  /* ---------- Empty state ---------- */
  .empty-state {
    padding: 2.5rem 1.5rem;
  }
  .empty-state i { font-size: 2.5rem; }
  .empty-state h3 { font-size: 1.05rem; }
  .empty-state p  { font-size: .9rem; }

  /* ---------- Login ---------- */
  .login-card {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-lg);
  }
  .login-header h1 {
    font-size: 1.6rem;
  }

  /* ---------- Result box ---------- */
  .result-url {
    font-size: 1rem;
  }

  /* ---------- Redirect page ---------- */
  .redirect-card {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-lg);
  }
  .redirect-card h2 {
    font-size: 1.15rem;
  }

  /* ---------- Footer ---------- */
  .footer {
    padding: .85rem 1rem;
    font-size: .78rem;
  }

  /* ---------- User karta na mobilu ---------- */
  .user-card {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .65rem;
  }
  .user-card > div[style] {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  .user-card .btn-group {
    width: 100%;
    justify-content: flex-end;
  }
  /* Informace v user-card – statické inline styly */
  .user-card div[style*="display: flex"] {
    flex-wrap: wrap !important;
    gap: .4rem !important;
  }

  /* ---------- Actions cell ---------- */
  .actions-cell {
    gap: .4rem;
  }
  .action-btn {
    width: 36px; height: 36px;
    font-size: .85rem;
  }
}

/* Animace pro mobilní modal (slide up od spodu) */
@keyframes slideUpMobile {
  from { opacity: 0; transform: translateY(40%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Extra malé displeje (≤ 420px) */
@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: .6rem;
  }
  .stat-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  .top-bar-actions .btn span {
    display: none;       /* Na velmi malém displeji schováme text "Nový odkaz" */
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  .chart-container {
    height: clamp(190px, 32vh, 250px);
  }
  .card-header .btn-group,
  .card-header .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Modal na velmi malých displejích */
  .modal-content {
    max-height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
  .modal-header {
    padding: 1rem;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-footer {
    padding: 0.75rem 1rem;
  }
}

/* Tisk */
@media print {
  .sidebar, .top-bar, .filter-bar, .pagination, .actions-cell { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
