@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-soft: #e6f0ff;
    --white: #ffffff;
    --bg: #f5f8ff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe3f5;
    --card: #ffffff;
}

* {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

button,
.btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
}

button:hover,
.btn:hover {
    background: var(--primary-dark);
}

input,
select,
textarea {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.card,
.panel,
.box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.table thead th {
    background: var(--primary-soft);
    color: var(--text);
}

/* ===============================
   FORM CONTROL NORMALIZATION
================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --control-height: 42px;
    --control-padding-x: 12px;
    --control-padding-y: 10px;
}

:where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
    select,
    textarea
) {
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
}

:where(
    .sub-text,
    .sales-page-subtitle,
    .crm-field-help,
    .crm-section-help,
    .admin-topbar-subtitle,
    .sales-topbar-subtitle,
    .workspace-topbar-subtitle,
    .users-meta-line
) {
    display: none !important;
}

:where(
    .page-header > div > p,
    .crm-card-head > div > p.crm-card-muted,
    .crm-section-title > div > p.crm-card-muted,
    .users-table-toolbar > div > p,
    .sales-dashboard-head > div > p,
    .sales-leads-panel .crm-card-head > div > p,
    .sales-pipeline-hero > div > p,
    .employee-month-header > p
) {
    display: none !important;
}

:where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
    select
) {
    min-height: var(--control-height) !important;
    height: var(--control-height) !important;
    padding: 0 var(--control-padding-x) !important;
}

textarea {
    min-height: calc(var(--control-height) * 2.2) !important;
    padding: var(--control-padding-y) var(--control-padding-x) !important;
    resize: vertical;
}

input[type="search"] {
    -webkit-appearance: textfield;
    appearance: textfield;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

/* ===============================
   GLOBAL SEARCH
================================ */
.global-search-form {
    width: min(640px, 100%);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 4px;
    border: 1px solid #d6e2f4;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.global-search-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: calc(var(--control-height) - 8px) !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 14px !important;
    color: #1f2937 !important;
    padding: 0 14px !important;
}

.global-search-input::placeholder {
    color: #64748b;
}

.global-search-btn {
    height: calc(var(--control-height) - 8px);
    min-width: 96px;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--white);
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.global-search-btn:hover {
    background: var(--primary-dark);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.search-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.search-kpi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid #d4e3fb;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 600;
}

.search-panel h3,
.search-panel h4 {
    margin: 0 0 10px;
    color: var(--text);
}

.search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-row {
    padding: 12px;
    border: 1px solid #e8eef9;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fbfdff;
}

.search-row:first-child {
    margin-top: 0;
}

.search-link {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}

.search-link:hover {
    color: var(--primary);
}

.search-meta,
.search-muted {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 920px) {
    .global-search-form {
        width: 100%;
        min-width: 0;
    }

    .global-search-btn {
        min-width: 82px;
        padding: 0 12px;
        font-size: 13px;
    }
}
