/* ============================================
   LinkShort - Tema & Genel
   ============================================ */
   :root {
    --primary:        #4f46e5;
    --primary-d:      #4338ca;
    --bg:             #f7f8fb;
    --panel:          #ffffff;
    --panel-2:        #f3f4f6;
    --text:           #1f2937;
    --muted:          #6b7280;
    --border:         #e5e7eb;
    --shadow:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg:      0 10px 25px rgba(0,0,0,0.10), 0 4px 6px rgba(0,0,0,0.05);
    --radius:         10px;
    --radius-sm:      6px;
    --success:        #10b981;
    --danger:         #ef4444;
    --warning:        #f59e0b;
    --info:           #3b82f6;
    --secondary:      #9ca3af;
  }
  
  [data-theme="dark"] {
    --primary:        #6366f1;
    --primary-d:      #4f46e5;
    --bg:             #0f172a;
    --panel:          #1e293b;
    --panel-2:        #334155;
    --text:           #f1f5f9;
    --muted:          #94a3b8;
    --border:         #334155;
    --shadow:         0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg:      0 10px 30px rgba(0,0,0,0.5);
  }
  
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
  }
  a { color: var(--primary); text-decoration: none; }
  a:hover { text-decoration: underline; }
  code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }
  .muted { color: var(--muted); }
  .small { font-size: 0.85em; }
  .hidden { display: none !important; }
  .inline { display: inline-block; }
  .req { color: var(--danger); }
  .empty { text-align: center; color: var(--muted); padding: 1.5rem; font-style: italic; }
  .truncate { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  
  /* ============================================
     Layout (Admin + User panel)
     ============================================ */
  .topbar {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem 1.2rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
  }
  .menu-toggle {
    display: none;
    background: transparent; border: none; color: var(--text);
    font-size: 1.5rem; cursor: pointer;
  }
  .brand {
    font-weight: 700; font-size: 1.1rem; color: var(--text);
  }
  .brand:hover { text-decoration: none; }
  .brand-tag {
    font-size: 0.7rem; background: var(--primary); color: #fff;
    padding: 2px 8px; border-radius: 12px; margin-left: 4px; vertical-align: middle;
  }
  .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; }
  .user-name { color: var(--muted); font-weight: 500; }
  .icon-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text); width: 36px; height: 36px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 1rem;
  }
  .icon-btn:hover { background: var(--panel-2); }
  
  .layout { display: flex; min-height: calc(100vh - 60px); }
  .sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--panel); border-right: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky; top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.7rem 1.2rem; color: var(--text);
    border-left: 3px solid transparent; transition: all 0.15s;
  }
  .side-nav a:hover { background: var(--panel-2); text-decoration: none; }
  .side-nav a.active {
    background: var(--panel-2); border-left-color: var(--primary);
    color: var(--primary); font-weight: 600;
  }
  .side-nav .ico { font-size: 1.1rem; width: 1.5rem; text-align: center; }
  .side-divider {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); padding: 1rem 1.2rem 0.4rem; font-weight: 600;
  }
  .content { flex: 1; padding: 1.5rem; max-width: 100%; overflow-x: auto; }
  
  /* ============================================
     Page header
     ============================================ */
  .page-title { font-size: 1.6rem; margin: 0 0 1.2rem; font-weight: 700; }
  .page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.2rem; gap: 1rem; flex-wrap: wrap;
  }
  .page-head .page-title { margin: 0; }
  
  /* ============================================
     Panel (kart)
     ============================================ */
  .panel {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow);
  }
  .panel h3 { margin: 0 0 0.9rem; font-size: 1rem; font-weight: 600; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  
  /* ============================================
     Form elemanları
     ============================================ */
  label { display: block; margin: 0.6rem 0 0.3rem; font-weight: 500; font-size: 0.85rem; color: var(--text); }
  input, select, textarea {
    width: 100%; padding: 0.55rem 0.7rem;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.9rem; font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  }
  input[type="checkbox"], input[type="radio"] { width: auto; margin: 0; }
  textarea { resize: vertical; min-height: 70px; font-family: inherit; }
  input:disabled, select:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
  
  .form-create { max-width: 760px; }
  .form-actions { margin-top: 1.4rem; }
  .section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 1.2rem 0 0.5rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
  }
  .section-head h3 { margin: 0; font-size: 0.95rem; }
  
  .radio-row { display: flex; gap: 1rem; padding: 0.5rem 0; }
  .radio-row label { margin: 0; display: flex; gap: 0.4rem; align-items: center; cursor: pointer; }
  .geo-row { margin-bottom: 0.5rem; }
  
  /* Switch */
  .switch {
    display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none;
    margin: 0;
  }
  .switch input { display: none; }
  .switch span:last-child { font-size: 0.85rem; color: var(--muted); }
  .switch::before {
    content: ""; width: 38px; height: 22px;
    background: var(--secondary); border-radius: 11px;
    position: relative; transition: background 0.2s;
    flex-shrink: 0;
  }
  .switch::after {
    content: ""; position: absolute; left: 2px;
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    margin-top: 2px; transition: transform 0.2s;
  }
  .switch:has(input:checked)::before { background: var(--primary); }
  .switch:has(input:checked)::after { transform: translateX(16px); }
  
  /* Checkbox grid (domain seçimi vs.) */
  .check-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem; margin: 0.5rem 0;
  }
  .check-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    background: var(--panel-2); border-radius: var(--radius-sm);
    cursor: pointer; margin: 0;
  }
  .check-item input { margin: 0; }
  
  /* ============================================
     Buton
     ============================================ */
  .btn {
    display: inline-block; padding: 0.55rem 1rem;
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.9rem; font-family: inherit; font-weight: 500;
    text-decoration: none; transition: all 0.15s; text-align: center;
  }
  .btn:hover { background: var(--border); text-decoration: none; }
  .btn-primary {
    background: var(--primary); color: #fff; border-color: var(--primary);
  }
  .btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
  .btn-danger {
    background: var(--danger); color: #fff; border-color: var(--danger);
  }
  .btn-danger:hover { filter: brightness(0.9); color: #fff; }
  .btn-ghost {
    background: transparent; border-color: var(--border);
  }
  .btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
  .btn-xs { padding: 0.25rem 0.55rem; font-size: 0.78rem; }
  .btn-lg { padding: 0.85rem 1.6rem; font-size: 1rem; }
  .btn-block { width: 100%; display: block; }
  
  /* ============================================
     Tablo
     ============================================ */
  .data-table {
    width: 100%; border-collapse: collapse; font-size: 0.88rem;
  }
  .data-table th, .data-table td {
    padding: 0.65rem 0.7rem; text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  .data-table th {
    background: var(--panel-2); color: var(--muted);
    font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
  }
  .data-table tr:hover td { background: rgba(99, 102, 241, 0.04); }
  [data-theme="dark"] .data-table tr:hover td { background: rgba(99, 102, 241, 0.08); }
  .data-table .actions { white-space: nowrap; display: flex; gap: 4px; flex-wrap: wrap; }
  .data-table .actions form { display: inline; margin: 0; }
  .table-links td:nth-child(3) { max-width: 280px; }
  
  /* ============================================
     Badge
     ============================================ */
  .badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 12px; font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .badge-success   { background: rgba(16,185,129,0.15);  color: var(--success); }
  .badge-danger    { background: rgba(239,68,68,0.15);   color: var(--danger); }
  .badge-info      { background: rgba(59,130,246,0.15);  color: var(--info); }
  .badge-secondary { background: rgba(156,163,175,0.18); color: var(--muted); }
  .badge-warning   { background: rgba(245,158,11,0.18);  color: var(--warning); }
  
  /* ============================================
     Alert
     ============================================ */
  .alert {
    padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    margin-bottom: 1rem; border: 1px solid transparent;
    font-size: 0.9rem;
  }
  .alert-success { background: rgba(16,185,129,0.10); color: var(--success); border-color: rgba(16,185,129,0.3); }
  .alert-danger  { background: rgba(239,68,68,0.10);  color: var(--danger);  border-color: rgba(239,68,68,0.3); }
  .alert-info    { background: rgba(59,130,246,0.10); color: var(--info);    border-color: rgba(59,130,246,0.3); }
  
  /* ============================================
     Stats grid
     ============================================ */
  .stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem; margin-bottom: 1.2rem;
  }
  .stat-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.2rem;
    box-shadow: var(--shadow);
  }
  .stat-label {
    font-size: 0.75rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  }
  .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--text); margin-top: 0.3rem; }
  .stat-warn { border-left: 3px solid var(--warning); }
  .stat-warn .stat-value { color: var(--warning); }
  
  /* ============================================
     Bar chart
     ============================================ */
  .bar-chart {
    display: flex; align-items: flex-end;
    gap: 4px; height: 140px;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  }
  .bar-chart-tall { height: 220px; }
  .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
  .bar {
    width: 100%; max-width: 36px; min-height: 2px;
    background: linear-gradient(to top, var(--primary), var(--primary-d));
    border-radius: 4px 4px 0 0; transition: filter 0.15s;
  }
  .bar:hover { filter: brightness(1.2); }
  .bar-label { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
  .bar-value { font-size: 0.7rem; color: var(--text); font-weight: 600; }
  
  /* ============================================
     Filter bar / bulk bar / pagination / tabs
     ============================================ */
  .filter-bar {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--border);
    padding: 0.7rem; border-radius: var(--radius); margin-bottom: 1rem;
    box-shadow: var(--shadow); align-items: center;
  }
  .filter-bar input, .filter-bar select { width: auto; min-width: 140px; flex: 1 1 140px; max-width: 240px; }
  
  .bulk-bar {
    display: flex; gap: 0.5rem; align-items: center;
    background: var(--primary); color: #fff;
    padding: 0.6rem 1rem; border-radius: var(--radius);
    margin-bottom: 0.8rem;
  }
  .bulk-bar select, .bulk-bar .btn {
    background: rgba(255,255,255,0.2); color: #fff; border-color: rgba(255,255,255,0.3);
  }
  .bulk-bar .btn-ghost { background: transparent; }
  
  .pagination { display: flex; gap: 4px; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
  .pagination a {
    display: inline-block; padding: 6px 12px; min-width: 36px; text-align: center;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-weight: 500;
  }
  .pagination a:hover { background: var(--panel-2); text-decoration: none; }
  .pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
  
  .tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    margin-bottom: 1rem; flex-wrap: wrap;
  }
  .tabs a {
    padding: 0.7rem 1.2rem; color: var(--muted);
    border-bottom: 2px solid transparent; font-weight: 500;
  }
  .tabs a:hover { color: var(--text); text-decoration: none; }
  .tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
  
  /* ============================================
     Modal
     ============================================ */
  .modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1000;
    align-items: center; justify-content: center;
    padding: 1rem; overflow-y: auto;
  }
  .modal.open { display: flex; }
  .modal-box {
    background: var(--panel); color: var(--text);
    border-radius: var(--radius); padding: 1.5rem;
    width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
  }
  .modal-wide { max-width: 680px; }
  .modal-box h3 { margin-top: 0; font-size: 1.1rem; }
  .modal-actions {
    display: flex; gap: 0.5rem; justify-content: flex-end;
    margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
  }
  
  /* ============================================
     Copy button
     ============================================ */
  .copy-btn {
    background: transparent; border: none; cursor: pointer; padding: 2px 4px;
    font-size: 0.95rem; opacity: 0.55; transition: opacity 0.15s;
  }
  .copy-btn:hover { opacity: 1; }
  .copy-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--text); color: var(--bg); padding: 0.6rem 1.3rem;
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    z-index: 5000; font-weight: 500; opacity: 0; transition: opacity 0.25s;
  }
  .copy-toast.show { opacity: 1; }
  
  /* ============================================
     Auth (login) page
     ============================================ */
  .auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: var(--bg);
  }
  .auth-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 2rem; width: 100%; max-width: 380px;
  }
  .auth-title { margin: 0 0 0.4rem; font-size: 1.5rem; text-align: center; font-weight: 700; }
  .auth-sub { margin: 0 0 1.4rem; color: var(--muted); text-align: center; }
  .auth-footer { text-align: center; margin-top: 1rem; color: var(--muted); font-size: 0.85rem; }
  
  /* ============================================
     Status pages (404, inactive)
     ============================================ */
  .status-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: var(--bg);
  }
  .status-card {
    text-align: center; max-width: 460px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2.5rem 2rem; box-shadow: var(--shadow);
  }
  .status-icon { font-size: 4rem; margin-bottom: 0.4rem; }
  .status-card h1 { margin: 0.4rem 0 0.6rem; font-size: 1.5rem; }
  .status-card p { color: var(--muted); margin-bottom: 1.4rem; }
  .status-meta { color: var(--muted); font-size: 0.8rem; margin: 0.8rem 0 1.4rem; font-family: monospace; }
  
  /* ============================================
     Quick actions / domain list
     ============================================ */
  .quick-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
  .domain-list { list-style: none; padding: 0; margin: 0.7rem 0; }
  .domain-list li {
    padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.6rem;
  }
  .domain-list li:last-child { border-bottom: none; }
  
  /* ============================================
     Mobile
     ============================================ */
  @media (max-width: 880px) {
    .menu-toggle { display: inline-block; }
    .sidebar {
      position: fixed; left: 0; top: 60px;
      transform: translateX(-100%); transition: transform 0.25s;
      z-index: 90; width: 240px; height: calc(100vh - 60px);
      box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .grid-2 { grid-template-columns: 1fr; }
    .data-table { font-size: 0.82rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.4rem; }
    .truncate { max-width: 160px; }
    .content { padding: 1rem; }
    .page-title { font-size: 1.3rem; }
    .stat-value { font-size: 1.4rem; }
    .filter-bar input, .filter-bar select { min-width: 100%; max-width: 100%; flex: 1 1 100%; }
  }
  @media (max-width: 480px) {
    .topbar { padding: 0.6rem 0.8rem; gap: 0.5rem; }
    .user-name { display: none; }
    .data-table .actions { flex-direction: column; }
  }