:root {
    --header-bg: #1e2229;
    --sidebar-bg: #ffffff;
    --sidebar-text: #495057;
    --sidebar-hover-bg: #fff5f5;
    --primary-red: #eb4d4b;
    --primary-red-hover: #d63031;
    --stat-green: #20bf6b;
    --stat-blue: #2d8cf0;
    --stat-coral: #f55252;
    --body-bg: #f8f9fa;
    --card-border: #e9ecef;
    --text-dark: #212529;
    --text-muted: #6c757d;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.main-header {
    background: var(--header-bg);
    height: 58px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #ffffff;
    padding: 2px;
}

.header-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 480px;
}

.btn-sidebar-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    margin-left: 6px;
}

.btn-sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-project-select {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 12.5px;
    padding: 5px 12px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    max-width: 220px;
}

.header-project-select option {
    background: #212529;
    color: #ffffff;
}

.header-notif-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    position: relative;
    padding: 6px 8px;
    cursor: pointer;
}

.header-notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
}

.header-user-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.header-user-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
}

.header-user-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.main-wrapper {
    display: flex;
    padding-top: 58px;
    min-height: 100vh;
}

.main-sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    position: fixed;
    top: 58px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0 30px 0;
    margin: 0;
}

.sidebar-nav-item {
    margin-bottom: 2px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
    color: var(--primary-red);
    background: var(--sidebar-hover-bg);
}

.sidebar-nav-item.active > .sidebar-nav-link {
    color: var(--primary-red);
    background: var(--sidebar-hover-bg);
    border-left-color: var(--primary-red);
    font-weight: 600;
}

.sidebar-link-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-link-content i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav-item.active > .sidebar-nav-link i {
    color: var(--primary-red);
}

.sidebar-submenu {
    list-style: none;
    padding: 4px 0 6px 36px;
    margin: 0;
    background: #fafafa;
}

.sidebar-submenu-link {
    display: block;
    padding: 6px 12px;
    color: #6c757d;
    text-decoration: none;
    font-size: 12.5px;
    transition: color 0.2s ease;
}

.sidebar-submenu-link:hover,
.sidebar-submenu-item.active .sidebar-submenu-link {
    color: var(--primary-red);
    font-weight: 500;
}

.sidebar-badge {
    background: var(--primary-red);
    color: #ffffff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.content-wrapper {
    flex-grow: 1;
    margin-left: 240px;
    padding: 24px;
    background: var(--body-bg);
    min-height: calc(100vh - 58px);
    transition: margin-left 0.3s ease;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-main-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.btn-outline-red,
.btn-salon-outline {
    background: #ffffff;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-outline-red:hover,
.btn-salon-outline:hover {
    background: var(--primary-red);
    color: #ffffff;
}

.btn-solid-red,
.btn-salon-primary {
    background: var(--primary-red);
    border: 1px solid var(--primary-red);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-solid-red:hover,
.btn-salon-primary:hover {
    background: var(--primary-red-hover);
    border-color: var(--primary-red-hover);
    color: #ffffff;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

@media (max-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

.stat-box {
    border-radius: 10px;
    padding: 18px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.stat-box.bg-red {
    background: #f55252;
}

.stat-box.bg-green {
    background: var(--stat-green);
}

.stat-box.bg-blue {
    background: var(--stat-blue);
}

.stat-box.bg-coral {
    background: var(--primary-red);
}

.stat-box-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.stat-box.bg-red .stat-box-icon {
    color: #f55252;
}

.stat-box.bg-green .stat-box-icon {
    color: var(--stat-green);
}

.stat-box.bg-blue .stat-box-icon {
    color: var(--stat-blue);
}

.stat-box.bg-coral .stat-box-icon {
    color: var(--primary-red);
}

.stat-box-details {
    overflow: hidden;
}

.stat-box-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.stat-box-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.stat-btn-box {
    grid-column: span 1;
    background: var(--stat-green);
    border-radius: 10px;
    padding: 16px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
}

.stat-btn-box:hover {
    transform: translateY(-2px);
    color: #ffffff;
}

.app-card,
.data-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.app-card-header,
.data-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card-title,
.data-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.app-card-body,
.data-card-body {
    padding: 20px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-entries {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.table-entries select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
}

.table-export-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-export {
    background: #ffffff;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: var(--primary-red);
    color: #ffffff;
}

.table-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.table-search-box input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    outline: none;
    width: 170px;
}

.app-table,
.table-app,
.table-custom {
    width: 100%;
    margin-bottom: 0;
    font-size: 13px;
    border-collapse: collapse;
}

.app-table th,
.table-app th,
.table-custom th {
    background: #ffffff;
    color: #495057;
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 2px solid var(--card-border);
    white-space: nowrap;
    text-align: left;
}

.app-table td,
.table-app td,
.table-custom td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
    color: #333333;
}

.app-table tr:hover td,
.table-app tr:hover td,
.table-custom tr:hover td {
    background: #fafbfc;
}

.price-text,
.price-text-blue {
    color: var(--stat-blue);
    font-weight: 600;
}

.badge-active-green {
    background: var(--stat-green);
    color: #ffffff;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-inactive-red {
    background: var(--primary-red);
    color: #ffffff;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn-blue {
    color: var(--stat-blue);
    font-size: 14px;
    padding: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
}

.action-btn-red {
    color: var(--primary-red);
    font-size: 14px;
    padding: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
}

.action-btn-green {
    color: var(--stat-green);
    font-size: 14px;
    padding: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
}

.form-label-custom {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 6px;
    display: block;
}

.form-label-custom .text-req,
.required-star {
    color: var(--primary-red);
}

.form-control-custom {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.2s ease;
}

.form-control-custom:focus {
    border-color: var(--primary-red);
}

.field-note-text,
.form-note-text {
    font-size: 11.5px;
    color: #888888;
    margin-top: 4px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1010;
}

@media (max-width: 991px) {
    .main-sidebar {
        transform: translateX(-100%);
    }

    .main-sidebar.show {
        transform: translateX(0);
    }

    .content-wrapper {
        margin-left: 0;
        padding: 16px;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .header-title {
        max-width: 200px;
    }
}
