@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&family=Outfit:wght@500;600;700&display=swap');

:root {
    --orange: #f4510b;
    --orange-dark: #d94000;
    --orange-tint: #FFF4ED;
    --teal: #0EA5A8;
    --teal-dark: #0B7C7E;
    --teal-tint: #E6FAFA;
    --blue: #2563eb;
    --green: #16a34a;
    --red: #dc2626;
    --dark: #0B1320;
    --dark-2: #131F30;
    --text: #1F2430;
    --muted: #6b7280;
    --bg: #F7F7FA;
    --card: #ffffff;
    --border: #ECECF1;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 10px 26px -14px rgba(31, 36, 48, .14);
    --shadow-lg: 0 18px 44px -18px rgba(31, 36, 48, .22);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Almarai', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.num, .mono, table, th, td, input, .card-number {
    font-family: 'Almarai', 'Outfit', Tahoma, Arial, sans-serif;
}

a { text-decoration: none; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        linear-gradient(160deg, rgba(11, 19, 32, 0.94), rgba(19, 31, 48, 0.97)),
        radial-gradient(circle at top right, rgba(244, 81, 11, 0.45), transparent 32%),
        radial-gradient(circle at bottom left, rgba(14, 165, 168, 0.28), transparent 35%);
}

.login-card {
    width: 430px;
    max-width: 100%;
    background: white;
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    width: 270px;
    max-width: 100%;
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 8px 0 8px;
    font-size: 26px;
    font-weight: 800;
}

.login-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.input, input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14.5px;
    outline: none;
    background: white;
    font-family: inherit;
}

.input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(244, 81, 11, 0.12);
}

.login-card input { margin-bottom: 12px; }

.btn, button {
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    background: linear-gradient(150deg, var(--orange), var(--orange-dark));
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 18px -8px rgba(244, 81, 11, .45);
}

.login-card button { width: 100%; margin-top: 8px; }

.btn-blue { background: linear-gradient(150deg, var(--teal), var(--teal-dark)); box-shadow: 0 8px 18px -8px rgba(14,165,168,.4); }
.btn-green { background: linear-gradient(150deg, #22c55e, #15803d); box-shadow: 0 8px 18px -8px rgba(34,197,94,.4); }
.btn-red, .delete-btn { background: linear-gradient(150deg, #ef4444, #b91c1c); box-shadow: 0 8px 18px -8px rgba(239,68,68,.4); }
.btn-gray, .cancel-btn { background: linear-gradient(150deg, #6b7280, #374151); box-shadow: 0 8px 18px -8px rgba(55,65,81,.35); }
.edit-btn { background: linear-gradient(150deg, var(--teal), var(--teal-dark)); box-shadow: 0 8px 18px -8px rgba(14,165,168,.4); }

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    direction: rtl;
}

.sidebar {
    background: linear-gradient(180deg, var(--dark), var(--dark-2));
    color: white;
    padding: 22px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    background: white;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.sidebar-logo img { width: 100%; display: block; }

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    color: #C7D0DE;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: 0.18s;
    font-size: 14px;
    font-weight: 600;
}

.nav-link:hover {
    background: rgba(255,255,255,.06);
    color: white;
}

.nav-link.active {
    background: linear-gradient(150deg, var(--orange), var(--orange-dark));
    color: white;
    box-shadow: 0 10px 22px -10px rgba(244,81,11,.6);
}

.nav-sep {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
}

.main {
    padding: 24px;
    min-width: 0;
}

.topbar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.brand-mini { display: flex; align-items: center; gap: 14px; }
.brand-mini img { width: 210px; max-width: 45vw; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--orange-tint), #ffe0d1);
    display: grid;
    place-items: center;
    color: var(--orange-dark);
    font-size: 19px;
    font-weight: 700;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 6px;
}

.page-subtitle {
    color: var(--muted);
    margin: 0 0 22px;
    font-size: 14px;
}

.cards, .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.card, .box, .section, .form-box, .filters-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
}

.card p, .card-number {
    margin: 10px 0 0;
    color: var(--orange);
    font-size: 28px;
    font-weight: 800;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 18px;
}

.feature-card {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.feature-card:after {
    content: "";
    position: absolute;
    left: -20%; right: -20%; bottom: -75px;
    height: 140px;
    background: rgba(14,165,168,0.07);
    border-radius: 50% 50% 0 0;
}

.feature-icon {
    width: 66px;
    height: 66px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: white;
    font-size: 27px;
    background: linear-gradient(150deg, var(--orange), var(--orange-dark));
    box-shadow: 0 12px 24px -10px rgba(244,81,11,.5);
}

.feature-card h2 { margin: 0 0 8px; color: var(--text); font-size: 17px; font-weight: 800; }
.feature-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.75; font-size: 13.5px; }
.feature-card .btn { position: relative; z-index: 2; }

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

.form-title, .section h2, .box h2 {
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 14px;
}

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

/* Professional tables */
.table-wrap {
    position: relative;
    overflow: auto;
    max-height: 68vh;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--orange) #f1f5f9;
}

.table-wrap::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(150deg, var(--orange), var(--orange-dark));
    border-radius: 999px;
    border: 3px solid #f1f5f9;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--orange-dark);
}

table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(150deg, var(--orange), var(--orange-dark));
    color: white;
    padding: 12px 13px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 13.5px;
    white-space: nowrap;
    background: white;
    vertical-align: middle;
}

td textarea,
td input,
td select {
    min-width: 150px;
}

tr:hover td { background: var(--orange-tint); }

.table-wrap td:last-child,
.table-wrap th:last-child {
    position: sticky;
    left: 0;
    z-index: 4;
    box-shadow: -8px 0 18px rgba(15, 23, 42, 0.08);
}

.table-wrap th:last-child {
    z-index: 7;
}

.table-wrap td:last-child {
    background: white;
}

.table-wrap tr:hover td:last-child {
    background: var(--orange-tint);
}

.bar-row { margin-bottom: 14px; }
.bar-title { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 700; font-size: 13.5px; }
.bar-bg { height: 10px; background: #EEEFF3; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(150deg, var(--orange), var(--orange-dark)); }
.hot { color: var(--red); font-weight: 800; }

.footer {
    margin-top: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .main { padding: 16px; }
    .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
}



/* App polish */
.main {
    overflow: hidden;
}

.form-box,
.filters-box,
.table-wrap,
.card {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card:hover,
.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

button,
.btn {
    transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -8px rgba(244, 81, 11, 0.32);
}

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

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

select {
    cursor: pointer;
}


@media (max-width: 900px) {
    .table-wrap {
        max-height: 62vh;
        border-radius: 16px;
    }

    th,
    td {
        padding: 10px;
        font-size: 12.5px;
    }
}



/* HR page */
.hr-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.hr-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--orange-tint);
    color: var(--orange-dark);
    border: 1px solid #FBD9C5;
    font-weight: 700;
    font-size: 12.5px;
}

.hr-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.hr-summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.hr-summary-card span {
    color: var(--muted);
    font-size: 12.5px;
}

.hr-summary-card strong {
    display: block;
    margin-top: 8px;
    color: var(--orange);
    font-size: 22px;
    font-weight: 800;
}


/* Support Chat */
.chat-shell{
margin-top:22px;background:var(--card);border:1px solid var(--border);
border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow-lg);position:relative;
}
.chat-topbar{
display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 20px;
border-bottom:1px solid var(--border);
}
.chat-title{display:flex;align-items:center;gap:12px;font-weight:800;color:var(--teal-dark);}
.chat-live{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 12px #22c55e;}
.chat-actions{display:flex;gap:10px;flex-wrap:wrap;}
.chat-select{width:auto;min-width:140px;}
.chat-messages{
height:460px;overflow-y:auto;padding:22px;display:flex;flex-direction:column;gap:13px;
}
.chat-message{
max-width:78%;padding:13px 16px;border-radius:18px;background:white;
box-shadow:var(--shadow);
}
.chat-message.me{
align-self:flex-start;background:var(--orange-tint);
}
.chat-message.other{
align-self:flex-end;background:var(--teal-tint);
}
.chat-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:7px;}
.chat-user{font-weight:800;color:var(--orange-dark);}
.chat-role{
font-size:11px;padding:3px 8px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-weight:700;
}
.chat-time{font-size:11px;color:var(--muted);}
.chat-body{white-space:pre-wrap;line-height:1.75;font-size:13.5px;}
.chat-input-wrap{
padding:16px;border-top:1px solid var(--border);
}
.emoji-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
.emoji-btn{
width:38px;height:38px;border-radius:12px;background:var(--bg);font-size:18px;
}
.chat-send-row{display:grid;grid-template-columns:1fr auto;gap:12px;}
.chat-input{min-height:60px;}
.send-btn{min-width:110px;border-radius:14px;}
