/* =========================
   GLOBAL STYLES
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #0f0f10;
    color: #e6e6e6;
    overflow-x: hidden;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #151518;
    padding: 20px;
    border-right: 1px solid #2a2a2a;
}

.sidebar h1 {
    color: #4fc3f7;
    margin-bottom: 20px;
    font-size: 22px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    display: block;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #cfcfcf;
    background: #1e1e22;
    transition: 0.2s;
}

.sidebar a:hover {
    background: #2a2a30;
    color: #ffffff;
}

/* =========================
   MAIN CONTENT
========================= */

.content {
    margin-left: 240px;
    padding: 20px;
}

/* =========================
   TILE SYSTEM
========================= */

.tile {
    width: 100%;
    background: #17171b;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1f1f24;
    cursor: pointer;
}

.tile-header h2 {
    font-size: 18px;
    color: #ffffff;
}

.collapse-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
}

/* Collapsible body */

.tile-body {
    padding: 20px;
    display: block;
}

/* =========================
   CONTROL ROWS
========================= */

.control-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

.control-row input,
.control-row select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #111115;
    color: white;
    outline: none;
}

.control-row button {
    padding: 10px 15px;
    background: #4fc3f7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #000;
    transition: 0.2s;
}

.control-row button:hover {
    background: #81d4fa;
}

/* =========================
   RESULT GRID (CALCULATORS)
========================= */

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.result-grid div {
    padding: 10px;
    background: #111115;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
}

/* =========================
   TABLES (CHARTS)
========================= */

.table-container {
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: #22222a;
    position: sticky;
    top: 0;
}

th, td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
    font-size: 13px;
}

tr:hover {
    background: #1f1f24;
}

/* =========================
   PAGINATION
========================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.pagination button {
    padding: 8px 12px;
    border: none;
    background: #333;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:hover {
    background: #555;
}

/* =========================
   COLLAPSE ANIMATION
========================= */

.tile-body {
    transition: all 0.3s ease;
}

/* hidden state (JS will toggle this) */
.tile.collapsed .tile-body {
    display: none;
}

.tile.collapsed .collapse-btn {
    transform: rotate(180deg);
}

/* =========================
   SCROLLBAR (optional polish)
========================= */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0f0f10;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}