:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e67e22;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    /* Better base size for mobile */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Navigation */
nav {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping on mobile */
}

nav a {
    color: var(--white);
    text-decoration: none;
    margin-left: 15px;
    font-weight: 500;
    white-space: nowrap;
}

nav .brand {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: auto;
}

nav div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    /* Larger touch target */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button,
.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.3s;
    text-align: center;
}

button:hover,
.btn:hover {
    background-color: #d35400;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 600px;
    /* Force scroll on small screens */
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Utility */
.flex {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    /* Important for mobile */
}

.mt-20 {
    margin-top: 20px;
}

/* Mobile Specific */
@media (max-width: 768px) {
    .sticky-controls {
        position: static !important;
        /* Unstick on mobile to save space or manage better */
        border-radius: 8px !important;
    }

    .sticky-controls .flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .form-group {
        width: 100% !important;
        flex: none !important;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    nav div {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }

    nav a {
        margin-left: 0;
        margin-right: 15px;
        font-size: 0.9rem;
    }
}