* {
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

body {
    margin: 0;
    background: #f4f8fd;
    color: #0f172a;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #306ac7, #3872b9);
}

.login-card {
    width: 360px;
    background: #ffffff;
    border-radius: 14px;
    padding: 32px 30px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
    text-align: center;
}

.login-card img {
    width: 200px;
    margin-bottom: 16px;
}

.login-card h2 {
    margin: 0 0 20px;
    font-size: 21px;
    color: #1e3a8a;
}

.login-card input {
    width: 100%;
    padding: 11px 12px;
    margin-bottom: 14px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    font-size: 14px;
}

.login-card input:focus {
    outline: none;
    border-color: #3b82f6;
}

.login-card button {
    width: 100%;
    padding: 11px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.login-card button:hover {
    background: #1d4ed8;
}

.login-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 10px;
}

/* ===== HEADER ===== */
.header {
    background: #1e90ff;
    color: white;
    padding: 15px 20px;
    font-size: 22px;
    font-weight: bold;
    overflow: hidden; /* IMPORTANT */
    width: 100%;
    box-sizing: border-box;
}

.hlogout {
    float: right;
    color: white;
    text-decoration: none;
    background: red;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
}


/* ===== LAYOUT ===== */
.container {
    display: flex;
    width:100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background: #1e3a8a;
    padding-top: 15px;
}

.sidebar a {
    display: block;
    padding: 13px 24px;
    color: #e0e7ff;
    text-decoration: none;
    font-size: 14px;
}

.sidebar a:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    padding: 26px;
    width:100%;
}

/* ===== CARD ===== */
.card {
    background: #ffffff;
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1e3a8a;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

table th {
    background: #eef2ff;
    padding: 11px;
    text-align: left;
    border-bottom: 4px solid #c7d2fe;
    border-radius: 8px;
}

table td {
    padding: 11px;

}

/* ===== FORM ===== */
input, select {
    padding: 9px 10px;
    border: 1px solid #5e5a5a;
    border-radius: 25px;
    width: 100%;
}

button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
}
/* ===== ADMIN OPTION CARDS ===== */
.admin-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
    margin-top: 25px;
}

.admin-option {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    text-decoration: none;
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
    border-left: 6px solid #2563eb;
}

.admin-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.15);
}

.admin-option .icon {
    font-size: 34px;
    margin-bottom: 12px;
}

.admin-option h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: #1e3a8a;
}

.admin-option p {
    margin: 0;
    font-size: 13px;
    color: #475569;
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"] {
    width: 140px;
    height: 30px;
    font-size: 14px;
    padding: 4px 6px;
    box-sizing: border-box;
}
.cell   {

    box-sizing: border-box;
    border-radius: 5px;
}

.login-text input {

width: 300px;
height: 30px;

}
#chat-widget {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 280px;
    font-family: Arial, sans-serif;
    z-index: 9999;
}

#chat-header {
    background: #0d6efd;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    text-align: center;
    font-weight: bold;
}

#chat-body {
    display: none;
    border: 1px solid #ccc;
    background: #fff;
}

#chat-messages {
    height: 180px;
    overflow-y: auto;
    padding: 10px;
    font-size: 13px;
}

#chat-input-area {
    display: flex;
    border-top: 1px solid #ddd;
}

#chat-input-area input {
    flex: 1;
    padding: 6px;
    border: none;
    outline: none;
}

#chat-input-area button {
    padding: 6px 10px;
    border: none;
    background: #0d6efd;
    color: #fff;
}

.chat-msg {
    max-width: 80%;
    margin-bottom: 8px;
    clear: both;
}

.chat-msg.me {
    float: right;
    text-align: right;
}

.chat-msg.other {
    float: left;
    text-align: left;
}

.chat-text {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 12px;
    background: #e9e9e9;
    font-size: 13px;
}

.chat-msg.me .chat-text {
    background: #0d6efd;
    color: #fff;
}

.chat-user-name {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
}
/* ===== CARGURU TABLE FIX ===== */


table th {
    font-size: 14px;
    padding: 8px 6px;
    text-align: center;
}

table td {
    padding: 1px 1px;
    text-align: center;
}

/* Inputs inside table */
table input {
    width: 100%;
    height: 21px;
    font-size: 13px;
    padding: 1px 1px;
    border-radius: 3px;
}

/* Smaller date field */
input[type="date"] {
    height: 22px;
    font-size: 12px;
}

/* Profit fields */
.profit,
.profit_percent {
    background: #f1f5f9;
    font-weight: 500;
}


/* Reduce header height */
h2 {
    margin-bottom: 15px;
}
/* ================= MASTER DATA FIX ================= */

/* Filter Bar */
.card form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.card form input,
.card form select {
    width: auto;
    min-width: 120px;
}

.card form button {
    height: 30px;
}
.card input {

    height:30px;
}



/* Master Data */
.masterdata table {
    font-size: 12px;
}

.masterdata table th {
    text-align: center;
    padding: 8px;
}

.masterdata table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

/* Edit mode inputs inside table */
.masterdata table td input {
    width: 100%;
    height: 26px;
    font-size: 13px;
    padding: 3px 6px;
}

/* Action links */
.masterdata table a {
    text-decoration: none;
    font-weight: 500;
}

.masterdata table a:hover {
    text-decoration: underline;
}

/* Profit colors */
.profit-positive {
    color: #16a34a;
    font-weight: 600;
}

.profit-negative {
    color: #dc2626;
    font-weight: 600;
}

.back {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    font-weight: 500;
    color: #2563eb;
}

.back:hover {
    text-decoration: underline;
}

.masterdata table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.masterdata table th {
    background: #eef2ff;
    padding: 11px;
    text-align: left;
    border-bottom: 2px solid #c7d2fe;
}

.masterdata table td {
    padding: 11px;
}

.masterdata input, select {
    padding: 9px 10px;
    border: 1px solid #5e5a5a;
    border-radius: 6px;
    width: 100%;
}

.masterdata button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
}



/* ===== SAVE STATUS COLORS ===== */

.saved {
    background-color: #00ff7b !important;   /* light green */
}

.error {
    background-color: #1eff00 !important;   /* light red */
}

.cell-error {
    border: 2px solid red !important;
}

.error-message {
    color: red;
    font-size: 11px;
    margin-top: 2px;
}
.masterdata{
border-collapse:collapse;
width:100%;
font-size:14px;
}

.masterdata th,
.masterdata td{
border:1px solid #ccc;
padding:6px;
text-align:center;
}

.masterdata th{
background:#f5f5f5;
}


input[type="checkbox"]{
width:14px;
height:14px;
}

button{
font-size:11px;
padding:3px 6px;
}
.filter-row input{
width:90%;
font-size:11px;
padding:2px;
}
.copy-btn{
border:none;
background:none;
cursor:pointer;
font-size:14px;
margin-left:4px;

}

.copy-btn:hover{
opacity:0.7;
}
.copy-icon{
cursor:pointer;
display:inline-flex;
align-items:center;
gap:4px;
}

.copy-icon:hover{
opacity:0.8;
}
.active-row td{
background:#850303;
color:#fff;
}
.completed-row{
background:#e9ffe9;
}
.mcalculator a{
text-decoration: none;
font-weight: bold;
color: rgb(85, 85, 144);
}

.mcalculator a:hover{
text-decoration: none;
color: rgb(85, 85, 144);
}

.carfax_condition{
font-weight:bold;
padding:4px 8px;
border-radius:4px;
color:white;
text-align:center;
}

.carfax_condition.excellent{
background:green;
}

.carfax_condition.good{
background:rgb(255, 251, 0);
color: black;
}

.carfax_condition.fair{
background:red;
}