/* ---------------------------------------------------
    1. GENERAL RESET & FONTS
----------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #f4f6f9;
    color: #333;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* ---------------------------------------------------
    2. LOGIN PAGE STYLES
----------------------------------------------------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 10px;
    color: #1e3c72;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #1e3c72;
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #2a5298;
}

.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 13px;
    text-align: left;
}
.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ---------------------------------------------------
    3. DASHBOARD LAYOUT (Wrapper)
----------------------------------------------------- */
.wrapper {
    display: flex;
    width: 100%;
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevent body scroll */
}

/* ---------------------------------------------------
    4. SIDEBAR
----------------------------------------------------- */
.sidebar {
    min-width: 260px;
    max-width: 260px;
    background: #2c3e50;
    color: #fff;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    z-index: 999;
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    text-align: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ecf0f1;
}

.sidebar-menu {
    padding: 10px 0;
    overflow-y: auto; /* Scrollable menu */
    flex: 1;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    font-size: 14px;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover, 
.sidebar-menu li a.active {
    background: #34495e;
    color: #fff;
    border-left-color: #3498db;
}

.sidebar-menu li a i {
    width: 25px;
    font-size: 16px;
    margin-right: 10px;
    text-align: center;
}

/* Sidebar Dropdown Arrow */
.arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}
.has-submenu.open > a .arrow {
    transform: rotate(180deg);
}

/* Submenu */
.sub-menu {
    max-height: 0;
    overflow: hidden;
    background: #233342;
    transition: max-height 0.3s ease-out;
}
.has-submenu.open .sub-menu {
    max-height: 500px; /* Arbitrary large height */
    transition: max-height 0.5s ease-in;
}

.sub-menu li a {
    padding-left: 55px;
    font-size: 13px;
    background: #233342;
}

/* ---------------------------------------------------
    5. MAIN CONTENT AREA
----------------------------------------------------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f4f6f9;
}

/* Top Bar */
.top-bar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.toggle-area {
    display: flex;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    margin-right: 15px;
}

.company-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    color: #e74c3c;
    font-size: 18px;
}

/* Content Body */
.content-area {
    flex: 1;
    overflow-y: auto; /* Content scroll */
    padding: 30px;
}

/* ---------------------------------------------------
    6. DASHBOARD CARDS
----------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: white;
    margin-right: 20px;
    flex-shrink: 0;
}

.blue { background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%); }
.green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.orange { background: linear-gradient(135deg, #fce38a 0%, #f38181 100%); }
.red { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

.card-info h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.card-info p {
    margin: 0;
    color: #95a5a6;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
/* ---------------------------------------------------
    7. MODERN UI ENHANCEMENTS (New Additions)
----------------------------------------------------- */

/* Modern Card Layout */
.modern-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eef2f6;
    overflow: hidden;
    margin-bottom: 30px;
}

.modern-card-header {
    background: #fff;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Floating Modern Table */
.modern-table-container {
    padding: 20px;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* Rows spacing */
}

.modern-table thead th {
    color: #95a5a6;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 10px 15px;
    border: none;
}

.modern-table tbody tr {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.3s;
}

.modern-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.modern-table td {
    padding: 15px;
    border: none;
    vertical-align: middle;
}

.modern-table td:first-child { border-radius: 10px 0 0 10px; }
.modern-table td:last-child { border-radius: 0 10px 10px 0; }

/* Status Badges */
.m-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.m-badge-success { background: #e8f5e9; color: #2e7d32; }
.m-badge-danger { background: #ffebee; color: #c62828; }
.m-badge-info { background: #e3f2fd; color: #1565c0; }

/* Rounded Avatar */
.m-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1e3c72;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* iOS Toggle Style for Permissions */
.m-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.m-switch input { opacity: 0; width: 0; height: 0; }
.m-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.m-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .m-slider { background-color: #1e3c72; }
input:checked + .m-slider:before { transform: translateX(18px); }

/* Permission Box Grid */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}
.perm-box {
    background: #f8f9fa;
    border: 1px solid #edf0f2;
    border-radius: 12px;
    padding: 15px;
}
.perm-box-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1e3c72;
}