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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.auth-container {
    max-width: 400px;
    margin-top: 4rem;
    text-align: center;
}

h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; color: #555; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

header nav { display: flex; gap: 1rem; align-items: center; }
header nav a { color: #0066cc; text-decoration: none; }
header nav a:hover { text-decoration: underline; }

/* Forms */
form { text-align: left; }
label { display: block; margin-top: 1rem; font-weight: 600; font-size: 0.9rem; }
input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
}
input:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 2px rgba(0,102,204,0.2); }

button, .btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 1rem;
}
button:hover, .btn:hover { background: #0055aa; }

.btn-secondary { background: #666; }
.btn-secondary:hover { background: #555; }
.btn-danger { background: #cc3333; }
.btn-danger:hover { background: #aa2222; }
.btn-small { padding: 0.3rem 0.8rem; font-size: 0.85rem; margin-top: 0; }
.btn-primary { background: #0066cc; }

/* Alerts */
.alert { padding: 0.75rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fde8e8; color: #c33; border: 1px solid #f5c6c6; }
.alert-success { background: #e8fde8; color: #363; border: 1px solid #c6f5c6; }

.auth-link { margin-top: 1.5rem; font-size: 0.9rem; }
.auth-link a { color: #0066cc; }

/* Search */
.search-section { position: relative; margin-bottom: 2rem; }
.search-section label { font-size: 1rem; margin-bottom: 0.5rem; }
#search { font-size: 1.1rem; padding: 0.8rem; }

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
}
.suggestions:empty { display: none; }
.suggestion { padding: 0.5rem 0.8rem; cursor: pointer; }
.suggestion:hover { background: #e8f0fe; }

/* Ticker detail */
.ticker-detail { margin-top: 1rem; }
.file-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.file-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
}
.file-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.file-card p { font-size: 0.9rem; color: #666; }
.date-range { font-size: 0.8rem; color: #999; }
.download-buttons { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.download-buttons .btn { margin-top: 0; padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid #ddd; font-size: 0.9rem; }
th { background: #f9f9f9; font-weight: 600; }

section { margin-bottom: 2rem; }

/* Search status */
.search-status { font-size: 0.85rem; margin-top: 0.4rem; min-height: 1.2em; }
.search-status:empty { display: none; }
.search-status-loading { color: #666; }
.search-status-loading::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid #999; border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 0.4rem; vertical-align: middle; }
.search-status-success { color: #4a8; }
.search-status-empty { color: #888; }
.search-status-error { color: #c33; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-indicator { color: #666; }
.loading-indicator::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid #999; border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 0.4rem; vertical-align: middle; }

/* Save status banner */
.save-banner { padding: 0.75rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; background: #e8fde8; color: #363; border: 1px solid #c6f5c6; }
input[type="number"] { width: 100%; padding: 0.6rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; margin-top: 0.25rem; }
input[type="number"]:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 2px rgba(0,102,204,0.2); }
