/* Consistent sizing across all devices */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

:root {
    --black: #111111;
    --panel: #1b1b1b;
    --gold: #d6ad55;
    --white: #ffffff;
    --muted: #999999;
    --background: #f5f5f5;
}

body {
    font-family: Arial, sans-serif;
    background: var(--background);
    color: #222;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--black);
    color: white;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 55px;
}

.brand-icon {
    width: 43px;
    height: 43px;
    background: var(--gold);
    color: black;
    display: grid;
    place-items: center;
    font-size: 25px;
    font-weight: bold;
    border-radius: 9px;
}

.brand h2 {
    font-size: 19px;
    letter-spacing: 2px;
}

.brand small {
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 1px;
}

.menu-label {
    color: #777;
    font-size: 11px;
    margin: 0 0 15px 10px;
}

nav {
    display: grid;
    gap: 9px;
}

nav a {
    color: #ccc;
    text-decoration: none;
    padding: 14px 12px;
    border-radius: 7px;
    font-size: 14px;
}

nav a:hover,
nav a.active {
    background: #30291c;
    color: var(--gold);
}

.sidebar-bottom {
    margin-top: auto;
    color: #999;
    font-size: 11px;
    line-height: 2;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 30px;
}

.topbar,
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.topbar h1 {
    font-size: 26px;
}

.topbar p,
.section-heading p {
    color: #888;
    margin-top: 7px;
    font-size: 13px;
}

.status {
    background: white;
    padding: 11px 16px;
    border-radius: 25px;
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    background: #27ae60;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.welcome {
    margin-top: 28px;
    padding: 30px;
    border-radius: 12px;
    background: linear-gradient(110deg, #151515, #302817);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gold-text {
    color: var(--gold);
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.welcome h2 {
    font-size: 23px;
    margin-bottom: 10px;
}

.welcome p:last-child {
    color: #bbb;
    font-size: 13px;
}

.welcome-symbol {
    font-size: 65px;
    font-weight: bold;
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 25px 0;
}

.stat-card {
    background: white;
    padding: 23px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.stat-card span,
.stat-card small {
    color: #888;
    font-size: 12px;
}

.stat-card h2 {
    margin: 12px 0;
    font-size: 27px;
    color: #222;
}

.products-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.section-heading h2 {
    font-size: 21px;
}

.gold-button {
    background: var(--gold);
    color: #171717;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.gold-button:hover {
    background: #e6c475;
}

.product-form {
    margin-top: 25px;
    padding: 22px;
    background: #faf8f2;
    border: 1px solid #e6d7b4;
    border-radius: 9px;
}

.product-form h3 {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: bold;
}

.field input,
.field select,
.search-area input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.cancel-button,
.refresh-button {
    background: white;
    border: 1px solid #ccc;
    padding: 11px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.search-area {
    display: flex;
    gap: 12px;
    margin: 25px 0 18px;
}

.search-area input {
    max-width: 400px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th {
    background: #f7f5ef;
    color: #777;
    font-size: 11px;
    text-align: left;
    padding: 15px 12px;
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.status-active {
    color: #20854a;
    font-weight: bold;
}

.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
}

.message.success {
    background: #e8f6ed;
    color: #176b37;
}

.message.error {
    background: #fce9e9;
    color: #a22;
}

.hidden {
    display: none;
}

footer {
    margin-top: 30px;
    text-align: center;
    color: #999;
    font-size: 11px;
}

@media (max-width: 800px) {
    .sidebar {
        width: 180px;
    }

    .main {
        padding: 18px;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 550px) {
    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
    }

    .brand {
        margin-bottom: 20px;
    }

    nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .welcome-symbol {
        display: none;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================
   LOGIN SCREEN
========================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f3f4f6;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 35px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.login-card .brand-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
}

.login-card h1 {
    margin-bottom: 8px;
    font-size: 23px;
}

.login-card > p {
    margin-bottom: 25px;
    color: #6b7280;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.login-card label {
    font-weight: 600;
    margin-top: 8px;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 15px;
}

.login-card button {
    width: 100%;
    padding: 13px;
    margin-top: 15px;
    border: none;
    border-radius: 7px;
    background: #2563eb;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

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

.login-card button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#loginMessage {
    min-height: 20px;
    color: #dc2626;
    font-size: 14px;
    text-align: center;
}


/* =====================================
   THAKUR MATCHING CENTRE - MOBILE
===================================== */

@media (max-width: 550px) {

    body {
        overflow-x: hidden;
    }

    .app {
        width: 100%;
        min-width: 0;
        display: block;
    }

    .sidebar {
        width: 100%;
        padding: 16px;
    }

    .brand {
        margin-bottom: 18px;
    }

    .brand h2 {
        font-size: 17px;
    }

    nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    nav a {
        padding: 12px 9px;
        text-align: center;
        font-size: 13px;
    }

    .sidebar-bottom {
        margin-top: 18px;
    }

    .main {
        width: 100%;
        min-width: 0;
        padding: 16px;
    }

    .topbar,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .section-heading button,
    .topbar button {
        width: 100%;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .field,
    .field input,
    .field select,
    .field textarea {
        width: 100%;
        min-width: 0;
    }

    .search-area {
        flex-direction: column;
    }

    .search-area input {
        width: 100%;
        max-width: none;
    }

    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 650px;
    }

    .login-screen {
        padding: 15px;
    }

    .login-card {
        padding: 24px 18px;
    }

    button,
    input,
    select,
    textarea {
        font-size: 16px;
    }

    button {
        min-height: 42px;
    }
}

/* Compact mobile navigation */
@media (max-width: 550px) {

    .sidebar {
        padding: 14px;
    }

    .brand {
        margin-bottom: 14px;
    }

    .menu-label {
        margin-bottom: 8px;
    }

    nav {
        gap: 5px;
    }

    nav a {
        padding: 9px 8px;
    }

    .sidebar-bottom {
        margin-top: 12px;
        line-height: 1.6;
    }
}