/* OperationsHQ — Component styles: buttons, cards, forms, badges. */

/* Buttons */
.ohq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
}

.ohq-btn:hover { text-decoration: none; }

.ohq-btn--black {
    background: #000;
    color: #fff;
}
.ohq-btn--black:hover { transform: translateY(-1px); opacity: 0.92; }

.ohq-btn--white {
    background: #fff;
    color: #000;
    box-shadow: rgba(0,0,0,0.4) 0 0 1px, rgba(0,0,0,0.04) 0 4px 4px;
}
.ohq-btn--white:hover { transform: translateY(-1px); }

.ohq-btn--warm {
    background: var(--color-warm-stone);
    color: #000;
    padding: 12px 24px 12px 18px;
    box-shadow: var(--shadow-warm-btn);
    border: 1px solid rgba(0,0,0,0.05);
}
.ohq-btn--warm:hover { background: #f5f2ef; transform: translateY(-1px); }

.ohq-btn--ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.ohq-btn--ghost:hover { background: var(--color-bg); }

.ohq-btn--danger {
    background: var(--color-danger);
    color: #fff;
}
.ohq-btn--danger:hover { opacity: 0.92; }

.ohq-btn--sm { padding: 8px 14px; font-size: 0.8125rem; }
.ohq-btn--block { width: 100%; }
.ohq-btn[disabled], .ohq-btn--disabled { opacity: 0.55; cursor: not-allowed; }

/* Cards */
.ohq-card {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    padding: var(--space-8);
}

.ohq-card--tight { padding: var(--space-5); border-radius: var(--radius-lg); }

.ohq-card__title {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.ohq-card__meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

/* Form controls */
.ohq-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.ohq-field__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 0.14px;
}

.ohq-field__hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.ohq-input, .ohq-textarea, .ohq-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ohq-textarea { min-height: 100px; resize: vertical; }
.ohq-select { padding-right: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234e4e4e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

.ohq-input:focus, .ohq-textarea:focus, .ohq-select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35);
}

.ohq-field--error .ohq-input,
.ohq-field--error .ohq-textarea,
.ohq-field--error .ohq-select {
    border-color: var(--color-danger);
}

.ohq-field__error {
    font-size: 0.75rem;
    color: var(--color-danger);
}

/* Alerts */
.ohq-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
}
.ohq-alert--error { background: #fdecec; color: #7a1616; border-color: #f5c7c7; }
.ohq-alert--success { background: #e6f5ec; color: #14572e; border-color: #bfe1cb; }
.ohq-alert--info { background: #e7f0fa; color: #1a4a7a; border-color: #c6dbee; }

/* Badges */
.ohq-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.14px;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.ohq-badge--status-not_started { background: #f3f3f3; color: #4e4e4e; }
.ohq-badge--status-in_progress { background: #e7f0fa; color: #1a4a7a; border-color: #c6dbee; }
.ohq-badge--status-complete { background: #e6f5ec; color: #14572e; border-color: #bfe1cb; }
.ohq-badge--status-waiting_approval { background: #fff6e5; color: #7a4d00; border-color: #f3d99f; }
.ohq-badge--status-waiting_info { background: #fdf0e1; color: #7a3d00; border-color: #f1c599; }
.ohq-badge--status-blocked { background: #fdecec; color: #7a1616; border-color: #f5c7c7; }

.ohq-badge--priority-low { background: #eef3f6; color: #4a5c6a; border-color: #d7e1e8; }
.ohq-badge--priority-medium { background: #f3f3f3; color: #4e4e4e; }
.ohq-badge--priority-high { background: #fff6e5; color: #7a4d00; border-color: #f3d99f; }
.ohq-badge--priority-urgent { background: #fdecec; color: #7a1616; border-color: #f5c7c7; }

.ohq-badge--role { background: var(--color-bg); color: #4e4e4e; }

/* Tables */
.ohq-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    font-size: 0.9375rem;
}

.ohq-table th, .ohq-table td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.ohq-table th {
    background: #fafafa;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--color-text-muted);
}

.ohq-table tr:last-child td { border-bottom: none; }
.ohq-table tbody tr:hover { background: #fafafa; }

.ohq-table__link { color: #000; font-weight: 500; }
.ohq-table__empty { padding: var(--space-8); text-align: center; color: var(--color-text-muted); }

/* Role permissions matrix */
.ohq-perm-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: #fff;
}

.ohq-perm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.ohq-perm-table thead th {
    background: #fafafa;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--color-text-muted);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.ohq-perm-table__role {
    text-align: center !important;
    min-width: 120px;
}

.ohq-perm-table__you {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.7rem;
}

.ohq-perm-table__group > th {
    background: var(--color-bg-subtle) !important;
    font-weight: 600 !important;
    color: var(--color-text) !important;
    font-size: 0.8125rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: var(--space-3) var(--space-4) !important;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.ohq-perm-table tbody th.ohq-perm-table__action {
    text-align: left;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9375rem;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.ohq-perm-table__cell {
    text-align: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.ohq-perm-table tbody tr:last-child th,
.ohq-perm-table tbody tr:last-child td { border-bottom: none; }

.ohq-perm-table__col--highlight { background: rgba(255, 244, 214, 0.35); }
.ohq-perm-table thead th.ohq-perm-table__col--highlight { background: rgba(255, 244, 214, 0.7); }

.ohq-perm-cell {
    display: inline-block;
    line-height: 1;
}

.ohq-perm-cell--yes { color: var(--color-success); font-size: 1rem; }
.ohq-perm-cell--no  { color: var(--color-text-muted); }
.ohq-perm-cell--opt,
.ohq-perm-cell--text {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
}

/* Progress bar */
.ohq-progress {
    width: 100%;
    height: 8px;
    background: var(--color-bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.ohq-progress__bar {
    height: 100%;
    background: #000;
    transition: width 0.3s ease;
}

/* Filter / chip row */
.ohq-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
}

.ohq-chip--active { background: #000; color: #fff; border-color: #000; }
.ohq-chip:hover { text-decoration: none; }

.ohq-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-6) 0;
    border: none;
}
