/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f0f2f5;
}

a {
    color: #2c5aa0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Layout === */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100%;
    background: #1a1f2e;
    color: #ccc;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 100;
}

#sidebar.collapsed {
    transform: translateX(-240px);
}

#main {
    margin-left: 240px;
    min-height: 100%;
    transition: margin-left 0.3s ease;
}

#main.expanded {
    margin-left: 0;
}

/* === Sidebar === */
#sidebar-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #2a3042;
}

#logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

#company-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

#sidebar-nav {
    padding: 10px 0;
}

.nav-section {
    margin-bottom: 6px;
}

.nav-section-title {
    padding: 10px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #667;
}

.nav-item {
    display: block;
    padding: 8px 20px 8px 32px;
    color: #aab;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    background: #252b3b;
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    background: #2c5aa0;
    color: #fff;
}

/* === Top Bar === */
#topbar {
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 50;
}

#sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    margin-right: 16px;
    display: none;
}

#topbar-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

#topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#user-display {
    font-size: 13px;
    color: #555;
}

#logout-link {
    font-size: 13px;
    color: #c33;
}

/* === Content Area === */
#content {
    padding: 24px;
}

/* === Tables === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f7f8fa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.data-table tr:hover {
    background: #f9fbff;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: #2c5aa0;
    color: #fff;
}

.btn-primary:hover {
    background: #1e4a8a;
}

.btn-danger {
    background: #c33;
    color: #fff;
}

.btn-danger:hover {
    background: #a22;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* === Forms === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44,90,160,0.15);
}

/* === Cards / Panels === */
.panel {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* === Messages === */
.msg {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.msg-success {
    background: #e6f9e6;
    color: #276727;
    border: 1px solid #b3e6b3;
}

.msg-error {
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f5c6c6;
}

.msg-info {
    background: #e8f0fe;
    color: #1a4b8c;
    border: 1px solid #c4d9f5;
}

/* === Responsive === */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-240px);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #main {
        margin-left: 0;
    }

    #sidebar-toggle {
        display: block;
    }
}
