/* Admin styles for trainer section - Light and Dark themes */

:root {
    /* Light theme */
    --bg: #f7f8fb;
    --card: #ffffff;
    --fg: #0f172a;
    --muted: #6b7280;
    --bd: #e5e7eb;
    --brand: #1f6feb;
    --brand-2: #22c55e;
    --brand-3: #f59e0b;
    --ring: rgba(31, 111, 235, .35);
    --shadow: 0 8px 24px rgba(2, 6, 23, .06);
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #7f1d1d;
    --white: #ffffff;
    --black: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark theme */
        --bg: #0b0f14;
        --card: #0f172a;
        --fg: #e5e7eb;
        --muted: #9aa4b2;
        --bd: #1f2937;
        --ring: rgba(99, 102, 241, .35);
        --shadow: 0 8px 24px rgba(0, 0, 0, .45);
        --success-bg: #064e3b;
        --success-border: #065f46;
        --success-text: #a7f3d0;
        --error-bg: #7f1d1d;
        --error-border: #dc2626;
        --error-text: #fecaca;
        --white: #ffffff;
        --black: #000000;
    }
}

/* Layout */
.t-wrap {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px;
}

.t-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.t-title {
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 700;
    color: var(--graphite);
}

.t-sub {
    color: var(--muted);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card h3 {
    margin: 0 0 12px 0;
    color: #222223;
    font-size: 18px;
    font-weight: 600;
}

/* Grid layouts */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 860px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.col {
    flex: 1 1 260px;
    min-width: 240px;
}

/* Form elements */
.label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.input,
.select,
.file {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: transparent;
    color: var(--fg);
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--ring);
}


/* Notices */
.notice {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.notice.ok {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.notice.err {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--fg);
}

.table th,
.table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--bd);
    vertical-align: middle;
    text-align: left;
}

.table th {
    font-weight: 600;
    color: var(--fg);
    font-size: 14px;
}

.table td {
    font-size: 14px;
}

/* Badges */
.badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--bd);
    color: var(--muted);
    background: var(--card);
}

/* Avatar */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bd);
    display: grid;
    place-items: center;
}

/* Logo preview */
.logo-preview {
    width: 120px;
    height: 120px;
    background: var(--bd);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Key-value pairs */
.kv {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
}

.kv .k {
    color: var(--muted);
    font-size: 14px;
}

/* Dividers */
.hr {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .35), transparent);
    margin: 18px 0;
}

/* Date styling */
.date {
    color: var(--muted);
    font-size: 12px;
}

/* Tile grid for dashboard */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(10px, 2vw, 18px);
}

@media (max-width: 760px) {
    .tile-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.tile {
    grid-column: span 4;
    background: var(--card);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    padding: clamp(16px, 2.4vw, 22px);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(2, 6, 23, .12);
    border-color: rgba(148, 163, 184, .35);
}

.tile:focus-within {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.tile .top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(31, 111, 235, .1);
}

.icon svg {
    width: 22px;
    height: 22px;
}

.tile h3 {
    margin: 0;
    font-size: 18px;
    color: var(--fg);
}

.tile p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}


.tile .badge {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #0b1220;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
}

@media (prefers-color-scheme: dark) {
    .tile .badge {
        color: #e5e7eb;
        background: #0b1220;
        border: 1px solid #1f2937;
    }
}

/* Trainer shell */
.trainer-shell {
    min-height: 60vh;
    padding: clamp(16px, 3vw, 28px);
}

.trainer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.trainer-title {
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 700;
    color: var(--fg);
}

.trainer-sub {
    color: var(--muted);
    font-size: 14px;
}

.logout a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border-color 0.15s ease;
}

.logout a:hover {
    border-color: rgba(148, 163, 184, .4);
}

/* Utility classes for white and black colors */
.text-white {
    color: var(--white) !important;
}

.text-black {
    color: var(--black) !important;
}

.bg-white {
    background-color: var(--white) !important;
}

.bg-black {
    background-color: var(--black) !important;
}

.border-white {
    border-color: var(--white) !important;
}

.border-black {
    border-color: var(--black) !important;
}