* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #595421;
    --primary-dark: #47431a;
    --cream: #e3d6ca;
    --dark: #323530;
    --muted: #767971;
    --border: #e7e6df;
    --background: #f6f5f1;
    --white: #ffffff;
    --success: #2f7a4d;
    --danger: #c74747;
    --warning: #b47a15;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    background: var(--background);
    color: var(--dark);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ==========================================
   LAYOUT
========================================== */

.dashboard-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.dashboard-main {
    min-width: 0;
}

/* ==========================================
   SIDEBAR
========================================== */

.dashboard-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px 22px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background:
        linear-gradient(
            160deg,
            #323530,
            #232620
        );
    color: #ffffff;
}

.dashboard-sidebar::-webkit-scrollbar {
    width: 5px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
}

.dashboard-logo {
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 20px;
    font-weight: 700;
}

.dashboard-logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.dashboard-menu {
    margin-top: 38px;
    display: grid;
    gap: 6px;
}

.dashboard-menu a,
.logout-link {
    min-height: 45px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 500;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.dashboard-menu a span,
.logout-link span {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
}

.dashboard-menu a:hover,
.logout-link:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    transform: translateX(2px);
}

.dashboard-menu a.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 25px;
}

/* ==========================================
   HEADER
========================================== */

.dashboard-header {
    min-height: 92px;
    padding: 20px 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.dashboard-greeting {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-header h1 {
    margin-top: 3px;
    font-size: 24px;
    line-height: 1.3;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-avatar {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(89, 84, 33, 0.12);
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
}

.dashboard-user strong,
.dashboard-user span {
    display: block;
}

.dashboard-user strong {
    max-width: 190px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-user span {
    max-width: 190px;
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================
   CONTENT
========================================== */

.dashboard-content {
    padding: 32px 35px 50px;
}

/* ==========================================
   WELCOME CARD
========================================== */

.welcome-card {
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-radius: 20px;
    background:
        radial-gradient(
            circle at 90% 20%,
            rgba(227, 214, 202, 0.18),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #323530,
            #252822
        );
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(50, 53, 48, 0.14);
}

.welcome-label {
    display: inline-flex;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: var(--cream);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

.welcome-card h2 {
    margin-top: 15px;
    font-size: 28px;
    line-height: 1.35;
}

.welcome-card p {
    max-width: 670px;
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.7;
}

.primary-button {
    min-width: 185px;
    min-height: 46px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ==========================================
   STATISTICS
========================================== */

.stats-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(50, 53, 48, 0.04);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(50, 53, 48, 0.08);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.stat-title {
    color: var(--muted);
    font-size: 11px;
}

.stat-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(89, 84, 33, 0.1);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.stat-card > strong {
    margin-top: 12px;
    display: block;
    overflow: hidden;
    font-size: 22px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card small {
    margin-top: 6px;
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.stat-money {
    font-size: 19px !important;
}

.status-active {
    color: var(--success);
}

/* ==========================================
   DASHBOARD GRID
========================================== */

.dashboard-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(330px, 0.8fr);
    gap: 20px;
}

.dashboard-grid-large {
    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(320px, 0.45fr);
}

/* ==========================================
   PANEL
========================================== */

.dashboard-panel {
    min-width: 0;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(50, 53, 48, 0.03);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.panel-heading h3 {
    font-size: 17px;
}

.panel-heading p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.panel-heading a {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================
   TABLE TRANSAKSI
========================================== */

.table-wrapper {
    width: 100%;
    margin-top: 22px;
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    vertical-align: middle;
}

.dashboard-table th {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.35px;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-table tbody tr:hover {
    background: #faf9f6;
}

.dashboard-table td strong {
    font-size: 11px;
}

.transaction-status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #efeee9;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
}

.transaction-status.selesai {
    background: rgba(47, 122, 77, 0.12);
    color: var(--success);
}

.transaction-status.ditunda {
    background: rgba(180, 122, 21, 0.13);
    color: var(--warning);
}

.transaction-status.dibatalkan {
    background: rgba(199, 71, 71, 0.12);
    color: var(--danger);
}

.empty-table {
    padding: 34px 10px !important;
}

.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
}

.empty-state span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f1f0eb;
    color: var(--primary);
    font-size: 18px;
}

.empty-state strong {
    margin-top: 10px;
    font-size: 12px;
}

.empty-state small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

/* ==========================================
   STOCK LIST
========================================== */

.stock-list {
    margin-top: 22px;
    display: grid;
    gap: 12px;
}

.stock-item {
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stock-product-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(89, 84, 33, 0.1);
    color: var(--primary);
}

.stock-product-info {
    min-width: 0;
    flex: 1;
}

.stock-product-info strong,
.stock-product-info small {
    display: block;
}

.stock-product-info strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-product-info small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.stock-value {
    flex-shrink: 0;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(199, 71, 71, 0.1);
    color: var(--danger);
    font-size: 9px;
    font-weight: 600;
}

.empty-stock {
    min-height: 190px;
    padding: 25px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.empty-stock span {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(47, 122, 77, 0.12);
    color: var(--success);
    font-size: 16px;
    font-weight: 700;
}

.empty-stock strong {
    margin-top: 10px;
    font-size: 12px;
}

.empty-stock small {
    max-width: 230px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

/* ==========================================
   ACCOUNT INFORMATION
========================================== */

.account-list {
    margin-top: 22px;
    display: grid;
}

.account-list > div {
    padding: 15px 0;
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.account-list > div:last-child {
    border-bottom: 0;
}

.account-list span {
    color: var(--muted);
    font-size: 11px;
}

.account-list strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

/* ==========================================
   SETUP LIST
========================================== */

.setup-list {
    margin-top: 22px;
    display: grid;
    gap: 13px;
}

.setup-item {
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

a.setup-item:hover {
    border-color: rgba(89, 84, 33, 0.35);
    background: #faf9f6;
    transform: translateY(-1px);
}

.setup-check {
    width: 29px;
    height: 29px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #efeee9;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.setup-item.completed .setup-check {
    background: rgba(47, 122, 77, 0.12);
    color: var(--success);
}

.setup-item strong,
.setup-item small {
    display: block;
}

.setup-item strong {
    font-size: 11px;
}

.setup-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 1200px) {

    .dashboard-layout {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .dashboard-content {
        padding-right: 25px;
        padding-left: 25px;
    }

    .dashboard-grid-large {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 1050px) {

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 800px) {

    .dashboard-layout {
        display: block;
    }

    .dashboard-sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 20px;
        overflow: visible;
    }

    .dashboard-menu {
        margin-top: 25px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-bottom {
        margin-top: 20px;
        padding-top: 0;
    }

    .dashboard-header {
        padding: 18px 20px;
    }

    .dashboard-content {
        padding: 24px 20px 40px;
    }

    .welcome-card {
        padding: 27px;
    }

}

@media (max-width: 600px) {

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-user {
        width: 100%;
        padding-top: 14px;
        border-top: 1px solid var(--border);
    }

    .welcome-card {
        align-items: stretch;
        flex-direction: column;
    }

    .welcome-card h2 {
        font-size: 23px;
    }

    .primary-button {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-menu {
        grid-template-columns: 1fr;
    }

    .dashboard-panel {
        padding: 20px;
    }

    .panel-heading {
        flex-direction: column;
        gap: 10px;
    }

    .account-list > div {
        grid-template-columns: 1fr;
        gap: 5px;
    }

}

@media (max-width: 400px) {

    .dashboard-content {
        padding-right: 14px;
        padding-left: 14px;
    }

    .welcome-card {
        padding: 23px 20px;
    }

    .stat-card {
        padding: 19px;
    }

    .dashboard-panel {
        padding: 18px;
    }

}