:root {
    --bg: #fafbfc;
    --panel: #ffffff;
    --ink: #242b36;
    --muted: #516074;
    --line: #e2e8f0;
    --white:#ffffff;
    --blue: #137fec;
    --accent: #242b36;
    --accent-hover: #000000;

    --danger: #ef4444;
    --danger-hover: #922626;

    --ok: #207344;

    --shadow: 0;
    --radius: 0;

    --font:
        'Figtree',
        Helvetica,
        Arial,
        sans-serif;
}

/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    outline: none !important;
    border-radius: 0 !important;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);

    font:
        16px/1.45 var(--font);

    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* =========================================================
   LAYOUT
========================================================= */

.wrap {
    display: block;
    position: relative;
    margin: 20px auto;
}

.login-wrap {
    width: min(420px, calc(100% - 32px));
    margin: 12vh auto;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin:0;
}


.card {
    background: var(--panel);
    border: 1px solid var(--line);
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

h1 {
margin: 0;
  font-size: 26px;
}

h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.sub {
    color: var(--muted);
    margin: 0;
}

.label {
    color: var(--muted);
    margin-top: 4px;
}

.muted {
    color: var(--muted);
}

/* =========================================================
   BUTTONS
========================================================= */

.btn {
    border: 0;
    background: var(--accent);
    color: white;

    padding: 12px 18px;
font-size: 14px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    transition:
        background .15s ease,
        opacity .15s ease;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn.secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn.secondary:hover {
    background: #f5f7fa;
}

.btn.danger {
    background: var(--danger);
    border: 1px solid var(--danger);
}

.btn.danger:hover {
    background: var(--danger-hover);
     border: 1px solid var(--danger-hover);
}

.btn.small {
    padding: 9px 12px;
    font-size: 14px;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 15px;

}

.link-card {
    background: white;
    border: 1px solid var(--line);
    padding: 15px;
}

.link-card-top {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.link-card-title {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding-right: 35px;
}

.link-card-count {
  position: static;
  display: block;
  margin: 0;
}

h5 {
  font-size: 16px;
  margin: 0;
  display: block;
}



.link-card .actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.link-card .actions .btn,
.link-card .actions form {
    width: 100%;
}

.link-card .actions .btn {
    justify-content: center;
}

@media (max-width: 600px) {
    .link-grid {
        grid-template-columns: auto;
        
    }

.wrap {
  display: block;
  position: relative;
  margin: 20px auto;
}


}

.link-card-grid {
  display: grid;
  grid-template-columns: 12px auto;
  gap: 5px;
  align-items: center;
  justify-content: start;
}

.click-icon {
width: 12px;
  height: 12px;
  display: block;
  margin: -1px 0 0 0;
}

.click-icon img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

.inner {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}


/* =========================================================
   FORMS
========================================================= */

form {
    margin: 0;
}

.field {
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 3px;
  font-size: 15px;
    font-weight: 700;

}

input,
textarea,
select {
    width: 100%;

    border: 1px solid var(--line);
    background: white;

    padding: 13px 14px;

    color: var(--ink);

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #94a3b8;
}

input.is-valid {
    border-color: var(--ok);
    box-shadow: 0 0 0 3px rgba(32, 115, 68, .12);
}

input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(173, 47, 47, .12);
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.hint.ok {
    color: var(--ok);
}

.hint.bad {
    color: var(--danger);
}

/* =========================================================
   MESSAGES
========================================================= */

.msg {
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid;
}

.msg.error {
    background: #fff1f1;
    color: #7a1f1f;
    border-color: #efc3c3;
}

.msg.success {
    background: #effaf3;
    color: #145c34;
    border-color: #b8e2c7;
}

/* =========================================================
   TABLES
========================================================= */

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;

    color: var(--muted);
    font-size: 13px;

    padding: 10px;

    border-bottom: 1px solid var(--line);
}

td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   URLS / DATA
========================================================= */

.code {
  position: relative;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: -3px 0 0 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  overflow: visible;
}

.code:hover {
  color: var(--ink);
}

.tooltip-box {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);

    min-width: 220px;
    max-width: 320px;
    padding: 10px 12px;

    background: var(--ink);
    color: var(--white);

    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;

    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);

    transition:
        opacity .15s ease,
        transform .15s ease,
        visibility .15s ease;

    pointer-events: none;
    z-index: 50;

    overflow-wrap: anywhere;
    white-space: normal;

    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.tooltip-box::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 100%;

    width: 10px;
    height: 10px;

    background: var(--ink);
    transform: rotate(45deg);
}

.code:hover .tooltip-box,
.code:focus .tooltip-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}






.clip {
    max-width: 320px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ua {
    max-width: 360px;

    color: var(--muted);
    font-size: 12px;

    overflow-wrap: anywhere;
}

.clicks {
 
  font-size: 13px;
   font-weight: 700;
}

.last {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
    display: none;
}

/* =========================================================
   ACTIONS
========================================================= */

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}


.actions img {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0;
}

.link-card .actions .btn {
 padding: 8px;
}


/* =========================================================
   QR
========================================================= */

.qr-thumb {
    width: 65px;
    height: auto;

    border: 1px solid var(--line);
    background: white;

    padding: 5px;

    cursor: zoom-in;
}

/* =========================================================
   EMPTY STATES
========================================================= */

.empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
}

/* =========================================================
   MODALS
========================================================= */

.modal,
.lightbox {
    display: none;

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,.52);

    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 1000;
}

.modal.open,
.lightbox.open {
    display: flex;
}

.modal-card {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);

    overflow: auto;

    background: var(--panel);
    border: 1px solid var(--line);

    padding: 20px;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 15px;
}

.modal-head h2 {
    font-size: 22px;
}

.x {
    border: 0;
    background: transparent;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 18px;
}

/* =========================================================
   LIGHTBOX
========================================================= */

.lightbox img {
    width: min(520px, 90vw);

    background: white;

    padding: 20px;
}

/* =========================================================
   ANALYTICS
========================================================= */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;

    margin-bottom: 18px;
}


.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;

    margin-bottom: 18px;
}

.card {
    padding: 20px;
}

.big {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.scroll {
    overflow-x: auto;
}

/* =========================================================
   LOGOS
========================================================= */

.main-logo {
    width: 40px;
    height: auto;
    margin: 0;
}

.log-logo {
    width: 50px;
    height: auto;
    margin: 0 auto 30px auto;
}

.main-logo img,
.log-logo img {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================================================
   MOBILE
========================================================= */

.mobile-card-list {
    display: none;
}

@media (max-width: 1000px) {

    .panel .actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }

    .panel .actions .btn,
   .panel  .actions form {
        width: 100%;
    }

    .panel .actions .btn {
        justify-content: center;
    }

    .panel .actions form .btn {
        width: 100%;
    }

}



@media (max-width: 900px) {

    .desktop-table {
        display: none;
    }

    .mobile-card-list {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .link-card {
        background: white;
        border: 1px solid var(--line);
        padding: 14px;
    }

    .link-card-top {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        margin-bottom: 15px;
    }


    table {
        min-width: 760px;
    }

 .kpi-grid,
    .grid {
        grid-template-columns: 1fr;
    }

    .ua {
        max-width: 220px;
    }
}


@media (max-width: 600px) {


}


@media (max-width: 500px) {


}

.btn.danger {
  background: var(--danger);
  border: 1px solid var(--danger);
  position: absolute;
  top: 0;
  right: 0;
}


.btn.small.danger img {
  width: 12px;
  height: 12px;
  display: block;
  margin: 0;
}

.btn.small.danger {
    padding: 5px;
}

.dash-intro-block {
    position: relative;
    display: block;
    margin: 0 0 20px 0;
}

.dash-intro-block h1 {
    display: block;
    margin: 0 0 3px 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    text-transform: capitalize;
}


header {
    position: relative;
    display: block;
  margin: 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

@media (max-width: 900px) {
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 15px;
}
}

@media (max-width: 360px) {
.link-card-count {
  display: block;
}
}