/* Variabel CSS untuk tema */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --danger-color: #e63946;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --light-text: #f8f9fa;
    --dark-text: #212529;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --light-bg: #121212;a
    --dark-bg: #f8f9fa;
    --light-text: #212529;
    --dark-text: #f8f9fa;
    --card-bg: #1e1e1e;
    --border-color: #444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    transition: var(--transition);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-scale {
    animation: scale 0.3s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Halaman Landing */
.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
}

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-features {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.feature-item i {
    font-size: 1.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.meter-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 300px;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.meter-reading {
    font-size: 1.5rem;
    font-weight: 700;
}

.meter-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4cc9f0, #4361ee);
    border-radius: 4px;
}

/* Halaman Auth */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--dark-text);
    opacity: 0.7;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Layout Aplikasi */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--dark-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--dark-text);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background: rgba(67, 97, 238, 0.1);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(67, 97, 238, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    color: var(--dark-text);
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--dark-text);
    opacity: 0.7;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Section Styles */
.section {
    margin-bottom: 3rem;
}

.section h2 {
    color: var(--dark-text);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.summary-content h3 {
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    opacity: 0.8;
}

.summary-value {
    color: var(--dark-text);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.summary-unit {
    color: var(--dark-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Recent Records */
.recent-records {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.record-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.record-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.record-service {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-text);
}

.record-date {
    color: var(--dark-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

.record-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.record-unit {
    font-size: 1rem;
    color: var(--dark-text);
    opacity: 0.7;
}

.record-photo img {
    width: 100%;
    border-radius: 10px;
    margin-top: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--dark-text);
    opacity: 0.7;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--dark-text);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-text);
    opacity: 0.7;
}

.input-with-icon input {
    padding-left: 3rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-full {
    width: 100%;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-success {
    background: rgba(76, 201, 240, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--dark-text);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-text);
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.close-modal:hover {
    opacity: 1;
    color: var(--danger-color);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-features {
        justify-content: center;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .nav-item {
        border-left: none;
        border-bottom: 4px solid transparent;
        white-space: nowrap;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .recent-records {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.stat-content h3 {
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.stat-value {
    color: var(--dark-text);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Filter Card */
.filter-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.filter-card h3 {
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Table Styles */
.table-container {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th,
.records-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.records-table th {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.records-table tr:hover {
    background: rgba(67, 97, 238, 0.05);
}

/* Service Badge */
.service-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-text);
}

.service-badge i {
    color: var(--primary-color);
}

/* Meter Reading */
.meter-reading,
.usage-amount,
.cost {
    font-weight: 600;
    color: var(--dark-text);
}

.unit {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Photo Thumbnail */
.photo-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.photo-thumbnail:hover {
    transform: scale(1.1);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-photo {
    color: var(--dark-text);
    opacity: 0.5;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    color: var(--danger-color);
    background: rgba(230, 57, 70, 0.1);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* Service Settings */
.services-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.service-setting-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.service-setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.service-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.service-details h3 {
    color: var(--dark-text);
    margin-bottom: 0.25rem;
}

.service-details p {
    color: var(--dark-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Tariff Settings */
.tariff-settings {
    margin-top: 1rem;
}

.tariff-settings h4 {
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.tariff-type-selector {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.tariff-type-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--dark-text);
}

.rate-setting {
    display: none;
}

.rate-setting.active {
    display: block;
}

/* Tiered Rates */
.tiered-rates-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tier-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(67, 97, 238, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.tier-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tier-inputs input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--card-bg);
    color: var(--dark-text);
}

.tier-inputs span {
    color: var(--dark-text);
    opacity: 0.7;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Section Description */
.section-description {
    color: var(--dark-text);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

/* Responsive Design Improvements */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .records-table {
        font-size: 0.9rem;
    }
    
    .records-table th,
    .records-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .service-setting-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .tariff-type-selector {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tier-inputs {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tier-inputs input {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .service-info {
        flex-direction: column;
        text-align: center;
    }
}

/* Initial Meter Setting */
.initial-meter-setting {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(67, 97, 238, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.initial-meter-setting h4 {
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

.setting-description {
    color: var(--dark-text);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Tiered Header */
.tiered-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tiered-header h5 {
    margin: 0;
    color: var(--dark-text);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Tier Input Improvements */
.tier-inputs {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.tier-inputs span {
    white-space: nowrap;
    color: var(--dark-text);
    opacity: 0.8;
}

.tier-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--card-bg);
    color: var(--dark-text);
}

/* Responsive Tier Inputs */
@media (max-width: 768px) {
    .tier-inputs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .tier-inputs span {
        text-align: center;
    }
    
    .tiered-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Form Validation Styles */
input:invalid {
    border-color: var(--danger-color);
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: ' Memproses...';
}

/* Rate Setting Styles */
.rate-setting {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(67, 97, 238, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.rate-setting.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Tariff Type Selector */
.tariff-type-selector {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tariff-type-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--dark-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tariff-type-selector label:hover {
    border-color: var(--primary-color);
}

.tariff-type-selector input[type="radio"] {
    margin: 0;
}

.tariff-type-selector input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.tariff-type-selector label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
}

/* Tier Input Improvements */
.tier-inputs {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.tier-inputs span {
    white-space: nowrap;
    color: var(--dark-text);
    opacity: 0.8;
    font-size: 0.9rem;
}

.tier-inputs input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--card-bg);
    color: var(--dark-text);
    font-size: 0.9rem;
}

.tier-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.1);
}

/* Tier Header */
.tiered-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tiered-header h5 {
    margin: 0;
    color: var(--dark-text);
    font-size: 1.1rem;
}

/* Responsive Design for Tier Inputs */
@media (max-width: 768px) {
    .tariff-type-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tier-inputs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .tier-inputs span {
        justify-self: center;
    }
    
    .tiered-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tiered-header .btn-small {
        align-self: stretch;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ensure all inputs are properly styled */
.rate-setting input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--dark-text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.rate-setting input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Button small style */
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

/* Edit Record Modal Specific Styles */
#current-photo-container {
    background: rgba(67, 97, 238, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

#current-photo-container p {
    margin-bottom: 0.5rem;
    color: var(--dark-text);
    font-weight: 600;
}

#remove_photo {
    margin-right: 0.5rem;
}

/* Enhanced Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-icon {
    background: none;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    color: var(--danger-color);
    background: rgba(230, 57, 70, 0.1);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* Modal Enhancements */
.modal-content {
    max-width: 500px;
    width: 90%;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive Table Actions */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}