/* ============================================
   TSB App Shell
   Shared internal-page layout primitives
   ============================================ */

.tsb-app-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top center, rgba(77, 171, 154, 0.08), transparent 34%),
        radial-gradient(circle at 85% 10%, rgba(91, 196, 176, 0.05), transparent 26%),
        var(--bg-void);
    color: var(--text-primary);
}

.app-shell-main {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px 16px 32px;
}

.app-shell-content {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.app-shell-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
        radial-gradient(circle at top right, rgba(77, 171, 154, 0.14), transparent 34%);
    box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.app-shell-copy {
    min-width: 0;
    max-width: 860px;
}

.app-shell-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 8px;
    margin-bottom: 16px;
    border-radius: 999px;
    border: 1px solid rgba(77, 171, 154, 0.18);
    background: linear-gradient(135deg, rgba(77, 171, 154, 0.16), rgba(77, 171, 154, 0.05));
    color: var(--accent-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-shell-kicker--expert {
    border-color: rgba(99, 102, 241, 0.22);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.05));
    color: #a5b4fc;
}

.app-shell-kicker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: currentColor;
}

.app-shell-kicker-icon i {
    width: 13px;
    height: 13px;
}

.app-shell-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.app-shell-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.app-shell-meta i {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.app-shell-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.app-shell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-shell-badge--expert {
    border-color: rgba(99, 102, 241, 0.24);
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
}

.app-shell-badge--core {
    border-color: rgba(77, 171, 154, 0.2);
    background: rgba(77, 171, 154, 0.12);
    color: var(--accent-secondary);
}

@media (max-width: 1024px) {
    .app-shell-hero {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .app-shell-main {
        padding: 16px 16px 24px;
    }

    .app-shell-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 20px;
        border-radius: 20px;
    }

    .app-shell-actions {
        justify-content: flex-start;
    }
}

/* ============================================
   Base Reset & Body
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Glass Cards
   ============================================ */
.glass-card {
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md, 12px);
    transition: border-color var(--duration-normal, 0.2s) var(--ease-out, ease);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.accent-card {
    background: linear-gradient(135deg, rgba(77, 171, 154, 0.08) 0%, rgba(77, 171, 154, 0.02) 100%);
    border: 1px solid rgba(77, 171, 154, 0.15);
}

.danger-card {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #4DAB9A, #5BC4B0);
    color: #050507;
    box-shadow: 0 4px 20px rgba(77, 171, 154, 0.25);
    transition: all 0.2s var(--ease-out, ease);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(77, 171, 154, 0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm, 8px);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transition: all 0.2s var(--ease-out, ease);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm, 8px);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    transition: all 0.2s var(--ease-out, ease);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

/* ============================================
   Form Elements
   ============================================ */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm, 8px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent, #4DAB9A);
    box-shadow: 0 0 0 3px rgba(77, 171, 154, 0.1);
    outline: none;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c5c66' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-input[type="date"] {
    color-scheme: dark;
}

.form-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.78) brightness(0.92);
    opacity: 0.92;
    cursor: pointer;
}

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary, #0b0b0b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    animation: modalEnter 0.3s var(--ease-out, ease);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalEnter {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================
   Toast / Notification
   ============================================ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: rgba(77, 171, 154, 0.9); }
.toast-error { background: rgba(239, 68, 68, 0.9); }

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   Color Utilities
   ============================================ */
.text-green, .text-profit { color: var(--green); }
.text-red, .text-loss { color: var(--red); }
.text-muted { color: var(--text-secondary); }

/* Ambient glow — defined in style.css (includes sidebar offset + .expert variant) */
