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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0f0f13;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Auth Gate */
#auth-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-box {
    text-align: center;
    padding: 2.5rem;
    background: #1a1a24;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: 320px;
}

.auth-box h2 {
    margin-bottom: 1.5rem;
    font-weight: 400;
    font-size: 1.4rem;
    color: #ccc;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#auth-form input {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #12121a;
    color: #e0e0e0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#auth-form input:focus {
    border-color: #00d4aa;
}

#auth-form button {
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    background: #00d4aa;
    color: #0f0f13;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#auth-form button:hover {
    opacity: 0.85;
}

.error {
    color: #ff6b6b;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* Dashboard Layout */
#dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

header h1 {
    font-size: 1.6rem;
    font-weight: 400;
    color: #ccc;
}

#logout-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s, border-color 0.2s;
}

#logout-btn:hover {
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

section {
    margin-bottom: 2.5rem;
}

section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin-bottom: 0;
}

/* Card Grid (Web Apps) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    display: block;
    padding: 1.25rem;
    background: #1a1a24;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.15s;
}

.card:hover {
    border-color: #00d4aa;
    transform: translateY(-2px);
}

.card .card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 0.3rem;
}

.card .card-desc {
    font-size: 0.85rem;
    color: #888;
}

.card-grid-empty {
    color: #555;
    font-style: italic;
    padding: 1rem 0;
}

/* Quick Links */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: #1a1a24;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.link-item a {
    color: #00d4aa;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-item a:hover {
    text-decoration: underline;
}

.link-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.link-actions button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.link-actions button:hover {
    color: #e0e0e0;
}

.link-list-empty {
    color: #555;
    font-style: italic;
}

/* Inline Form */
.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.inline-form input {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #12121a;
    color: #e0e0e0;
    font-size: 0.9rem;
    outline: none;
    flex: 1;
    min-width: 120px;
}

.inline-form input:focus {
    border-color: #00d4aa;
}

/* Buttons */
.btn-small {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a24;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-small:hover {
    border-color: #00d4aa;
    color: #00d4aa;
}

.btn-muted {
    color: #666;
}

.btn-muted:hover {
    color: #aaa;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Stock Widget */
#stock-widget {
    background: #1a1a24;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    min-height: 200px;
}

/* Responsive */
@media (max-width: 600px) {
    #dashboard {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        flex-direction: column;
    }
}
