/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a4d2e;
    min-height: 100vh;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

/* Center container untuk halaman login */
.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;   /* center vertikal */
    justify-content: center; /* center horizontal */
    position: relative;
    z-index: 10;           /* di atas background hijau */
}


/* Background Layers */
.bg-layer-1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2d6a3f 0%, #1a4d2e 50%, #0d3d1f 100%);
    z-index: 0;
}

.bg-layer-2 {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 70%;
    height: 140%;
    background: linear-gradient(145deg, rgba(50,90,60,0.6) 0%, rgba(30,70,45,0.3) 50%, transparent 100%);
    transform: rotate(-8deg) skewY(-3deg);
    z-index: 1;
}

.bg-layer-3 {
    position: absolute;
    bottom: -15%;
    right: -10%;
    width: 60%;
    height: 130%;
    background: linear-gradient(325deg, rgba(40,80,50,0.5) 0%, rgba(25,60,35,0.2) 50%, transparent 100%);
    transform: rotate(5deg) skewY(2deg);
    z-index: 1;
}

.bg-accent-line {
    position: absolute;
    top: 30%;
    left: -5%;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(212,175,55,0.4) 50%, transparent 100%);
    transform: rotate(-8deg);
    z-index: 1;
}

/* Container & Cards */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.card {
    background: rgba(255,255,255,0.98);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    margin-bottom: 16px;
    border: 1px solid rgba(45,90,63,0.2);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.title {
    color: #1a4d2e;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.title-accent {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.title-accent::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, #d4af37 0%, transparent 100%);
}

.small {
    font-size: .85rem;
    color: #555;
}

/* Login Box */
.login-box {
    max-width: 500px;
    margin: 60px auto;
    padding: 40px;
    border-radius: 16px;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
    border: 2px solid rgba(45,90,63,0.3);
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    position: relative;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #d4af37 50%, transparent 100%);
}

.login-header .subtitle {
    color: #5a8c69;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.login-header h3 {
    color: #1a4d2e;
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 10px 0;
    line-height: 1.2;
}

.login-header .company-name {
    color: #2d6a3f;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    margin-top: 10px;
}

.login-header .address {
    color: #666;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 12px;
    line-height: 1.5;
}

/* Form Elements */
.form-row {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #1a4d2e;
    font-weight: 700;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #d0d0d0;
    font-size: .95rem;
    transition: all 0.3s;
    background: #fff;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2d6a3f;
    box-shadow: 0 0 0 3px rgba(45,106,63,0.1);
}

textarea {
    min-height: 60px;
    resize: vertical;
}

select {
    background: #fff;
    cursor: pointer;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #2d6a3f 0%, #3d7a4f 100%);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(45,106,63,0.3);
}

.btn:hover {
    background: linear-gradient(135deg, #3d7a4f 0%, #2d6a3f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45,106,63,0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn.secondary {
    background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%);
    color: #2d6a3f;
}

.btn.secondary:hover {
    background: linear-gradient(135deg, #d8d8d8 0%, #c8c8c8 100%);
}

.btn.success {
    background: linear-gradient(135deg, #3d7a5f 0%, #2d6a4f 100%);
}

.btn.success:hover {
    background: linear-gradient(135deg, #2d6a4f 0%, #3d7a5f 100%);
}

.btn.danger {
    background: linear-gradient(135deg, #c1121f 0%, #a01019 100%);
}

.btn.danger:hover {
    background: linear-gradient(135deg, #a01019 0%, #c1121f 100%);
}

.btn.warning {
    background: linear-gradient(135deg, #ff9f1c 0%, #f08a5f 100%);
}

.btn.warning:hover {
    background: linear-gradient(135deg, #f08a5f 0%, #ff9f1c 100%);
}

.btn-sm {
    padding: 8px 12px;
    font-size: .85rem;
}

/* Messages */
.error {
    background: linear-gradient(135deg, #c1121f 0%, #a01019 100%);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(193,18,31,0.3);
}

.success-msg {
    background: linear-gradient(135deg, #3d7a5f 0%, #2d6a4f 100%);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(45,106,79,0.3);
}

/* Controls */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Table */
.table-wrap {
    overflow: auto;
    max-height: calc(100vh - 350px);
    min-height: 300px;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    font-size: .88rem;
}

th {
    background: linear-gradient(135deg, #2d6a3f 0%, #3d7a4f 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

tr:hover {
    background: #f5f9f7;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 16px;
    font-weight: 700;
    font-size: .75rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge.active {
    background: linear-gradient(135deg, #3d7a5f 0%, #2d6a4f 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(45,106,79,0.3);
}

.badge.expired {
    background: linear-gradient(135deg, #c1121f 0%, #a01019 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(193,18,31,0.3);
}

.badge.free {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(33,150,243,0.3);
}

.badge.paid {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,152,0,0.3);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: .85rem;
}

.page-btn {
    background: #f5f5f5;
    border: 2px solid #d8d8d8;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.page-btn.active {
    background: linear-gradient(135deg, #2d6a3f 0%, #3d7a4f 100%);
    color: #fff;
    border-color: #2d6a3f;
}

.page-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.page-btn:hover:not(:disabled):not(.active) {
    background: #e5e5e5;
    transform: translateY(-1px);
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.welcome {
    font-weight: 700;
    color: #2d6a3f;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout {
    background: linear-gradient(135deg, #c1121f 0%, #a01019 100%);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s;
}

.logout:hover {
    background: linear-gradient(135deg, #a01019 0%, #c1121f 100%);
    transform: translateY(-1px);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #2d6a3f;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Special Rows */
.action-row {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border-left: 4px solid #ff9f1c;
    margin: 8px 0;
}

.action-row td {
    padding: 12px 8px !important;
}

.temp-row {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
}

.temp-row td {
    padding: 12px 8px !important;
}

/* Checkbox */
.checkbox-cell {
    text-align: center;
    width: 40px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2d6a3f;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 10px;
    backdrop-filter: blur(3px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0,0,0,0.4);
    border: 2px solid rgba(45,106,63,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, #d4af37 0%, transparent 100%);
}

.modal-header h3 {
    color: #2d6a3f;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    transition: all 0.3s;
}

.close-btn:hover {
    color: #2d6a3f;
    transform: rotate(90deg);
}

/* Form Styles */
.readonly-field {
    background: #f5f5f4;
    color: #666;
    cursor: not-allowed;
}

.action-form {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    padding: 14px;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid #d8d8d8;
}

.action-label {
    font-size: .85rem;
    color: #555;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #d8d8d8;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45,106,63,0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #2d6a3f;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: .85rem;
    color: #555;
    margin-top: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pending-badge {
    background: linear-gradient(135deg, #ff9f1c 0%, #f08a5f 100%);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 700;
    margin-left: 6px;
    box-shadow: 0 2px 8px rgba(255,159,28,0.3);
}

/* Price Info */
.price-info {
    background: #e8f5e9;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: .9rem;
    border: 1px solid #4caf50;
}

.price-label {
    font-weight: 600;
    color: #2d6a3f;
}

.price-value {
    font-weight: 800;
    color: #1a4d2e;
    font-size: 1.1rem;
}

/* Freeze Alert Badge */
.freeze-alert-badge {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: freezePulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.freeze-alert-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: freezeShine 3s ease-in-out infinite;
}

@keyframes freezePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 24px rgba(220, 38, 38, 0.6);
    }
}

@keyframes freezeShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.freeze-icon {
    font-size: 1.1rem;
    animation: freezeShake 1s ease-in-out infinite;
}

@keyframes freezeShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.freeze-text {
    font-weight: 900;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.freeze-date {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

/* Responsive */
@media(max-width:768px) {
    body {
        padding: 8px;
    }
    
    .card {
        padding: 14px;
    }
    
    .title {
        font-size: 1.1rem;
    }
    
    th, td {
        padding: 8px 5px;
        font-size: .82rem;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: .88rem;
    }
    
    .table-wrap {
        max-height: calc(100vh - 400px);
    }
    
    .controls {
        justify-content: center;
    }
    
    .header {
        text-align: center;
    }
    
    input[type="text"], select {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .login-box {
        padding: 28px;
    }
    
    .login-header h3 {
        font-size: 1.8rem;
    }
    
    .freeze-alert-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
        gap: 6px;
    }
    
    .freeze-date {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}