body {
    font-family: "Inter", sans-serif;
    background: #f8fafc;
    margin: 0;
    color: #222;
}
.navbar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
}
.navbar a { text-decoration: none; color: #0077cc; margin: 0 10px; }
.hero {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, #e6f2ff, #ffffff);
}
.hero h1 { font-size: 2.5rem; margin-bottom: 15px; }
.container {
    max-width: 1000px;
    margin: auto;
    padding: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.btn-primary { background: #0077cc; color: white; }
.btn-outline-primary {
    border: 1px solid #0077cc;
    background: white;
    color: #0077cc;
}
input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 5px;
}
.form-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.footer {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* Mobile fallback */
@media (max-width: 720px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

input, select, textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card {
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 26px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin: 0; /* wrapper controls spacing */
}


.card > div,
.card .form-grid-2 > div,
.card .form-grid-3 > div {
    margin-bottom: 1rem;
}

label {
    font-size: 0.9rem;
    color: #334155;
}

select {
    height: 42px;
    background-color: #fff;
}

.form-wrapper {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

.action-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 1rem;
}

.muted{
    color:#64748b;
    font-size:0.9rem;
    margin-top:0.25rem;
}

@media (max-width: 720px) {
    .action-bar{
        flex-direction:column;
        align-items:stretch;
    }
    .action-bar button{
        width:100%;
    }
}

textarea{
    min-height: 110px;
    resize: vertical;
}

input, select{
    height: 42px;
}

/* ---------------------------
   Buttons (make <a> look like buttons too)
---------------------------- */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap: .5rem;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    border: 1px solid transparent;
    user-select: none;
}

.btn-primary{
    background: var(--primary, #2563eb);
    color: #fff;
}

.btn-primary:hover{
    filter: brightness(0.95);
}

.btn-secondary{
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.btn-secondary:hover{
    filter: brightness(0.98);
}

.btn-ghost{
    background: transparent;
    color: var(--primary, #2563eb);
    border-color: #e2e8f0;
}

.btn-ghost:hover{
    background: #f1f5f9;
}

/* ---------------------------
   Dashboard
---------------------------- */
.dash{
    display: grid;
    gap: 1.25rem;
}

.dash-header{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap: 1rem;
}

.dash-title{
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.dash-subtitle{
    margin: .25rem 0 0;
    color: #64748b;
}

.dash-actions{
    display:flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.dash-section-title{
    display:flex;
    align-items:center;
    gap: .75rem;
    margin-top: .25rem;
}

.dash-section-title h3{
    margin: 0;
}

.dash-count{
    font-size: .85rem;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: .2rem .55rem;
    border-radius: 999px;
}

.company-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.company-card{
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    display:flex;
    flex-direction:column;
    gap: 14px;
}

.company-card-top{
    display:flex;
    gap: 12px;
    align-items:flex-start;
}

.company-avatar{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight: 800;
    text-transform: uppercase;
}

.company-meta{
    min-width: 0;
}

.company-name{
    margin: 0;
    font-size: 1.05rem;
}

.company-name a{
    color: #0f172a;
    text-decoration: none;
}

.company-name a:hover{
    color: var(--primary, #2563eb);
}

.company-tags{
    margin-top: .35rem;
    display:flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.tag{
    font-size: .85rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: .25rem .55rem;
    border-radius: 999px;
}

.company-actions{
    display:flex;
    gap: .6rem;
    justify-content:flex-end;
    margin-top: 2px;
}

.dash-footer-actions{
    display:flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .25rem;
}

/* Empty state */
.dash-empty{
    display:flex;
    gap: 14px;
    align-items:flex-start;
    border: 1px solid #dbeafe;
    background: #f0f9ff;
}

.dash-empty-icon{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #dbeafe;
    display:flex;
    align-items:center;
    justify-content:center;
    flex: 0 0 auto;
}

.dash-empty-title{
    margin: 0;
}

.dash-empty-text{
    margin: .25rem 0 0;
    color: #475569;
}

.dash-empty-actions{
    display:flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .9rem;
}

@media (max-width: 720px){
    .dash-header{
        align-items:flex-start;
        flex-direction:column;
    }
    .company-actions{
        justify-content:flex-start;
    }
}

/* ---------------------------
   Search page
---------------------------- */
.search-form .field label{
    display:block;
    font-weight: 600;
    margin-bottom: .35rem;
}

.search-form input,
.search-form select{
    width: 100%;
}

.search-grid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.search-grid .field:first-child{
    grid-column: 1 / -1;
}

.search-actions{
    display:flex;
    align-items:center;
    gap: .75rem;
    margin-top: 14px;
    flex-wrap: wrap;
}

.search-indicator{
    color: #64748b;
    font-weight: 600;
    margin-left: .25rem;
}

.results-wrap{
    display:grid;
    gap: 1rem;
}

.results-empty{
    display:flex;
    align-items:flex-start;
    gap: 14px;
    padding: 16px;
}

.result-card .company-actions{
    margin-top: 6px;
}

@media (max-width: 720px){
    .search-grid{
        grid-template-columns: 1fr;
    }
}

.results-more{
    text-align: center;
    padding: 14px;
    color: #64748b;
    font-weight: 600;
}

.results-meta{
    display:flex;
    justify-content: flex-end;
    margin-bottom: .5rem;
}

.muted{
    color: #64748b;
    font-size: .9rem;
}

.company-avatar {
    font-weight: 700;
    background: linear-gradient(135deg, #e0e7ff, #eef2ff);
    color: #3730a3;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}
.results-li { margin: 0; }
.company-card.result-card { width: 100%; }

.results-list {
    margin: 0 auto;      /* center */
    width: 100%;
}
.results-meta {
    max-width: 980px;
    margin: 0 auto .5rem; /* align with list */
    width: 100%;
}
.results-more {
    max-width: 980px;
    margin: 0 auto;
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem; /* 👈 THIS is the key */
    flex-wrap: wrap;
}

.auth-form .field {
    margin-bottom: 1rem;
}
