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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Frontend (public pages) styles */
.frontend-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.frontend-header {
    background: #262730;
    padding: 0 2rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.header-brand a {
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.frontend-main {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.frontend-footer {
    background: #262730;
    color: white;
    text-align: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.frontend-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.install-link {
    color: #4a90d9;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    display: inline-block;
}

.install-link:hover {
    text-decoration: underline;
}

.install-btn {
    background: #4a90d9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.install-btn:hover {
    background: #357abd;
}

/* Login page styles */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90d9;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: #4a90d9;
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.info-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.info-text a {
    color: #4a90d9;
    text-decoration: none;
}

.alert {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.navbar {
    background: #262730;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: 0.3s;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #ddd;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: #3d3d4a;
    color: white;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #262730;
    min-width: 180px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    flex-direction: column;
    gap: 0;
}

.dropdown-menu a {
    padding: 0.75rem 1rem !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #3d3d4a;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.user-info {
    color: #4CAF50;
    font-weight: bold;
    text-decoration: none;
}

.user-info:hover {
    background: transparent;
}

.user-info small {
    color: #aaa;
}

.nav-links a.active {
    background: #4CAF50;
    color: white !important;
}

.dropdown-menu a.active {
    background: #3d3d4a;
}

.logout-btn {
    background: #e74c3c !important;
    color: white !important;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

.app-footer {
    background: #262730;
    text-align: center;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-footer a {
    color: #4a90d9;
    text-decoration: none;
    font-weight: 500;
}

.app-footer a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: #262730;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-stack .form-row {
    margin-bottom: 1rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.stats-cards {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #262730;
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

.stat-warning .stat-value {
    color: #e74c3c;
}

.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.data-table th {
    background: #262730;
    color: white;
    font-weight: 500;
}

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

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #3498db;
    color: white;
}

.badge-success {
    background: #27ae60;
}

.badge-warning {
    background: #f39c12;
}

.success-message {
    color: #27ae60;
    font-weight: bold;
    padding: 1rem;
    background: #d4edda;
    border-radius: 4px;
}

.warning {
    color: #856404;
    background: #fff3cd;
    padding: 1rem;
    border-radius: 4px;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box button {
    width: 100%;
}

.info-text {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-cards {
        flex-direction: column;
    }
    
    .form-inline {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 1rem;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a, .user-info, .logout-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }
}

/* Rent View Page */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.detail-item {
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}
.detail-item label {
    display: block;
    font-weight: bold;
    color: #666;
    font-size: 0.8em;
    margin-bottom: 3px;
}
.detail-item span {
    font-size: 1em;
}
.form-group {
    margin-top: 15px;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
}
.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-details div {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* Pagination */
.page-info {
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border-radius: 4px;
}

/* Rent Cards for Mobile */
.desktop-table {
    display: table;
}
.mobile-cards {
    display: none;
}
.rent-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.rent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.rent-card-body {
    margin-bottom: 10px;
}
.rent-card-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}
.rent-card-row span:first-child {
    color: #666;
    font-size: 0.9em;
}
.rent-card-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.rent-card-actions .btn {
    flex: 1;
    text-align: center;
}

@media (max-width: 768px) {
    .desktop-table {
        display: none;
    }
    .mobile-cards {
        display: block;
    }
}
