/* General */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #f0f2f5;
}

/* Sidebar */
.sidebar {
    width: 220px;
    height: 100vh;
    background: #2c3e50;
    position: fixed;
    padding: 20px;
    color: white;
}

.sidebar h3 {
    margin-bottom: 30px;
    font-size: 20px;
}

.sidebar a {
    display: block;
    color: white;
    padding: 10px 0;
    text-decoration: none;
    font-size: 14px;
}

.sidebar a:hover {
    background: #34495e;
    border-radius: 5px;
    padding-left: 10px;
}

/* Main Content */
.content {
    margin-left: 240px;
    padding: 20px 30px;
}

/* Header: Tambah & Cari */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Tombol Tambah Surat */
.btn-tambah {
    background-color: #2c3e50;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-tambah {
    background-color: #2c3e50;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-tambah:hover {
    background-color: #34495e;
}

.search-form {
    display: flex;
    gap: 6px;
}

.search-form input[type="text"] {
    padding: 6px 10px;
    width: 180px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.search-form button {
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    background-color: #2c3e50;
    color: white;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #34495e;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

th {
    background: #34495e;
    color: white;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Login Page */
.login-body {
    background: linear-gradient(to right, #2c3e50, #4ca1af);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', sans-serif;
}

.login-container {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 340px;
    animation: fadeIn 0.4s ease-in-out;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 90%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    border-color: #4ca1af;
    outline: none;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.login-container button:hover {
    background: #1f2d3a;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Modal Overlay */
.modal {
    display: none; /* 🔥 This is critical */
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

/* Modal Box */
.modal-content {
    background-color: #fff;
    width: 400px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

/* Animation */
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close Button */
.close {
    position: absolute;
    right: 18px;
    top: 14px;
    font-size: 20px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Input Fields */
.modal-content input[type="text"],
.modal-content input[type="date"],
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    box-sizing: border-box;
}

/* Label */
.modal-content label {
    font-weight: bold;
    margin-bottom: 6px;
    display: block;
}

/* Submit Button */
.modal-content button {
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.modal-content button:hover {
    background-color: #34495e;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    padding: 8px 16px;
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 5px;
}

.pagination a:hover {
    background-color: #34495e;
}

.pagination span {
    padding: 8px 16px;
    color: #333;
}

#scrollBtn {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 30px;
    z-index: 99;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: #2c3e50;
    color: white;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#scrollBtn:hover {
    background-color: #34495e;
}

.summary-box {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}
.summary-box div {
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}