/* KMHockey Tips Manager v0.6.1 */

.kmh-tips {
    max-width: 980px;
    margin: 0 auto;
}

.kmh-tips__intro,
.kmh-tips-form,
.kmh-tips-message {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(6, 21, 47, 0.12);
}

.kmh-tips__intro {
    padding: clamp(24px, 4vw, 38px);
    margin-bottom: 24px;
    border-left: 7px solid #4b00e8;
}

.kmh-tips__intro h2 {
    margin: 0 0 14px;
    color: #06152f;
    font-size: clamp(32px, 5vw, 54px);
    line-height: .96;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.kmh-tips__intro p:last-child {
    margin-bottom: 0;
}

.kmh-tips-message {
    padding: 16px 20px;
    margin-bottom: 20px;
    font-weight: 900;
}

.kmh-tips-message--success {
    border-left: 7px solid #16a34a;
    color: #14532d;
}

.kmh-tips-message--error {
    border-left: 7px solid #dc2626;
    color: #7f1d1d;
}

.kmh-tips-form {
    padding: clamp(22px, 4vw, 34px);
}

.kmh-tips-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.kmh-tips-form p {
    margin: 0 0 18px;
}

.kmh-tips-form label {
    display: block;
    margin-bottom: 7px;
    color: #06152f;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.kmh-tips-form label span {
    color: #4b00e8;
}

.kmh-tips-form input,
.kmh-tips-form select,
.kmh-tips-form textarea {
    width: 100%;
    border: 1px solid #d9e0ea;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    padding: 12px 14px;
    font-size: 16px;
}

.kmh-tips-form input,
.kmh-tips-form select {
    min-height: 46px;
}

.kmh-tips-form textarea {
    resize: vertical;
}

.kmh-tips-form input:focus,
.kmh-tips-form select:focus,
.kmh-tips-form textarea:focus {
    outline: 3px solid rgba(75, 0, 232, .18);
    border-color: #4b00e8;
}

.kmh-tips-form button {
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #4b00e8;
    color: #fff;
    padding: 12px 24px;
    font-weight: 900;
    cursor: pointer;
}

.kmh-tips-form button:hover {
    background: #06152f;
}

.kmh-tips-privacy {
    color: #64748b;
    font-size: 14px;
}

.kmh-tips-hp {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* Admin – KH VERKTYG designstandard */
.kmh-tips-admin {
    --kh-navy: #071a33;
    --kh-navy-2: #0d2a50;
    --kh-blue: #2271b1;
    --kh-purple: #5b2ee6;
    --kh-border: #dce3ed;
    --kh-muted: #64748b;
    --kh-surface: #ffffff;
    --kh-soft: #f5f7fb;
    max-width: 1580px;
}

.kmh-tips-admin *,
.kmh-tips-admin *::before,
.kmh-tips-admin *::after {
    box-sizing: border-box;
}

.kmh-tips-admin .notice {
    margin: 16px 0;
}

.kh-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    margin: 18px 0 0;
    padding: 28px 30px;
    border-radius: 18px 18px 0 0;
    background:
        radial-gradient(circle at 90% 0, rgba(91, 46, 230, .32), transparent 34%),
        linear-gradient(135deg, var(--kh-navy), var(--kh-navy-2));
    color: #fff;
    box-shadow: 0 16px 34px rgba(7, 26, 51, .18);
}

.kh-tool-eyebrow,
.kmh-admin-kicker {
    margin: 0 0 7px;
    color: #a9c9ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.kh-tool-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.05;
    letter-spacing: -.03em;
}

.kh-tool-header__content > p:last-child {
    max-width: 760px;
    margin: 10px 0 0;
    color: #d8e6f8;
    font-size: 15px;
}

.kh-tool-header__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 9px;
    min-width: 300px;
}

.kh-tool-version {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 800;
    letter-spacing: .03em;
}

.kh-tool-header .button {
    min-height: 36px;
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    box-shadow: none;
}

.kh-tool-header .button:hover,
.kh-tool-header .button:focus {
    border-color: #fff;
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.kh-tool-header .button-primary {
    border-color: #fff;
    background: #fff;
    color: var(--kh-navy);
}

.kh-tool-header .button-primary:hover,
.kh-tool-header .button-primary:focus {
    background: #eaf2ff;
    color: var(--kh-navy);
}

.kh-tool-nav {
    position: sticky;
    top: 32px;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 18px;
    padding: 8px 12px;
    border: 1px solid var(--kh-border);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 20px rgba(7, 26, 51, .08);
    backdrop-filter: blur(9px);
}

.kh-tool-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--kh-navy);
    font-weight: 700;
    text-decoration: none;
}

.kh-tool-nav a:hover,
.kh-tool-nav a:focus {
    background: #eaf2ff;
    color: #135e96;
}

.kh-tool-section {
    scroll-margin-top: 92px;
    margin-bottom: 18px;
}

.kh-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kh-stat-card,
.kmh-tips-admin-main,
.kmh-tips-side-card {
    border: 1px solid var(--kh-border);
    border-radius: 14px;
    background: var(--kh-surface);
    box-shadow: 0 10px 25px rgba(7, 26, 51, .07);
}

.kh-stat-card {
    position: relative;
    min-height: 126px;
    padding: 18px;
    overflow: hidden;
}

.kh-stat-card::after {
    position: absolute;
    right: -18px;
    bottom: -28px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #edf3fb;
    content: "";
}

.kh-stat-card--accent {
    border-color: #bfdbfe;
    background: linear-gradient(145deg, #fff, #eef6ff);
}

.kh-stat-card__label {
    display: block;
    position: relative;
    z-index: 1;
    color: var(--kh-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.kh-stat-card strong {
    display: block;
    position: relative;
    z-index: 1;
    margin: 7px 0 4px;
    color: var(--kh-navy);
    font-size: 34px;
    line-height: 1;
}

.kh-stat-card > span:last-child {
    position: relative;
    z-index: 1;
    color: var(--kh-muted);
}

.kmh-tips-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 18px;
    align-items: start;
    scroll-margin-top: 92px;
}

.kmh-tips-admin-main,
.kmh-tips-side-card {
    padding: 20px;
}

.kmh-tips-admin-main {
    min-width: 0;
}

.kmh-tips-admin-side {
    display: grid;
    gap: 18px;
    scroll-margin-top: 92px;
}

.kmh-tips-side-card {
    scroll-margin-top: 92px;
}

.kmh-tips-admin-side > .kmh-tips-side-card:first-child {
    position: sticky;
    top: 88px;
    z-index: 10;
}

.kmh-tips-side-card h2 {
    margin: 0 0 8px;
    color: var(--kh-navy);
    font-size: 24px;
    line-height: 1.15;
}

.kmh-admin-kicker {
    color: var(--kh-purple);
}

.kmh-tips-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.kmh-status-pill {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #d5deea;
    border-radius: 999px;
    background: var(--kh-soft);
    color: var(--kh-navy);
    text-decoration: none;
    font-weight: 800;
}

.kmh-status-pill:hover,
.kmh-status-pill:focus {
    border-color: #9bbbe0;
    background: #edf5ff;
    color: #135e96;
}

.kmh-status-pill span {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    text-align: center;
}

.kmh-status-pill.is-active {
    border-color: var(--kh-purple);
    background: var(--kh-purple);
    color: #fff;
}

.kmh-status-pill.is-active span {
    background: rgba(255, 255, 255, .22);
}

.kmh-tips-search {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.kmh-tips-search input[type="search"] {
    flex: 1;
    min-height: 38px;
    border-color: #cbd5e1;
    border-radius: 8px;
}

.kmh-tips-table {
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--kh-border);
}

.kmh-tips-table thead th {
    border-bottom: 1px solid #d7dfeb;
    background: #eef3f9;
    color: var(--kh-navy);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.kmh-tips-table td {
    vertical-align: middle;
}

.kmh-tips-table td span {
    color: var(--kh-muted);
}

.kmh-tips-table tbody tr:hover td {
    background: #f7fbff;
}

.kmh-tip-status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.kmh-tip-status--new { background: #dbeafe; color: #1e3a8a; }
.kmh-tip-status--reading { background: #fef3c7; color: #92400e; }
.kmh-tip-status--used { background: #dcfce7; color: #166534; }
.kmh-tip-status--archived { background: #f1f5f9; color: #475569; }

.kmh-tip-message-full {
    margin: 14px 0;
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.55;
    white-space: normal;
}

.kmh-tip-admin-inline {
    margin: 15px 0;
    padding-top: 14px;
    border-top: 1px solid #e5eaf1;
}

.kmh-tip-admin-inline label,
.kmh-tips-side-card label {
    display: block;
    margin: 10px 0 6px;
    color: var(--kh-navy);
    font-weight: 800;
}

.kmh-tip-admin-inline select,
.kmh-tip-admin-inline textarea,
.kmh-tips-side-card input[type="email"],
.kmh-tips-side-card textarea {
    width: 100%;
    border-color: #cbd5e1;
    border-radius: 8px;
}

.kmh-tip-admin-inline textarea,
.kmh-tips-side-card textarea {
    min-height: 96px;
}

.kmh-tip-admin-meta {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.kmh-checkbox-row {
    display: flex !important;
    gap: 8px;
    align-items: center;
    font-weight: 700 !important;
}

.kmh-checkbox-row input {
    width: auto;
}

.kmh-tips-admin .button {
    border-radius: 7px;
}

.kmh-tips-admin .button-primary {
    background: var(--kh-blue);
    border-color: var(--kh-blue);
}

.kmh-tips-admin code {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 6px;
    background: #edf2f7;
}

@media (max-width: 1180px) {
    .kh-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kmh-tips-admin-grid {
        grid-template-columns: 1fr;
    }

    .kmh-tips-admin-side > .kmh-tips-side-card:first-child {
        position: static;
    }
}

@media (max-width: 782px) {
    .kh-tool-nav {
        top: 46px;
    }

    .kh-tool-header {
        display: block;
        padding: 22px;
    }

    .kh-tool-header__actions {
        justify-content: flex-start;
        min-width: 0;
        margin-top: 18px;
    }
}

@media (max-width: 720px) {
    .kmh-tips-grid,
    .kh-stat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .kh-tool-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kh-tool-nav a {
        justify-content: center;
        border: 1px solid #e2e8f0;
    }

    .kmh-tips-search {
        display: grid;
    }

    .kmh-tips-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .kh-tool-header__actions {
        display: grid;
    }

    .kh-tool-header__actions .button,
    .kh-tool-version {
        justify-content: center;
        width: 100%;
    }
}
