/* ===== Buttons ===== */

.btn,
.btn-secondary,
.btn-ghost,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn {
    color: #fff;
    background-image: linear-gradient(180deg, #ff8f33, #ff7700);
    border-color: #e06a00;
    box-shadow: 0 1px 2px rgba(234, 88, 12, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn:hover {
    background-image: linear-gradient(180deg, #ffa355, #ff8517);
    box-shadow: 0 6px 16px -8px rgba(234, 88, 12, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}


.btn-secondary {
    color: #0f172a;
    background-color: #fff;
    background-image: none;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    background-image: none;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.25);
}

.btn-ghost {
    color: #475569;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
}

.btn-ghost:hover {
    color: #0f172a;
    background-color: rgba(15, 23, 42, 0.06);
    background-image: none;
}

.btn-danger {
    color: #fff;
    background-image: linear-gradient(180deg, #ef4444, #dc2626);
    border-color: rgba(185, 28, 28, 0.9);
    box-shadow: 0 1px 2px rgba(127, 29, 29, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-danger:hover {
    background-image: linear-gradient(180deg, #f87171, #ef4444);
    box-shadow: 0 6px 16px -8px rgba(185, 28, 28, 0.55);
    transform: translateY(-1px);
}

.btn-success {
    color: #fff;
    background-image: linear-gradient(180deg, #10b981, #059669);
    border-color: rgba(4, 120, 87, 0.9);
    box-shadow: 0 1px 2px rgba(6, 78, 59, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-success:hover {
    background-image: linear-gradient(180deg, #34d399, #10b981);
    box-shadow: 0 6px 16px -8px rgba(6, 78, 59, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-warning {
    color: #78350f;
    background-image: linear-gradient(180deg, #fbbf24, #f59e0b);
    border-color: rgba(180, 83, 9, 0.6);
    box-shadow: 0 1px 2px rgba(120, 53, 15, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-warning:hover {
    background-image: linear-gradient(180deg, #fcd34d, #fbbf24);
    box-shadow: 0 6px 16px -8px rgba(120, 53, 15, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(180, 70, 0, 0.5);
}

.bg-brand {
    background-image: linear-gradient(180deg, #ff8f33, #ff7700);
    color: #fff;
}

.bg-brand:hover {
    background-image: linear-gradient(180deg, #ffa355, #ff8517);
}

.btn:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-success:focus-visible,
.btn-warning:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.btn-sm {
    padding: 0.375rem 1.125rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    gap: 0.375rem;
}

.btn:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled,
.btn-success:disabled,
.btn-warning:disabled,
.btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* ===== Video (YouTube embed chrome) ===== */

.yt-frame {
    position: relative;
    overflow: hidden;
}

.yt-frame__video {
    position: absolute;
    top: -3.5rem;
    left: 0;
    width: 100%;
    height: calc(100% + 3.5rem);
}

/* ===== Cards ===== */

.card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -28px rgba(15, 23, 42, 0.25);
}

.card-interactive {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card-interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(203, 213, 225, 0.9);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 24px 48px -28px rgba(15, 23, 42, 0.35);
}

.panel {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -28px rgba(15, 23, 42, 0.25);
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.card-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

/* ===== Alerts ===== */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-left-width: 4px;
}

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    border-left-color: #10b981;
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #ef4444;
    color: #991b1b;
}

.alert-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    border-left-color: #0ea5e9;
    color: #075985;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    border-left-color: #f59e0b;
    color: #92400e;
}

/* ===== Forms ===== */

.field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.375rem;
}

.field-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #64748b;
}

.field-error {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #dc2626;
}

input.input,
select.input,
textarea.input {
    display: block;
    width: 100%;
    border-radius: 0.625rem;
    border: 1px solid #cbd5e1;
    background-color: #fff;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.input::placeholder,
textarea.input::placeholder {
    color: #94a3b8;
}

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

input.input:focus,
select.input:focus,
textarea.input:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
}

select.input {
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
}

textarea.input {
    min-height: 6rem;
    resize: vertical;
}

input.input[type="file"] {
    padding: 0.5rem;
    background-color: #f8fafc;
    border-style: dashed;
    border-color: #cbd5e1;
}

input.input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
    cursor: pointer;
}

input.input:disabled,
select.input:disabled,
textarea.input:disabled {
    background-color: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.input-error {
    border-color: #fca5a5 !important;
}

.input-error:focus,
input.input-error:focus,
select.input-error:focus,
textarea.input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

input[type="checkbox"].switch {
    appearance: none;
    width: 2.5rem;
    height: 1.375rem;
    border-radius: 9999px;
    background-color: #e2e8f0;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    border: 0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}

input[type="checkbox"].switch::after {
    content: "";
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
    transition: transform 0.2s ease;
}

input[type="checkbox"].switch:checked {
    background-color: #0f172a;
    box-shadow: none;
}

input[type="checkbox"].switch:checked::after {
    transform: translateX(1.125rem);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1.25rem;
    margin-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* ===== Data tables ===== */

.table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

:where(.table th) {
    text-align: left;
}

.table tbody td {
    padding: 1rem 1.25rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

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

.table tfoot td {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

/* ===== Misc ===== */

.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1100px) {
    .dash-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dash-stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background-image: linear-gradient(135deg, #0ea5e9, #10b981);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
