@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Space+Mono:wght@400;700&display=swap');

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

:root {
    --bg-main: #f5f7ff;
    --bg-card: #ffffff;
    --bg-input: #f8f9fe;
    --bg-input-focus: #eef0ff;
    --accent: #4f46e5;
    --accent-light: #ede9fe;
    --accent2: #7c3aed;
    --green: #059669;
    --green-light: #d1fae5;
    --red: #dc2626;
    --red-light: #fee2e2;
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --yellow: #d97706;
    --yellow-light: #fef3c7;
    --text: #1e1b4b;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 2px 16px rgba(79,70,229,0.08);
    --shadow-lg: 0 8px 32px rgba(79,70,229,0.14);
}

body {
    background: var(--bg-main);
    background-image:
        radial-gradient(ellipse at 10% 10%, rgba(79,70,229,0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 90%, rgba(124,58,237,0.05) 0%, transparent 45%);
    min-height: 100vh;
    font-family: 'Cairo', sans-serif;
    color: var(--text);
}

.app { min-height: 100vh; }

.container {
    width: 88%;
    max-width: 1150px;
    margin: auto;
    padding-block: 36px 60px;
}

/* ── HEAD ── */
.head {
    text-align: center;
    padding-block: 30px 36px;
}

.head-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 12px rgba(79,70,229,0.2));
}

.head h1 {
    font-family: 'Space Mono', monospace;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.head p {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 6px;
}

.head::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    margin: 18px auto 0;
    border-radius: 99px;
}

/* ── CARD ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.03em;
    margin-bottom: 22px;
    text-transform: uppercase;
}

.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: inline-block;
    flex-shrink: 0;
}

.dot-blue { background: linear-gradient(135deg, var(--blue), #60a5fa); }

/* ── FORM GRID ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 4px;
}

.field label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--border);
    outline: none;
    background: var(--bg-input);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    margin: 0;
}

input::placeholder { color: #c4c9d9; }

input:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* ── TOTAL BOX ── */
#total-box {
    margin-block: 14px 6px;
    min-height: 20px;
}

#total {
    display: inline-block;
    background: linear-gradient(135deg, var(--green), #10b981);
    color: #fff;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 14px rgba(5,150,105,0.25);
}

#total::before { content: "💰  Net Salary: "; }

/* ── BUTTONS ── */
button {
    width: 100%;
    border: none;
    padding: 13px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: all 0.25s ease;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(79,70,229,0.25);
}

button:not(td button):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.35);
    letter-spacing: 0.09em;
}

button:active { transform: translateY(0); }

/* ── SEARCH ── */
.search-block input {
    background: var(--bg-input);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.btn-search {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.btn-search button {
    flex: 1;
    width: auto;
    margin-top: 0;
    background: linear-gradient(135deg, var(--blue), #3b82f6);
    box-shadow: 0 4px 14px rgba(37,99,235,0.2);
    font-size: 0.85rem;
    padding: 11px 14px;
}

.btn-search button:hover {
    box-shadow: 0 8px 24px rgba(37,99,235,0.32);
}

/* ── TABLE WRAPPER ── */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
    margin: 0;
}

thead {
    background: linear-gradient(135deg, #f0f0ff, #ede9fe);
    border-bottom: 2px solid var(--border);
}

th {
    padding: 15px 10px;
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    white-space: nowrap;
}

td {
    padding: 13px 10px;
    color: var(--text);
    font-size: 0.88rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }

td:first-child {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* net salary column — highlight */
td:nth-child(7) {
    font-weight: 700;
    color: var(--green);
}

/* department badge */
td:nth-child(8) span,
td:nth-child(8) {
    color: var(--blue);
    font-weight: 600;
}

/* ── TABLE BUTTONS ── */
td button {
    margin-top: 0;
    padding: 7px 16px;
    font-size: 0.78rem;
    border-radius: 9px;
    width: auto;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: none;
}

/* Edit button */
td:nth-last-child(2) button {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: var(--green);
    box-shadow: none;
}

td:nth-last-child(2) button:hover {
    background: linear-gradient(135deg, var(--green), #10b981);
    color: #fff;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
    transform: translateY(-1px);
    letter-spacing: 0.04em;
}

/* Delete button */
td:last-child button {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--red);
    box-shadow: none;
}

td:last-child button:hover {
    background: linear-gradient(135deg, var(--red), #ef4444);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
    transform: translateY(-1px);
    letter-spacing: 0.04em;
}

/* ── DELETE ALL ── */
#deleteAll { margin-bottom: 16px; }

#deleteAll button {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--red);
    box-shadow: none;
    border: 1.5px solid #fca5a5;
    font-size: 0.9rem;
}

#deleteAll button:hover {
    background: linear-gradient(135deg, var(--red), #ef4444);
    color: #fff;
    box-shadow: 0 6px 20px rgba(220,38,38,0.3);
    border-color: transparent;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .container { width: 96%; }
    .form-grid { grid-template-columns: 1fr; }
    .card { padding: 20px 16px; }
    th, td { padding: 10px 7px; font-size: 0.78rem; }
}
