/*
 * FiveX Salary - Shared UI Theme
 *
 * This file provides the common visual language used by
 * salary_management.php and superadmin.php.
 *
 * It intentionally avoids application-specific positioning
 * and JavaScript-dependent selectors.
 */

:root {
    --fx-bg: #f3f6fa;
    --fx-card: #ffffff;
    --fx-text: #172033;
    --fx-muted: #64748b;
    --fx-line: #dfe6ee;
    --fx-red: #c91f2b;
    --fx-red-dark: #a91823;
    --fx-navy: #07111f;
    --fx-navy-2: #0d1b2e;
    --fx-green: #0f7b46;
    --fx-blue: #2563eb;
    --fx-shadow: 0 10px 30px rgba(15,23,42,.07);
    --fx-radius: 14px;
}

html {
    background: var(--fx-bg);
}

body {
    background: var(--fx-bg);
    color: var(--fx-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* Common links */
a {
    color: inherit;
}

/* Common cards */
.card,
.table-card,
.panel,
.metric-card {
    border-color: var(--fx-line);
    border-radius: var(--fx-radius);
}

/* Common headings */
.card-head,
.card-header,
.cardhead {
    border-color: var(--fx-line);
}

/* Common form controls */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border: 1px solid var(--fx-line);
    border-radius: 9px;
    background: #fff;
    color: var(--fx-text);
    min-height: 40px;
    box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--fx-red);
    box-shadow: 0 0 0 3px rgba(201,31,43,.10);
}

/* Common buttons */
button,
.btn,
button[type="submit"] {
    border-radius: 9px;
    font-weight: 700;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        transform .05s ease;
}

button:active,
.btn:active {
    transform: translateY(1px);
}

/* Primary FiveX red actions */
.redbtn,
button.primary,
button[type="submit"].primary,
.btn-primary {
    background: var(--fx-red);
    border-color: var(--fx-red);
    color: #fff;
}

.redbtn:hover,
button.primary:hover,
button[type="submit"].primary:hover,
.btn-primary:hover {
    background: var(--fx-red-dark);
    border-color: var(--fx-red-dark);
}

/* Tables */
table {
    border-color: var(--fx-line);
}

table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

table td,
table th {
    border-color: var(--fx-line);
}

table tbody tr:hover {
    background: #fafbfd;
}

/* Existing sidebar-style pages */
.sidebar {
    background:
        linear-gradient(
            180deg,
            var(--fx-navy) 0%,
            var(--fx-navy-2) 100%
        );
    color: #fff;
}

.sidebar .brand {
    color: #fff;
}

.sidebar .nav a,
.sidebar .nav a:visited {
    color: #cbd5e1;
}

.sidebar .nav a:hover,
.sidebar .nav a.active {
    background: rgba(255,255,255,.09);
    color: #fff;
}

/* Existing top navigation pages */
.top,
header.top {
    background:
        linear-gradient(
            90deg,
            var(--fx-navy) 0%,
            var(--fx-navy-2) 100%
        );
    color: #fff;
}

.top .nav,
header.top .nav {
    color: #cbd5e1;
}

.top .nav:hover,
header.top .nav:hover,
.top .nav.active,
header.top .nav.active {
    color: #fff;
    background: rgba(255,255,255,.09);
}

/* Older generic headers */
header:not(.top):not(.fx-topbar) {
    border-color: var(--fx-line);
}

/* Common brand logo sizing */
.brand-logo,
.header-logo,
.header-inner img,
header img[src*="assets/logo.png"] {
    object-fit: contain;
}

/* Status badges */
.status,
.badge {
    border-radius: 999px;
}

/* Period controls */
.period-form,
.controls,
.filter-form {
    border-color: var(--fx-line);
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile */
@media (max-width: 800px) {
    .card,
    .table-card,
    .panel {
        border-radius: 11px;
    }
}
