:root {
    --primary: #3498db;
    --primary-hover: #2980b9;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --danger: #e74c3c;
    --success: #27ae60;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    body {
        padding: 20px;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    header {
        margin-bottom: 40px;
    }
}

h1 {
    color: var(--text-color);
    font-weight: 300;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
}

.card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .card {
        padding: 30px;
    }
}

.login-form {
    max-width: 400px;
    margin: 40px auto;
}

@media (min-width: 768px) {
    .login-form {
        margin: 100px auto;
    }
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* Touch target size */
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger);
}

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

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

@media (max-width: 991px) {
    .table-responsive {
        overflow-x: visible;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        border: 1px solid #e0e0e0;
        margin-bottom: 20px;
        border-radius: 10px;
        padding: 5px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    
    td {
        border: none;
        border-bottom: 1px solid #f5f5f5;
        position: relative;
        padding: 12px 10px 12px 40% !important;
        text-align: right !important;
        min-height: 45px;
        display: block;
        width: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    td:last-child {
        border-bottom: none;
        text-align: center !important;
        padding-left: 10px !important;
        background: #fcfcfc;
        border-radius: 0 0 8px 8px;
        margin-top: 5px;
    }
    
    td:before {
        position: absolute;
        top: 12px;
        left: 10px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        text-align: left;
        font-weight: 700;
        color: var(--text-color);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .actions {
        justify-content: center;
        width: 100%;
    }
}

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

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-json {
    background: #e1f5fe;
    color: #039be5;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fde8e8;
    color: #c81e1e;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
    }
}

.logout-link {
    color: var(--text-light);
    text-decoration: none;
}

.logout-link:hover {
    color: var(--danger);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
}

.btn-icon svg {
    pointer-events: none;
}

