:root {
    --sh-background: #ffffff;
    --sh-foreground: #09090b;
    --sh-card: #ffffff;
    --sh-card-foreground: #09090b;
    --sh-popover: #ffffff;
    --sh-popover-foreground: #09090b;
    --sh-primary: #18181b;
    --sh-primary-foreground: #fafafa;
    --sh-secondary: #f4f4f5;
    --sh-secondary-foreground: #18181b;
    --sh-muted: #f4f4f5;
    --sh-muted-foreground: #71717a;
    --sh-accent: #f4f4f5;
    --sh-accent-foreground: #18181b;
    --sh-destructive: #ef4444;
    --sh-destructive-foreground: #fafafa;
    --sh-success: #10b981;
    --sh-success-foreground: #fafafa;
    --sh-warning: #f59e0b;
    --sh-border: #e4e4e7;
    --sh-input: #e4e4e7;
    --sh-ring: #18181b;
    --sh-radius: 0.375rem;
    --sh-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sh-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.sh-body {
    font-family: var(--sh-font);
    background: #fafafa;
    color: var(--sh-foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: 100dvh;
}

.sh-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    min-height: 100dvh;
}

.sh-card {
    background: var(--sh-card);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
}

.sh-card-ghost {
    background: transparent;
    border: 1px dashed var(--sh-border);
    border-radius: var(--sh-radius);
}

.sh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sh-border);
}

.sh-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sh-header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sh-foreground);
    letter-spacing: -0.01em;
}

.sh-header-desc {
    font-size: 0.75rem;
    color: var(--sh-muted-foreground);
    margin-top: 0.125rem;
}

.sh-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    color: var(--sh-muted-foreground);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sh-back-btn:hover {
    background: var(--sh-accent);
    color: var(--sh-foreground);
}

.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--sh-radius);
    font-family: var(--sh-font);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sh-btn:focus-visible {
    outline: 2px solid var(--sh-ring);
    outline-offset: 2px;
}

.sh-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sh-btn-default {
    background: var(--sh-primary);
    color: var(--sh-primary-foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.sh-btn-default:hover {
    background: #27272a;
}

.sh-btn-secondary {
    background: var(--sh-secondary);
    color: var(--sh-secondary-foreground);
}

.sh-btn-secondary:hover {
    background: #e4e4e7;
}

.sh-btn-outline {
    background: transparent;
    color: var(--sh-foreground);
    border-color: var(--sh-input);
}

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

.sh-btn-ghost {
    background: transparent;
    color: var(--sh-foreground);
}

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

.sh-btn-destructive {
    background: var(--sh-destructive);
    color: var(--sh-destructive-foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.sh-btn-destructive:hover {
    background: #dc2626;
}

.sh-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    height: 32px;
}

.sh-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    height: 44px;
}

.sh-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.sh-btn-full {
    width: 100%;
}

.sh-input {
    width: 100%;
    height: 36px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--sh-input);
    border-radius: var(--sh-radius);
    font-family: var(--sh-font);
    font-size: 0.875rem;
    color: var(--sh-foreground);
    background: var(--sh-background);
    outline: none;
    transition: all 0.15s ease;
    -webkit-appearance: none;
}

.sh-input:focus {
    border-color: var(--sh-ring);
    box-shadow: 0 0 0 2px rgb(24 24 27 / 0.08);
}

.sh-input::placeholder {
            color: var(--sh-muted-foreground);
}

.sh-input-lg {
    height: 44px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.sh-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sh-foreground);
    margin-bottom: 0.375rem;
}

.sh-description {
    font-size: 0.8125rem;
    color: var(--sh-muted-foreground);
    line-height: 1.5;
}

.sh-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.sh-badge-default {
    background: var(--sh-primary);
    color: var(--sh-primary-foreground);
}

.sh-badge-secondary {
    background: var(--sh-secondary);
    color: var(--sh-secondary-foreground);
}

.sh-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.sh-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.sh-badge-destructive {
    background: #fee2e2;
    color: #991b1b;
}

.sh-separator {
    height: 1px;
    background: var(--sh-border);
    width: 100%;
    margin: 1rem 0;
}

.sh-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.sh-stat-card {
    background: var(--sh-card);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 1rem;
}

.sh-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.sh-stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--sh-muted-foreground);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sh-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--sh-border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.sh-tab {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sh-muted-foreground);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: var(--sh-font);
}

.sh-tab:hover {
    color: var(--sh-foreground);
}

.sh-tab-active {
    color: var(--sh-foreground);
    border-bottom-color: var(--sh-primary);
}

.sh-segment {
    display: flex;
    background: var(--sh-secondary);
    border-radius: var(--sh-radius);
    padding: 3px;
    gap: 2px;
}

.sh-segment-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sh-muted-foreground);
    background: transparent;
    border: none;
    border-radius: calc(var(--sh-radius) - 2px);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--sh-font);
}

.sh-segment-btn:hover {
    color: var(--sh-foreground);
}

.sh-segment-btn-active {
    background: var(--sh-card);
    color: var(--sh-foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.08);
}

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

.sh-table-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--sh-border);
    margin-bottom: 0.5rem;
}

.sh-table-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
    border-radius: var(--sh-radius);
    cursor: pointer;
    transition: background 0.1s ease;
}

.sh-table-row:hover {
    background: var(--sh-accent);
}

.sh-table-cell-main {
    flex: 1;
    min-width: 0;
}

.sh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sh-modal-overlay.active {
    display: flex;
}

.sh-modal {
    background: var(--sh-card);
    border: 1px solid var(--sh-border);
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.sh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sh-border);
}

.sh-modal-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sh-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--sh-radius);
    color: var(--sh-muted-foreground);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sh-modal-close:hover {
    background: var(--sh-accent);
    color: var(--sh-foreground);
}

.sh-modal-body {
    padding: 1.25rem;
}

.sh-modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sh-border);
}

.sh-form-group {
    margin-bottom: 1rem;
}

.sh-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.sh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sh-border);
}

.sh-pagination-info {
    font-size: 0.75rem;
    color: var(--sh-muted-foreground);
}

.sh-logout {
    font-size: 0.8125rem;
    color: var(--sh-muted-foreground);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.sh-logout:hover {
    color: var(--sh-destructive);
}

.sh-avatar {
    width: 32px;
    height: 32px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: var(--sh-mono);
    flex-shrink: 0;
}

.sh-avatar-success {
    background: #d1fae5;
    color: #065f46;
}

.sh-avatar-muted {
    background: var(--sh-secondary);
    color: var(--sh-muted-foreground);
}

.sh-danger-zone {
    border-color: #fecaca;
}

.sh-danger-zone .sh-zone-title {
    color: var(--sh-destructive);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sh-inline-code {
    font-family: var(--sh-mono);
    font-size: 0.8125rem;
    background: var(--sh-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.sh-login-card {
    background: var(--sh-card);
    border: 1px solid var(--sh-border);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.04);
    padding: 2rem;
}

.sh-login-icon {
    width: 40px;
    height: 40px;
    background: var(--sh-secondary);
    border-radius: var(--sh-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--sh-foreground);
}

@media (min-width: 640px) {
    .sh-page {
        padding: 2rem;
    }

    .sh-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
