:root {
    --primary-color: #54a39f;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-color: #e0e6ed;
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --sidebar-width: 260px;
}

body.dark-mode {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e0e6ed;
    --border-color: #0f3460;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition), color var(--transition);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3d807d; }

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slideRight {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: var(--transition);
    z-index: 100;
}

.logo-container {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85px;
}
.logo-container img { max-width: 80%; height: auto; transition: 0.3s; }
.logo-container img:hover { transform: scale(1.05); }
.logo-light { display: block; }
.logo-dark { display: none; }
body.dark-mode .logo-light { display: none; }
body.dark-mode .logo-dark { display: block; }

.nav-links {
    list-style: none;
    overflow-y: auto;
    padding: 15px 0;
    flex: 1;
}

.section-title {
    padding: 15px 20px 5px;
    font-size: 12px;
    text-transform: uppercase;
    color: #7f8c8d;
    font-weight: bold;
    letter-spacing: 1px;
    animation: slideRight 0.5s ease backwards;
}

.nav-links li { animation: slideRight 0.5s ease backwards; }
.nav-links li:nth-child(1) { animation-delay: 0.1s; }
.nav-links li:nth-child(2) { animation-delay: 0.2s; }
.nav-links li:nth-child(3) { animation-delay: 0.3s; }
.nav-links li:nth-child(4) { animation-delay: 0.4s; }

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.nav-links li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    font-size: 18px;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.nav-links li a:hover, .nav-links li a.active {
    background: rgba(84, 163, 159, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}
.nav-links li a:hover i { transform: scale(1.2); }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-header {
    height: 65px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.user-info { display: flex; align-items: center; gap: 15px; animation: slideUpFade 0.6s ease; }
.user-info span { font-weight: bold; color: var(--primary-color); }

.action-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px; height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: flex; justify-content: center; align-items: center;
    text-decoration: none;
}
.action-btn:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(84, 163, 159, 0.3); }
.action-btn:active { transform: translateY(0) scale(0.95); }
.action-btn.logout-btn:hover { background: #e74c3c; border-color: #e74c3c; color: white; box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3); }

#content-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-color);
}

.page-wrapper { padding: 30px; overflow-y: auto; height: 100%; animation: slideUpFade 0.6s ease forwards; }
.page-title { color: var(--primary-color); margin-bottom: 25px; font-size: 24px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }

.global-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.link-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: var(--transition);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: slideUpFade 0.6s ease backwards;
}

.link-card i { font-size: 45px; color: var(--primary-color); transition: transform 0.4s; }
.link-card h3 { font-size: 18px; margin: 0; }
.link-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(84, 163, 159, 0.25);
}
.link-card:hover i { transform: scale(1.1) rotate(5deg); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 25px; margin-bottom: 30px; }
.admin-card { background: var(--card-bg); padding: 25px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid var(--border-color); animation: slideUpFade 0.6s ease backwards; }
.admin-card:nth-child(1) { animation-delay: 0.1s; }
.admin-card:nth-child(2) { animation-delay: 0.2s; }
.admin-card:nth-child(3) { animation-delay: 0.3s; }
.admin-card h3 { color: var(--primary-color); margin-top: 0; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.admin-form input, .admin-form select {
    width: 100%; padding: 12px; margin-bottom: 15px; border-radius: 6px;
    border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-color);
    outline: none; transition: 0.3s;
}
.admin-form input:focus, .admin-form select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(84, 163, 159, 0.1); }
.btn-submit {
    width: 100%; background: var(--primary-color); color: white; border: none;
    padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 15px; transition: 0.3s;
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(84, 163, 159, 0.3); }
.btn-submit:active { transform: translateY(0) scale(0.98); }

table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 30px; animation: slideUpFade 0.7s ease backwards; animation-delay: 0.4s; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); transition: background 0.3s; }
th { background: var(--primary-color); color: white; font-weight: bold; }
tr:hover td { background: rgba(84, 163, 159, 0.05); }

.badge { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; color: white; }
.badge-admin { background: #e74c3c; }
.badge-emp { background: #3498db; }
.badge-global { background: #2ecc71; }
.badge-personal { background: #f39c12; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; overflow: hidden; }
.login-box { background: var(--card-bg); padding: 40px; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid var(--border-color); text-align: center; animation: scaleIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.login-box img { max-width: 200px; margin-bottom: 20px; transition: transform 0.5s; }
.login-box img:hover { transform: scale(1.05); }
.login-box h2 { color: var(--primary-color); margin-bottom: 25px; font-size: 22px; }
.login-box input { width: 100%; padding: 14px 15px; margin-bottom: 20px; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-color); border-radius: 6px; outline: none; font-size: 16px; text-align: center; letter-spacing: 2px; transition: 0.3s; font-weight: bold; }
.login-box input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(84, 163, 159, 0.2); }
.login-btn { width: 100%; background: var(--primary-color); color: white; padding: 14px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 16px; transition: var(--transition); display: flex; justify-content: center; align-items: center; gap: 8px; }
.login-btn:hover { background: #3d807d; transform: translateY(-3px); box-shadow: 0 6px 15px rgba(84, 163, 159, 0.3); }
.login-btn:active { transform: translateY(0) scale(0.98); }
.error-msg { color: #e74c3c; background: rgba(231, 76, 60, 0.1); padding: 12px; border-radius: 6px; margin-bottom: 20px; font-weight: bold; font-size: 14px; animation: slideRight 0.3s ease; }