/* =========================================================
   WEIGHPRO - GLOBAL APPLICATION STYLES
========================================================= */

/* =========================================================
   1. GLOBAL VARIABLES
========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --accent: #E87522;
    --accent-dark: #a94b0d;

    --bg: #f4f6f9;
    --panel: #ffffff;

    --text: #202531;
    --muted: #747c8c;
    --border: #e4e8ef;

    --sidebar: #222127;
}

/* =========================================================
   2. BASE STYLES
========================================================= */

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 "Segoe UI", Arial, sans-serif;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 11px;
    background: #fff;
    color: var(--text);
    outline-color: var(--accent);
}

textarea {
    min-height: 84px;
}

label {
    display: block;
    font-weight: 600;
    margin: 0 0 14px;
}

label input,
label select,
label textarea {
    display: block;
    margin-top: 6px;
    font-weight: 400;
}

.small {
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

/* =========================================================
   3. AUTHENTICATION / LOGIN
========================================================= */

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background: linear-gradient(135deg, #fff8f1, #f1f3f8);
}

.auth-card {
    width: min(100%, 450px);
    padding: 32px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 16px 48px #18203312;
}

.auth-card h1 {
    margin: 18px 0 4px;
    font-size: 26px;
}

.auth-card .small {
    margin-top: 18px;
}

/* =========================================================
   4. BRANDING
========================================================= */

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: white;
    font-weight: 900;
    font-size: 17px;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 24px;
    font-size: 19px;
    font-weight: 850;
}

.side-brand .brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* =========================================================
   5. BUTTONS
========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: var(--accent);
    color: white;
}

.btn.secondary {
    background: #eef0f4;
    color: #303644;
}

.btn.danger {
    background: #b42318;
    color: #fff;
}

.btn.full {
    width: 100%;
    margin-top: 5px;
}

/* =========================================================
   6. MAIN APPLICATION LAYOUT
========================================================= */

.app-shell {
    min-height: 100vh;
}

/* =========================================================
   7. SIDEBAR
========================================================= */

.sidebar {
    width: 265px;
    min-width: 265px;
    background: var(--sidebar);
    color: white;

    position: fixed;
    inset: 0 auto 0 0;

    padding: 10px;
    display: flex;
    flex-direction: column;

    z-index: 10;
    overflow-y: auto;
}

/* Sidebar User Profile */

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px;
    margin: 10px;

    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;

    min-width: 0;
}

.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent);
    color: #fff;

    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    color: #b9b9b9;
    font-size: 11px;
    margin-top: 3px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar Section Labels */

.side-label {
    padding: 14px 12px 7px;
    margin-top: 8px;

    color: #a7a7b0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* Sidebar Navigation */

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 13px;
    border-radius: 9px;

    color: #dedee5;
    margin: 2px 0;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent);
    color: white;
}

.nav-icon {
    width: 22px;
    min-width: 22px;
    text-align: center;
}

/* Sidebar Bottom / Logout */

.sidebar-bottom {
    margin-top: auto;
    padding-top: 20px;
}

/* =========================================================
   8. MAIN CONTENT AREA
========================================================= */

.main-area {
    margin-left: 265px;
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    min-width: 0;
}

.page-content {
    padding: 26px;
    flex: 1;
    min-width: 0;
}

/* =========================================================
   9. PAGE HEADINGS
========================================================= */

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-heading h1 {
    font-size: 25px;
    margin: 0 0 4px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
}

/* =========================================================
   10. DASHBOARD GRID
========================================================= */

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* =========================================================
   11. DASHBOARD STAT CARDS
========================================================= */

.stat,
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 18px;
    box-shadow: 0 3px 12px #1a243008;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.stat-value {
    font-size: 27px;
    font-weight: 800;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.stat-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

/* =========================================================
   12. PANELS
========================================================= */

.panel {
    margin-bottom: 18px;
}

.panel h2 {
    font-size: 16px;
    margin: 0 0 16px;
}

/* =========================================================
   13. FORMS
========================================================= */

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

.form-grid .wide {
    grid-column: 1 / -1;
}

/* =========================================================
   14. TABLES
========================================================= */

.table-wrap {
    overflow: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background: #f8f9fb;
    color: #5f6674;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   15. ACTION BUTTON GROUPS
========================================================= */

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.actions form {
    margin: 0;
}

/* =========================================================
   16. BADGES
========================================================= */

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;

    background: #fff0dc;
    color: #8c4b0c;

    font-size: 11px;
    font-weight: 800;
}

.badge.success {
    background: #e5f8ed;
    color: #187245;
}

.badge.cancelled {
    background: #ffe8e7;
    color: #a4211a;
}

/* =========================================================
   17. ALERTS / NOTICES
========================================================= */

.alert {
    padding: 11px 13px;
    border-radius: 9px;
    margin: 12px 0;

    background: #eaf7ef;
    color: #17663b;
}

.alert.error {
    background: #ffeded;
    color: #a31e1e;
}

.alert.info {
    background: #edf4ff;
    color: #204f92;
}

.notice {
    border-left: 4px solid var(--accent);
    background: #fff6ed;

    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* =========================================================
   18. FILTERS
========================================================= */

.filters {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filters label {
    min-width: 145px;
    flex: 1;
    margin: 0;
}

/* =========================================================
   19. EMPTY STATES
========================================================= */

.empty-state {
    padding: 26px;
    text-align: center;
    color: var(--muted);
}

/* =========================================================
   20. COLOR PICKER
========================================================= */

.color-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.color-picker {
    width: 56px;
    height: 56px;

    border: 0;
    padding: 0;
    border-radius: 50%;

    overflow: hidden;
    cursor: pointer;
    background: transparent;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #ddd;
}

/* =========================================================
   21. FOOTER
========================================================= */

.footer {
    padding: 16px 26px;
    color: var(--muted);
    font-size: 12px;

    border-top: 1px solid var(--border);
    background: #fff;
}

/* =========================================================
   22. RESPONSIVE - TABLET
========================================================= */

@media (max-width: 1100px) {

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

    .sidebar {
        width: 230px;
        min-width: 230px;
    }

    .main-area {
        margin-left: 230px;
    }
}

/* =========================================================
   23. RESPONSIVE - MOBILE
========================================================= */

@media (max-width: 760px) {

    .sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        height: auto;
        inset: auto;
    }

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

    .main-area {
        margin-left: 0;
    }

    .page-content {
        padding: 18px;
    }

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

    .page-heading {
        flex-direction: column;
    }

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

    .form-grid .wide {
        grid-column: auto;
    }
}

/* =========================================================
   24. RESPONSIVE - SMALL MOBILE
========================================================= */

@media (max-width: 460px) {

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

    .auth-card {
        padding: 24px;
    }
}