:root {

    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --shadow: 0 10px 30px rgba(15, 23, 42, .08);

}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.dark {

    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --shadow: 0 12px 30px rgba(0, 0, 0, .45);

}

body {

    background: var(--bg);
    color: var(--text);
    transition: .3s;

}

/*-----------Header & DarkModeBtn------------*/
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 0px 0px 0px 0px;

    margin-bottom: 20px;
    padding: 15px;

    box-shadow: var(--shadow);

    transition: .3s;
}
.header-title{
    font-size: 22px;
}

#theme-toggle {

    background: var(--primary);

    color: #fff;

    border: none;

    border-radius: 12px;

    padding: 10px;

    cursor: pointer;

    font-size: 20px;

    transition: .3s;

}

#theme-toggle:hover {

    transform: translateY(-2px);

}

/*---------------SearchInputs--------*/
.coolinput {
    display: flex;
    flex-direction: column;
    position: static;
}

.coolinput label.text {
    color: rgb(113, 113, 113);
    font-weight: 700;
    position: relative;
    top: 0.3rem;
    margin: 0 2px;
    padding: 0 5px;
    background: white;
    width: fit-content;
    font-size: 14px;
    border-radius: 10px 10px 0px 0px;
}

.coolinput .input {
    padding: 11px 10px;
    border: 2px var(--border) solid;
    border-radius: 5px;
}

.coolinput input[type=text].input:focus {
    outline: none;
    box-shadow: 0px 0px 0px 0px;
}

.btn-1{
    width: 100%;
    padding: 10px;
    color: var(--bg);
    background-color: var(--text);
    border-radius: 12px;
}
/*-----------Table------------*/
.table-card {

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 22px;

    margin: 0 1%;
    margin-bottom: 20px;
    padding: 22px;

    box-shadow: var(--shadow);

    transition: .3s;

}

.sensor-table {

    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

}

.sensor-table thead th {

    background: transparent;

    color: var(--muted);

    font-size: 13px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .5px;

    padding: 18px;

    border-bottom: 5px solid var(--border);

}

.sensor-table th,
.sensor-table td {
    text-align: left;
}


.sensor-table tbody td {

    padding: 18px;

    border-bottom: 1px solid var(--border);

    transition: .25s;

}

.sensor-table tbody tr {

    transition: .25s;

}

.sensor-table tbody tr:hover {

    background: rgba(59, 130, 246, .08);

}

.sensor-table thead th:first-child {

    border-top-left-radius: 12px;

}

.sensor-table thead th:last-child {

    border-top-right-radius: 12px;

}

.table-card {

    background: var(--card);

    border-radius: 18px;

    overflow: hidden;

    border: 1px solid var(--border);

    box-shadow: var(--shadow);

}

.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

body.dark .table-responsive thead th {
    background: #1f2937;
    color: #fff;
}

.sensor-table {

    width: 100%;

    border-collapse: collapse;

}

.sensor-table thead {

    background: rgba(59, 130, 246, .08);

}

.sensor-table thead th {

    padding: 18px;

    color: #1e293b;

    font-size: 14px;

    font-weight: 700;

}

.sensor-table tbody td {

    padding: 18px;

    border-top: 1px solid var(--border);

}

.sensor-table tbody tr {

    transition: .25s;

}

.sensor-table tbody tr:hover {

    background: rgba(59, 130, 246, .06);

}

.sensor-info {

    display: flex;

    align-items: center;

    gap: 15px;

}

.sensor-avatar {

    width: 45px;

    height: 45px;

    border-radius: 12px;

    background: #dbeafe;

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 20px;

}

body.dark .sensor-avatar {

    background: #334155;

}

.sensor-info strong {

    display: block;

}

.sensor-info small {

    color: var(--muted);

}

.temp-badge {

    background: #fee2e2;

    color: #dc2626;

    padding: 8px 14px;

    border-radius: 30px;

    font-weight: 600;

}

.hum-badge {

    background: #dbeafe;

    color: #2563eb;

    padding: 8px 14px;

    border-radius: 30px;

    font-weight: 600;

}

.date-box {

    display: flex;

    flex-direction: column;

}

.date-box small {

    color: var(--muted);

}

.toolbar {

    display: flex;

    justify-content: flex-end;

    margin-bottom: 20px;

}

.table-responsive-custom {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
}

.sensor-table {
    width: 100%;
    min-width: 700px;
    /* حداقل عرض جدول */
}

.chart-title {

    background: var(--card);

    border-radius: 18px;

    overflow: hidden;

    border: 1px solid var(--border);

    box-shadow: var(--shadow);

}

.table-responsive-custom {
    max-height: 700px;
    overflow-y: auto;
}

.table-responsive-custom thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

body.dark .table-responsive thead th {
    background: #1f2937;
    color: #fff;
}

@media screen and (min-width: 768px) {
  .header-title{
    font-size: 28px;
  }
}