/* ==========================================================================
   Keenthemes Metronic (Tailwind) — theme stylesheet
   Self-contained kt-* component classes. Semantic colors come from the
   CSS custom properties defined in resources/css/app.css (var(--...)),
   with graceful fallbacks so the file also works standalone.
   ========================================================================== */

:root {
    --kt-card-radius: 0.75rem;
    --kt-input-height: 2.125rem; /* 34px */
    --kt-btn-height: 2.125rem;   /* 34px */
    --kt-gold: rgba(242, 194, 0, 0.25);
}

/* ----------------------------------------------------------------
   Card
   ---------------------------------------------------------------- */
.kt-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: var(--kt-card-radius);
    background-color: var(--card, #ffffff);
    border: 1px solid var(--border, #e4e4e7);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.kt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0;
}

.kt-card-body {
    padding: 1.25rem;
}

.kt-card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground, #09090b);
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.kt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: var(--kt-btn-height);
    padding: 0 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary, #3b82f6);
    color: var(--primary-foreground, #ffffff);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.kt-btn:hover {
    background-color: color-mix(in srgb, var(--primary, #3b82f6) 88%, black);
    color: var(--primary-foreground, #ffffff);
}

.kt-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring, #a1a1aa) 35%, transparent);
}

.kt-btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

.kt-btn-outline {
    background-color: transparent;
    border-color: var(--primary, #3b82f6);
    color: var(--primary, #3b82f6);
}

.kt-btn-outline:hover {
    background-color: color-mix(in srgb, var(--primary, #3b82f6) 10%, transparent);
    color: var(--primary, #3b82f6);
}

.dark .kt-btn-outline {
    border-color: var(--kt-gold);
    color: var(--foreground, #fafafa);
}

.dark .kt-btn-outline:hover {
    background-color: color-mix(in srgb, var(--kt-gold) 35%, transparent);
    color: var(--foreground, #fafafa);
}

.kt-btn-ghost {
    background-color: transparent;
    border-color: transparent;
    color: var(--muted-foreground, #71717a);
}

.kt-btn-ghost:hover {
    background-color: var(--accent, #f4f4f5);
    color: var(--foreground, #09090b);
}

.kt-btn-icon {
    width: var(--kt-btn-height);
    padding: 0;
}

.kt-btn-icon i,
.kt-btn i {
    font-size: 1rem;
}

.kt-btn-sm {
    height: 1.75rem;
    padding: 0 0.625rem;
    font-size: 0.75rem;
}

.kt-btn-lg {
    height: 2.75rem;
    padding: 0 1.25rem;
    font-size: 0.875rem;
}

/* ----------------------------------------------------------------
   Form inputs
   ---------------------------------------------------------------- */
.kt-input,
select.kt-input,
textarea.kt-input {
    display: block;
    width: 100%;
    height: var(--kt-input-height);
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--input, #e4e4e7);
    background-color: var(--background, #ffffff);
    color: var(--foreground, #09090b);
    font-size: 0.8125rem;
    line-height: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.kt-input {
    height: auto;
    min-height: calc(var(--kt-input-height) * 2.5);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    line-height: 1.5;
    resize: vertical;
}

select.kt-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2371717a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
}

.kt-input::placeholder {
    color: var(--muted-foreground, #71717a);
}

.kt-input:focus {
    outline: none;
    border-color: var(--ring, #a1a1aa);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring, #a1a1aa) 25%, transparent);
}

.kt-input:disabled {
    opacity: 0.55;
}

/* ----------------------------------------------------------------
   Switch
   ---------------------------------------------------------------- */
.kt-switch {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.375rem;
    cursor: pointer;
    flex-shrink: 0;
}

.kt-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.kt-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background-color: var(--muted, #f4f4f5);
    border: 1px solid var(--border, #e4e4e7);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kt-switch-slider::before {
    content: '';
    position: absolute;
    height: 0.875rem;
    width: 0.875rem;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.kt-switch input:checked + .kt-switch-slider {
    background-color: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
}

.kt-switch input:checked + .kt-switch-slider::before {
    transform: translateY(-50%) translateX(1.125rem);
}

.kt-switch input:focus-visible + .kt-switch-slider {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring, #a1a1aa) 35%, transparent);
}

/* ----------------------------------------------------------------
   Table
   ---------------------------------------------------------------- */
.kt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    color: var(--foreground, #09090b);
}

.kt-table-border {
    border: 1px solid var(--border, #e4e4e7);
    border-radius: var(--kt-card-radius);
    overflow: hidden;
}

.kt-table thead .kt-table-col {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    color: var(--muted-foreground, #71717a);
    background-color: var(--muted, #f4f4f5);
    border-bottom: 1px solid var(--border, #e4e4e7);
    white-space: nowrap;
}

.kt-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border, #e4e4e7);
}

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

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

.kt-table tbody tr:hover {
    background-color: var(--accent, #f4f4f5);
}

.kt-table-col[data-kt-datatable-column] {
    cursor: pointer;
    user-select: none;
}

/* ----------------------------------------------------------------
   Badge
   ---------------------------------------------------------------- */
.kt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.kt-badge-sm {
    padding: 0.25rem 0.45rem;
    font-size: 0.6875rem;
}

.kt-badge-primary {
    background-color: color-mix(in srgb, var(--primary, #3b82f6) 15%, transparent);
    color: var(--primary, #3b82f6);
}

.kt-badge-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.kt-badge-warning {
    background-color: rgba(250, 204, 21, 0.15);
    color: #facc15;
}

.kt-badge-info {
    background-color: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.kt-badge-destructive {
    background-color: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

/* ----------------------------------------------------------------
   Avatar
   ---------------------------------------------------------------- */
.kt-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.475rem;
    overflow: visible;
    background-color: var(--accent, #f4f4f5);
    color: var(--foreground, #09090b);
    font-weight: 600;
}

.kt-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.kt-avatar-circle {
    border-radius: 50%;
}

/* ----------------------------------------------------------------
   Menu (sidebar)
   ---------------------------------------------------------------- */
.kt-menu {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.kt-menu-section {
    padding: 0.75rem 0.75rem 0.375rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    color: var(--muted-foreground, #71717a);
}

.kt-menu-item {
    display: flex;
    flex-direction: column;
}

.kt-menu-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    color: var(--muted-foreground, #71717a);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kt-menu-link:hover {
    background-color: var(--accent, #f4f4f5);
    color: var(--foreground, #09090b);
}

.kt-menu-link .kt-menu-title {
    flex-grow: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground, #09090b);
}

.kt-menu-link > .ki-filled {
    font-size: 1rem;
    color: var(--muted-foreground, #71717a);
    flex-shrink: 0;
}

.kt-menu-link .kt-menu-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--muted-foreground, #71717a);
}

.kt-menu-item-accordion .kt-menu-arrow .ki-minus {
    display: none;
}

.kt-menu-item-accordion.open .kt-menu-arrow .ki-plus {
    display: none;
}

.kt-menu-item-accordion.open .kt-menu-arrow .ki-minus {
    display: inline-block;
}

.kt-menu-sub {
    display: none;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.25rem 0 0.25rem 1.75rem;
}

.kt-menu-item-accordion.open > .kt-menu-sub {
    display: flex;
}

.kt-menu-sub .kt-menu-link {
    padding: 0.5rem 0.75rem;
}

.kt-menu-sub .kt-menu-link::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary, #3b82f6);
    flex-shrink: 0;
}

.kt-menu-sub .kt-menu-link .kt-menu-title {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--foreground, #09090b);
}

.kt-menu-link.active,
.kt-menu-sub .kt-menu-link.active {
    background-color: color-mix(in srgb, var(--accent, #f4f4f5) 60%, transparent);
    color: var(--primary, #3b82f6);
    border-radius: 0.5rem;
}

.kt-menu-link.active .kt-menu-title,
.kt-menu-sub .kt-menu-link.active .kt-menu-title {
    color: var(--primary, #3b82f6);
    font-weight: 600;
}

.dark .kt-menu-link.active,
.dark .kt-menu-sub .kt-menu-link.active {
    border-color: var(--border, var(--kt-gold));
}

/* ----------------------------------------------------------------
   Dropdown
   ---------------------------------------------------------------- */
.kt-dropdown {
    position: relative;
}

.kt-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 250px;
    padding: 0.5rem;
    border-radius: var(--kt-card-radius);
    background-color: var(--card, #ffffff);
    border: 1px solid var(--border, #e4e4e7);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    z-index: 60;
    display: none;
}

.kt-dropdown.open > .kt-dropdown-menu {
    display: block;
}

.kt-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--foreground, #09090b);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.kt-dropdown-item:hover {
    background-color: var(--accent, #f4f4f5);
}

.kt-dropdown-item .ki-filled {
    font-size: 1rem;
    color: var(--muted-foreground, #71717a);
}

.kt-dropdown-header {
    padding: 0.5rem 0.75rem 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e4e4e7);
}

.kt-dropdown-separator {
    height: 1px;
    margin: 0.5rem 0;
    background-color: var(--border, #e4e4e7);
}

/* ----------------------------------------------------------------
   Scrollbar
   ---------------------------------------------------------------- */
.kt-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary, #f4f4f5) transparent;
}

.kt-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.kt-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.kt-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--secondary, #f4f4f5);
    border-radius: 9999px;
}

.kt-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: var(--muted-foreground, #71717a);
}

/* ----------------------------------------------------------------
   Additional button components
   ---------------------------------------------------------------- */
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--primary, #3b82f6);
    background-color: transparent;
    color: var(--primary, #3b82f6);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dark .primary-button {
    color: #ffffff;
    border-color: var(--kt-gold);
}

.primary-button:hover {
    background-color: color-mix(in srgb, var(--primary, #3b82f6) 10%, transparent);
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.danger-button:hover {
    background-color: #b91c1c;
}
