:root {
    --primary: #008080;
    --primary-dark: #006666;
    --primary-light: #e6f2f2;
    --accent: #20b2aa;
    --bg: #0f1717;
    --card-bg: #1a2424;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --error: #ff5252;
    --success: #4caf50;
    --border: #2c3e3e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.login-header h1 span {
    color: var(--text);
    margin-left: 0.5rem;
    font-weight: 400;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
}

button {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: var(--primary-dark);
}

button:active {
    transform: scale(0.98);
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
    display: none;
}

/* Dashboard Layout */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
}

.sidebar-brand h2 {
    color: var(--primary);
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.nav-links {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.nav-link i {
    margin-right: 1rem;
    width: 20px;
}

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

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.section-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
}

.badge-barang { background: var(--success); }
.badge-jasa { background: #3498db; }
.badge-rental { background: #f39c12; }
.badge-wisata { background: #9b59b6; }
.badge-blue { background: #2196f3; }
.badge-green { background: #4caf50; }

.action-btn {
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.edit-btn { background-color: #3f51b5; }
.delete-btn { background-color: #f44336; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border);
}

.modal-header {
    margin-bottom: 1.5rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary { background-color: #555; }

img.preview-img {
    max-width: 100px;
    height: auto;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
}

/* Horizontal Tabs */
.horizontal-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: thin;
}

.horizontal-tabs::-webkit-scrollbar {
    height: 4px;
}

.horizontal-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.tab-btn {
    width: auto;
    min-width: max-content;
    padding: 0.6rem 1.5rem;
    background: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 2rem; /* Pill shape */
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.tab-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.tab-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.2);
}

/* Dependent Dropdown Styling */
select {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg);
    color: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    outline: none;
    cursor: pointer;
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.small-loader {
    position: absolute;
    right: 1rem;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-light);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
