@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-size: 13px;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 25px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 18px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.header h2 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin: 0;
}
.userinfo {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.userinfo a {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.userinfo a:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-1px);
}
.badge-admin {
    background: #ffd966;
    color: #333;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}
.table td {
    padding: 10px;
    border-bottom: 1px solid #eef1f5;
    vertical-align: middle;
}
.table tbody tr:hover { background: #f8f9ff; }
.table tbody tr:nth-child(even) { background: #fafbff; }
.table tbody tr:nth-child(even):hover { background: #f2f4ff; }

.filter {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9ff;
    border: 1px solid #e0e4f0;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.filter label { font-weight: 600; color: #5a3fa0; display: flex; align-items: center; gap: 5px; }
.filter select, .filter input[type="text"] {
    padding: 7px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s;
}
.filter select:focus, .filter input:focus {
    outline: none; border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

button, .btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
button:not(.btn-save):not(.absen-btn) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
button:not(.btn-save):not(.absen-btn):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102,126,234,0.4);
}
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-success { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #f39c12, #e67e22); color: #fff; }
.btn-danger  { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }
.btn-info    { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; }
.btn:hover { transform: translateY(-2px); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(102,126,234,0.4); }
.btn-success:hover { box-shadow: 0 6px 18px rgba(46,204,113,0.4); }
.btn-warning:hover { box-shadow: 0 6px 18px rgba(243,156,18,0.4); }
.btn-danger:hover  { box-shadow: 0 6px 18px rgba(231,76,60,0.4); }
.btn-info:hover    { box-shadow: 0 6px 18px rgba(52,152,219,0.4); }

.btn-save {
    margin-top: 15px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    font-size: 14px;
}
.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(46,204,113,0.5);
}

.login-box {
    max-width: 400px;
    margin: 60px auto;
    background: #fff;
    padding: 35px 30px;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.login-box .login-logo {
    text-align: center;
    margin-bottom: 20px;
}
.login-box .login-logo i {
    font-size: 55px;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 20px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(102,126,234,0.4);
}
.login-box h2 {
    text-align: center;
    margin: 0 0 25px 0;
    color: #5a3fa0;
    font-size: 1.4rem;
}
.login-box label {
    display: block;
    margin-top: 14px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}
.login-box label i { color: #667eea; margin-right: 5px; }
.login-box input {
    width: 100%;
    padding: 12px 15px;
    margin-top: 2px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}
.login-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
}
.login-box button {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    justify-content: center;
}
.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102,126,234,0.4);
}

.err, .alert-danger {
    background: #fee;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.ok, .alert-success {
    background: #e8f8ef;
    border-left: 4px solid #2ecc71;
    color: #27ae60;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.alert-warning {
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    color: #e67e22;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.legend {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ddd;
}
.legend .box { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #999; }

.wrap-table { overflow-x: auto; border-radius: 10px; margin-top: 10px; }
table.absensi { border-collapse: collapse; font-size: 11px; width: 100%; }
table.absensi th, table.absensi td {
    border: 1px solid #d0d5e0;
    padding: 4px 5px;
    text-align: center;
    vertical-align: middle;
}
table.absensi th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
    padding: 8px 5px;
}
table.absensi th.nama { text-align: left; min-width: 150px; }
table.absensi tbody tr:hover { background: #f8f9ff; }
table.absensi td.nama { text-align: left; font-weight: 500; }

.cell-hadir          { background: #c8f7c5 !important; }
.cell-tidak          { background: #f7c5c5 !important; }
.cell-manual         { background: #fff3b0 !important; }
.cell-tidak-mengantar { background: #d0d0d0 !important; }

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.company-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e8ecf5;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    position: relative;
}
.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102,126,234,0.25);
    border-color: #667eea;
}
.company-card .cc-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}
.company-card .cc-icon {
    width: 45px; height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.company-card .cc-info h4 {
    font-size: 13px;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.3;
}
.company-card .cc-info .daerah {
    font-size: 11px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}
.company-card .cc-kode {
    display: inline-block;
    background: #eef1ff;
    color: #667eea;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    margin-left: auto;
    text-transform: uppercase;
}
.company-card .cc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
}
.cc-actions a {
    flex: 1;
    min-width: 90px;
    padding: 8px 10px;
    background: #f5f7ff;
    border-radius: 8px;
    text-decoration: none;
    color: #667eea;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.cc-actions a:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-2px);
}
.cc-actions a.admin-only { background: #fff8e1; color: #e67e22; }
.cc-actions a.admin-only:hover { background: #e67e22; color: #fff; }

.info-bar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9ff, #eef1ff);
    border-radius: 12px;
    margin: 15px 0;
}
.info-bar b { color: #5a3fa0; }

.nilai-box {
    background: linear-gradient(135deg, #f8f9ff, #eef1ff);
    border-left: 5px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.nilai-box p { color: #666; margin: 0 0 8px 0; font-size: 12px; }
.nilai-box .nilai-amount {
    font-size: 28px;
    font-weight: 700;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nilai-box .nilai-amount i { color: #2ecc71; }

.input-ket {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d0d5e0;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s;
}
.input-ket:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

@media (max-width: 700px) {
    body { padding: 10px; }
    .container { padding: 15px; }
    .header { flex-direction: column; text-align: center; }
    .company-grid { grid-template-columns: 1fr; }
}