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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #666;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

/* Main Content */
main {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

main h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

main p {
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

/* Apps Grid */
.apps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.app-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.app-card .icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.app-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #667eea;
}

.app-card.secondary h3 {
    color: #764ba2;
}

.app-card p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.no-access {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
}

.no-access p {
    color: #856404;
    margin: 10px 0;
}

/* Footer */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 20px;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
    text-align: center;
}

.login-box h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    text-align: center;
}

.info-text {
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.help-text {
    display: block;
    color: #666;
    font-size: 13px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

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

/* Links */
.links {
    margin-top: 20px;
    text-align: center;
}

.links a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.links a:hover {
    text-decoration: underline;
}

/* TOTP Notice */
.totp-notice {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.totp-notice strong {
    display: block;
    color: #1976d2;
    margin-bottom: 5px;
}

.totp-notice p {
    color: #0d47a1;
    font-size: 14px;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    main {
        padding: 20px;
    }

    .apps {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 30px 20px;
    }
}

/* Danger button for destructive actions */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Admin portal card styling */
.app-card.admin h3 {
    color: #e67e22;
}

.app-card.admin:hover {
    border-color: #e67e22;
}
