/* Stock Sentinel — minimal dashboard styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f6f8;
    color: #1f2933;
    line-height: 1.55;
}

/* --- Header / Nav --- */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.9rem 1.5rem;
}

.site-nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: #0f172a;
}

.brand-mark {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.18rem;
    padding: 0.45rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-bar {
    display: block;
    width: 0.32rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #7dd3fc, #38bdf8);
}

.brand-bar-short {
    height: 0.75rem;
}

.brand-bar-medium {
    height: 1rem;
}

.brand-bar-tall {
    height: 1.25rem;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.brand-name {
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-tagline {
    font-size: 0.72rem;
    color: #52606d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Main --- */

main {
    max-width: 1100px;
    margin: 2rem auto 2.5rem;
    padding: 0 1.5rem;
}

/* Full-bleed variant — used by splash and other edge-to-edge layouts */
main.main--full-bleed {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3 {
    color: #0f172a;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.8rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.page-header-compact {
    margin-bottom: 1.25rem;
}

.page-eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a73e8;
}

.page-subtitle {
    max-width: 34rem;
    color: #52606d;
    font-size: 0.95rem;
}

/* --- Summary cards --- */

.summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.summary-card {
    flex: 1;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.1rem;
    text-align: center;
    min-width: 10rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.summary-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.summary-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-sell  .summary-count { color: #d32f2f; }
.summary-trim  .summary-count { color: #e6a000; }
.summary-hold  .summary-count { color: #388e3c; }

/* --- Table --- */

.positions-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.positions-table th,
.positions-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.positions-table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #52606d;
}

.table-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
    color: #111;
}

.table-sort-indicator {
    min-width: 0.7rem;
    color: #1a73e8;
}

.positions-table tbody tr:hover {
    background: #f8fbff;
}

.ticker {
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* --- Verdict badges --- */

.verdict {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.verdict-sell { background: #fde8e8; border-color: #f6caca; color: #c62828; }
.verdict-trim { background: #fff8e1; border-color: #f1de9c; color: #9a6700; }
.verdict-hold { background: #e8f5e9; border-color: #b7ddbb; color: #2e7d32; }

/* --- Gain / loss coloring --- */

.gain-positive { color: #388e3c; font-weight: 600; }
.gain-negative { color: #d32f2f; font-weight: 600; }

/* --- Rule tags --- */

.reason {
    max-width: 220px;
    position: relative;
    padding-left: 0.8rem;
}

.reason::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2rem;
    bottom: 0.2rem;
    width: 3px;
    border-radius: 999px;
    background: #d9e2ec;
}

.rule-tag {
    display: block;
    padding: 0;
    border-radius: 0;
    font-size: 0.76rem;
    margin: 0;
    color: #334155;
    line-height: 1.4;
}

.rule-tag + .rule-tag {
    margin-top: 0.35rem;
}

.rule-tag::before {
    content: "•";
    display: inline-block;
    width: 0.75rem;
    color: #94a3b8;
}

/* --- Actions --- */

.actions {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

/* --- Buttons --- */

.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover {
    background: #f0f0f0;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-danger {
    color: #d32f2f;
    border-color: #d32f2f;
}

.btn-danger:hover {
    background: #fde8e8;
}

.btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}

.btn-busy {
    opacity: 0.8;
    pointer-events: none;
}

.btn-busy::before {
    content: "";
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.35rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.1rem;
    animation: spinner-rotate 0.8s linear infinite;
}

/* --- Forms --- */

.position-form {
    max-width: 480px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.form-legend {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.required-indicator {
    color: #d32f2f;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* --- Empty state --- */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #52606d;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.empty-state-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: #e8f1fd;
    color: #1a73e8;
    font-size: 1.3rem;
    font-weight: 700;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    color: #0f172a;
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* --- Refresh controls --- */

.refresh-controls {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.refresh-banner {
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    background: #f0f3f7;
    color: #445;
    border: 1px solid #d5dde8;
    border-radius: 8px;
    font-size: 0.85rem;
}

.text-muted {
    color: #888;
    font-size: 0.85rem;
}

.text-muted code {
    background: #f0f0f0;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* --- Market data indicator --- */

.market-source {
    color: #388e3c;
    font-size: 0.6rem;
    vertical-align: super;
    cursor: help;
}

/* --- Error rule tag --- */

.rule-tag-error {
    color: #c62828;
    font-weight: 600;
    cursor: help;
}

.rule-tag-error::before {
    color: #ef9a9a;
}

.rule-tag-refreshing {
    color: #4a5568;
    font-weight: 600;
}

.rule-tag-refreshing::before {
    color: #a0aec0;
}

/* --- Form hint text --- */

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #888;
}

.ticker-lookup-price {
    color: #445;
    font-weight: 600;
}

.ticker-lookup-picker {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d5dde8;
    border-radius: 4px;
    background: #f8fafc;
}

.ticker-lookup-picker[hidden] {
    display: none;
}

.ticker-lookup-picker-title {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.ticker-lookup-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticker-lookup-option {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.ticker-lookup-option:hover,
.ticker-lookup-option:focus-visible {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
    outline: none;
}

.ticker-lookup-option-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: #64748b;
}

/* --- Read-only inputs --- */

.form-group input[readonly] {
    background: #f5f6f8;
    color: #666;
}

/* --- Edit form position identity --- */

.position-identity {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    background: #f5f6f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.position-identity .ticker {
    font-size: 1.1rem;
}

.position-identity .company-name {
    font-size: 0.9rem;
    color: #666;
}

/* --- Rules page --- */

.rules-section {
    margin-top: 1.5rem;
}

.rules-section h3 {
    margin: 0;
    font-size: 1rem;
}

.rules-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.rules-section-toggle:hover {
    color: #0b5cab;
}

.rules-section-chevron {
    display: inline-block;
    width: 1rem;
}

.rules-section-content {
    margin-top: 0.65rem;
}

.rules-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

/* --- MA Conditions --- */

.ma-conditions-cell {
    padding: 0.5rem 1rem 1rem 1rem;
    background: #f9fafb;
    border-top: none;
}

.ma-conditions {
    max-width: 600px;
}

.ma-help {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.ma-conditions-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.ma-conditions-table th,
.ma-conditions-table td {
    padding: 0.35rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.ma-conditions-table th {
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
}

.ma-add-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.ma-add-form select,
.ma-add-form input[type="number"] {
    padding: 0.25rem 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
}

.ma-add-form input[type="number"] {
    width: 5rem;
}

.ma-conditions-table .btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
}

.ma-conditions-table .btn-danger:hover {
    background: #c82333;
}

@media (max-width: 720px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-user {
    color: #52606d;
    font-size: 0.9rem;
    font-weight: 600;
}

.login-page {
    display: flex;
    justify-content: center;
    padding-top: 3rem;
}

.login-card {
    width: 100%;
    max-width: 28rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-subtitle {
    margin-top: 0.5rem;
    color: #52606d;
}

.login-providers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-login {
    justify-content: center;
}

.login-error {
    margin-top: 1rem;
    color: #c62828;
    font-weight: 600;
}

.alert {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.alert-warning {
    background: #fff8e1;
    border-color: #f1de9c;
    color: #7c5d00;
}

/* --- Splash / landing page --- */

.splash {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Hero — dark full-width band */
.splash-hero {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 100%);
    text-align: center;
    padding: 5rem 1.5rem 4.5rem;
}

.splash-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7dd3fc;
    margin-bottom: 1rem;
}

.splash-headline {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #f0f6ff;
    line-height: 1.08;
    margin-bottom: 1.25rem;
}

.splash-sub {
    max-width: 34rem;
    margin: 0 auto 2.25rem;
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.7;
}

.splash-sub strong {
    color: #cbd5e1;
}

/* Verdict badges shown in hero */
.splash-verdicts {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.splash-verdicts .verdict {
    font-size: 0.85rem;
    padding: 0.4rem 1.1rem;
    letter-spacing: 0.06em;
}

/* Features grid */
.splash-features {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 3.5rem 1.5rem;
}

.splash-feature {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 3px solid #1a73e8;
    border-radius: 10px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.splash-feature-icon {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #1a73e8;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.splash-feature-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.6rem;
}

.splash-feature-body {
    font-size: 0.9rem;
    color: #52606d;
    line-height: 1.65;
}

.splash-disclaimer {
    background: #f8fafc;
    border-top: 1px solid #e8ecf0;
    text-align: center;
    padding: 1.25rem 1.5rem;
    font-size: 0.82rem;
    color: #8898aa;
}
