:root {
    --primary: #0ba3f0;
    --primary-dark: #0366d6;
    --primary-gradient: linear-gradient(135deg, #0ba3f0 0%, #0366d6 100%);
    --bg-light: #f5f7fa;
    --text-main: #333;
    --text-muted: #777;
    --white: #ffffff;
    --yellow-active: #ffe600;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    width: 100%;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    background-color: var(--bg-light);
    position: relative;
    box-shadow: none;
    overflow-x: hidden;
}

/* Background patterns */
.wavy-bg {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

/* Profile Card */
.profile-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin: -35px 20px 25px 20px;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-pic {
    width: 60px;
    height: 60px;
    background: #eef2f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    overflow: hidden;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
}

.stats-card {
    background: linear-gradient(135deg, #097cd9 0%, #044b9e 100%);
    border-radius: 15px;
    padding: 20px;
    margin-top: 15px;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-info h4 {
    font-weight: 400;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stats-info .value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.stats-action {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.action-btn {
    background: white;
    border: 1px solid #f0f0f0;
    padding: 18px 12px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: #444;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.action-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(11, 163, 240, 0.1);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    font-size: 22px;
    color: var(--primary);
    background: #f0f7ff;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 2px;
}

/* Page Sections */
.page-section {
    display: none;
    padding: 0 0 100px 0;
    /* space for bottom nav */
    position: relative;
    z-index: 1;
}

.page-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    padding: 0 20px 15px 20px;
    font-size: 18px;
    color: var(--primary-dark);
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    background: var(--primary-gradient);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 20px 10px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 1000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--yellow-active);
}

.diamond-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -35px;
    cursor: pointer;
}

.diamond-btn {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #51c4ff 0%, #0366d6 100%);
    border-radius: 12px;
    transform: rotate(45deg);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px solid var(--white);
    box-shadow: 0 5px 15px rgba(3, 102, 214, 0.4);
    transition: transform 0.2s;
}

.diamond-btn i {
    transform: rotate(-45deg);
    font-size: 22px;
    color: var(--white);
}

.diamond-wrapper.active .diamond-btn {
    border-color: var(--yellow-active);
}

.diamond-wrapper.active .diamond-text {
    color: var(--yellow-active);
}

.diamond-text {
    margin-top: 15px;
    font-size: 12px;
    color: var(--white);
    font-weight: 500;
}

/* Forms and Lists Generic */
.content-padding {
    padding: 0 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

.btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-block {
    display: block;
    width: 100%;
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info h5 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--primary-dark);
}

.item-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.item-action {
    display: flex;
    gap: 10px;
}

.item-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    background: #eef6ff;
    color: var(--primary);
}

/* Table Style for Stock/POS details */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.table th {
    background: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
}

/* Login Page specific */
.login-body {
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
}

.login-background {
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: 50%;
    background: var(--primary-gradient);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    z-index: -1;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-header h2 {
    color: var(--primary-dark);
    font-weight: 700;
}

.login-header h2 span {
    color: var(--primary);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #f9fbfd;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(11, 163, 240, 0.1);
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-danger {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
}

/* POS specific */
.pos-total {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-total h3 {
    font-size: 14px;
    opacity: 0.8;
}

.pos-total h2 {
    font-size: 28px;
}

/* Select2 width fix for POS */
#page-pos .select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* POS cart items */
.pos-cart-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pos-cart-item:last-child {
    margin-bottom: 0;
}

.pos-cart-item-info h5 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--primary-dark);
}

.pos-cart-item-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.pos-cart-item-action {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pos-cart-item-price {
    font-weight: bold;
    color: var(--primary-dark);
}

.pos-cart-item-remove {
    color: #ef4444;
    cursor: pointer;
}

/* POS empty state */
.pos-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
    border: 2px dashed #e0e0e0;
    border-radius: 15px;
    margin: 10px 0;
    background: #fafafa;
}

.pos-empty-state i {
    display: block;
    margin-bottom: 15px;
}

.pos-empty-state p {
    margin: 5px 0;
}

/* POS process button */
.pos-process-btn {
    background: #48bb78 !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    padding: 15px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
}

.pos-process-btn:hover {
    background: #38a169 !important;
}

/* Responsive adjustments for POS */
@media (max-width: 360px) {
    .pos-form-row {
        flex-wrap: wrap;
    }

    .pos-form-row #pos-obat-select,
    .pos-form-row .select2-container {
        flex: 1 1 100%;
    }

    .pos-form-row .pos-qty-input {
        flex: 1;
    }

    .pos-form-row .pos-add-btn {
        flex: 1;
    }
}

/* Grid for Obat/Barang */
.obat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.obat-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    text-align: center;
    border: 1px solid #eee;
}

.obat-icon {
    width: 50px;
    height: 50px;
    background: #eef6ff;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 10px;
}

.obat-card h5 {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text-main);
}

.obat-card p {
    font-size: 13px;
    color: var(--primary-dark);
    font-weight: 600;
}

/* Responsive Desktop Layout - Full Width Adaptation */
@media (min-width: 768px) {
    body {
        background-color: var(--bg-light);
    }

    .app-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-shadow: none !important;
        min-height: 100vh;
    }

    .sticky-nav {
        padding: 15px 40px !important;
        width: 100% !important;
    }

    .top-nav {
        width: 100% !important;
        max-width: 100% !important;
    }

    .main-header-curve {
        width: 100% !important;
        border-bottom-left-radius: 40px !important;
        border-bottom-right-radius: 40px !important;
    }

    .profile-card {
        margin: -35px 40px 25px 40px !important;
        width: calc(100% - 80px) !important;
    }

    .stats-card {
        padding: 25px 30px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .content-padding {
        padding: 0 40px !important;
        width: 100% !important;
    }

    .page-section {
        width: 100% !important;
    }

    .action-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 20px !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .obat-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 20px !important;
        width: 100% !important;
    }

    .bottom-nav {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 12px 60px 10px !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
    }

    .nav-item, .diamond-wrapper {
        flex: 1 !important;
        max-width: 250px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .login-container {
        max-width: 560px !important;
        width: 100% !important;
    }

    .table-responsive, table, .table-custom-header {
        width: 100% !important;
    }
}