@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #02aaa0;
    --primary-hover: #028a82;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --border-color: #dee2e6;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Nav */
header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    /* Adjust as needed */
    width: auto;
}

nav a {
    text-decoration: none;
    color: var(--dark-text);
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}

.logout-btn {
    color: var(--danger-color);
}

/* Main Content */
main {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Footer */
footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* Common Components */
.container-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

button {
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

/* Utilities */
.hidden {
    display: none;
}

.message {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    margin-top: 15px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Mobile Navigation & Responsive Tables */
.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-text);
    padding: 0;
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        padding: 10px 15px;
    }

    .brand {
        flex: 1;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 15px;
        border-top: 1px solid #eee;
    }

    nav.active {
        display: flex;
    }

    nav a {
        margin: 0;
        padding: 12px 0;
        border-bottom: 1px solid #f1f1f1;
        width: 100%;
        text-align: center;
    }

    /* Content Spacing */
    main {
        padding: 15px;
    }

    .container-box {
        padding: 15px;
    }

    /* Form Inputs */
    input,
    select,
    textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Responsive Tables (Card View) */
    table.responsive-table,
    table.responsive-table thead,
    table.responsive-table tbody,
    table.responsive-table th,
    table.responsive-table td,
    table.responsive-table tr {
        display: block;
    }

    table.responsive-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    table.responsive-table tr {
        border: 1px solid #e1e8e6;
        margin-bottom: 15px;
        border-radius: 8px;
        padding: 15px;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    table.responsive-table td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
        padding-top: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f8f9fa;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    table.responsive-table td:last-child {
        border-bottom: none;
    }

    table.responsive-table td:before {
        position: relative;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: #6c757d;
        width: 40%;
        content: attr(data-label);
        display: block;
    }

    /* Specific adjustment for action buttons in cards */
    table.responsive-table td button {
        margin-left: 5px;
    }
}